0

I'm using the last version of Leaflet and MarkerCluster.

enter image description here

After I draw a polygon on the map, I'd like to select all markers within it. I know the bounds of the polygon. Also, I know the coordinates of the markers.

map.on(L.Draw.Event.CREATED, function (e) {
    var type = e.layerType,
        layer = e.layer;

   for (var i = 0; i < markers.length; i++) {

   }

    editableLayers.addLayer(layer);
});

Thanks!

GSG
  • 53
  • 8
  • 3
    Take a look at: https://stackoverflow.com/questions/31790344/determine-if-a-point-reside-inside-a-leaflet-polygon – Adam Paxton Jun 02 '17 at 13:11
  • 2
    And here: https://stackoverflow.com/questions/44261122/how-can-i-grab-a-selection-of-markers-with-leaflet-draw/ – iH8 Jun 02 '17 at 14:34

0 Answers0