perliedman / leaflet-touch-helper

Make it easy to touch things in Leaflet
ISC License
20 stars 8 forks source link

Using this with leaflet FeatureGroup causes javascript error #3

Open ventralnet opened 7 years ago

ventralnet commented 7 years ago

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 commented 7 years ago

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.

perliedman commented 7 years ago

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.