Using this code to let users mark where they see things on leaflet map but I want the markers to disappear after an hour. Is there a way I can set a time limit on them?
function getClickedLanLon(e) {
var lat,
lon,
zoom;
lat = e.latlng.lat;
lon = e.latlng.lng;
zoom = map.getZoom();
marker2 = new L.Marker(new L.LatLng(lat, lon));
map.addLayer(marker2);
marker.bindPopup("Cat Spotted").addTo(map);
}
map.on('click', getClickedLanLon);