bluehalo / ngx-leaflet

Core Leaflet package for Angular.io
MIT License
777 stars 127 forks source link

listener not found when using leafletBaseLayers #334

Open fkontic opened 2 years ago

fkontic commented 2 years ago

Hi, I have an issue with leafletBaseLayers. The problem is that when the leaflet directive/element gets destroyed, it outputs a bunch of listener not found warnings into the console and the more layers there are in leafletBaseLayers, the more warnings I get. And if I don't use leafletBaseLayers or leave it empty and just add the same exact layer to leafletOptions, it works flawlessly.

I have included a Stackblitz with the minimal repro. Just toggle the map by clicking the Toggle map button and open the console to see the warnings. You can also try to comment out Layer1 and uncomment layers from leafletOptions to see that it works fine in that case. https://stackblitz.com/edit/angular-ivy-xfhrrq

My environment (on Stackblitz): Angular 14.0.1 (although it doesn't work on Angular 13 either) ngx-leaflet 8.1.0 Leaflet 1.8.0