Custom Click handler for Marker click on a Geo Cluster map
How can I add custom processing when a geo maker is clicked on a geo cluster map?
-
Official comment
In the custom Javascript handler, you can retrieve the markers and apply an on click event handling. Example below draws a circle with a radius of 1000 meters for a clicked point:
map.eachLayer(function (layer) {if (layer instanceof L.Marker){layer.on("click", function (event) {var clickedMarker = event.layer;L.circle( event.latlng, {radius: 1000}).addTo(map);});}});Comment actions
Please sign in to leave a comment.
1 comment