I have many markers on my mapbox map. And how to know which marker is clicked. Here is my code
function zoomToFeature(e) { console.log(e);}function onEachFeature(feature, layer) { if (feature.properties && feature.properties.title){ layer.bindPopup(feature.properties.title); } layer.on({ click: zoomToFeature });}var country= L.geoJson(country).addTo(map);var marker = L.geoJson(markers,{ onEachFeature: onEachFeature}).addTo(map);
أكثر...
function zoomToFeature(e) { console.log(e);}function onEachFeature(feature, layer) { if (feature.properties && feature.properties.title){ layer.bindPopup(feature.properties.title); } layer.on({ click: zoomToFeature });}var country= L.geoJson(country).addTo(map);var marker = L.geoJson(markers,{ onEachFeature: onEachFeature}).addTo(map);
أكثر...