Wildhoney / Leaflet.FreeDraw

:earth_asia: FreeDraw allows the free-hand drawing of shapes on your Leaflet.js map layer – providing an intuitive and familiar UX for creating geospatial boundaries similar to Zoopla and others. Included out-of-the-box is the concaving of polygons, polygon merging and simplifying, as well as the ability to add edges and modify existing shapes.
https://freedraw.herokuapp.com/
MIT License
544 stars 103 forks source link

Fetch latlngs behind polygons. #111

Closed ryazhang closed 6 years ago

ryazhang commented 6 years ago

I use leaflet to make some markers on the map. Then draw polygons among the map, like the following pic. image

How can I fetch latlngs of leaflet's markers? Could you please have a look? Thanks in advance.

Wildhoney commented 6 years ago

@ryazhang you should subscribe to the markers event:

freeDraw.on('markers', event => {
    console.log(event.latLngs);
});