title: How can I grab a selection of markers with Leaflet.draw?
body: <p><strong>Context:</strong></p>
  
  <p>I've made a map, and populated it with around 300 random markers. I can 'select' the markers by clicking on a link in the popup and activate a selection to display data from. I also have the Leaflet.draw plugin to draw shapes like circles, rectangles and custom shapes, and I would like to use it to 'select' a couple of markers.</p>
  
  <p><strong>The issue</strong></p>
  
  <p>How can I grab the leaflet marker object of the markers that fall inside a drawn leaflet.draw shape so I can edit them? I cannot seem to make a selection, It either selects none of the markers, or all of them.</p>
  
  <p>Code snippet, stripped from unnecessary code:</p>
  
  <pre><code>const drawControl = new L.Control.Draw({
      draw: {
          marker   : false,
          polygon  : true,
          polyline : false,
          rectangle: true,
          circle   : {
              metric: 'metric'
          }
      },
      edit: false
  });
  
  const map = L.map('map', {
      layers: [streets, light]
  }).setView([CONFIG.MAP.LATITUDE, CONFIG.MAP.LONGITUDE], CONFIG.MAP.ZOOMLEVEL)
  
  map.addControl(drawControl);
  
  map.on(L.Draw.Event.DRAWSTOP, e =&gt; {
  
      const hello = e.target;
  
      console.log(hello);
      e.target.eachLayer(layer =&gt; {
          if (layer.options.icon) {
              console.log(layer);
          }
      });
  
  });
  </code></pre>