leaflet.measure icon indicating copy to clipboard operation
leaflet.measure copied to clipboard

measure plugin is not working over geojson layer

Open softlove1 opened this issue 11 years ago • 1 comments

measure plugin is not working over geojson layer. there is any way to implement this plugin over any geojson polygon layer.

softlove1 avatar Aug 24 '13 02:08 softlove1

Even if it's an old post, this could help someone. I'm not completly sure why, but the geojson layers don't manage click events exactly like other layers. I tried to hack it in leaflet, but the projet is simply too big for a quick hack. In my fork I "fixed" it (it's not really a fix). I simply added a new custom event listener. Every time that I was listening an event on a geojson layer I simply added

map.fire('measure:click', e);

to be able to receive the blocked event in leaflet.measure.

DrPandemic avatar Aug 25 '15 04:08 DrPandemic