leaflet-touch-helper icon indicating copy to clipboard operation
leaflet-touch-helper copied to clipboard

Using this with leaflet FeatureGroup causes javascript error

Open ventralnet opened this issue 8 years ago • 2 comments

It looks like if you are using a leaflet feature group you end up getting a javascript error in the console. 'this._layer.on is not a function'.

https://codepen.io/anon/pen/pwbjvR

Would a simple

if (this._layer.on) {
....
}

Be the solution?

ventralnet avatar Jun 12 '17 18:06 ventralnet

Note: This seems to be an 0.7.7 specific issue since L.LayerGroup has no 'on' function. In 1.0.3 L.LayerGroup has an 'on' function.

ventralnet avatar Jun 13 '17 12:06 ventralnet

Thanks for notifying me on this and submitting a detailed description.

Given that Leaflet 1.0 has been out for a while and I no longer work in any project based on 0.7, it's not likely I will spend time on fixing this. I would happily accept a fix for this as long as it's non-intrusive.

perliedman avatar Jun 14 '17 09:06 perliedman