stefanocudini / leaflet-panel-layers

Leaflet Control Layers extended with support groups and icons
https://opengeo.tech/maps/leaflet-panel-layers/
MIT License
286 stars 92 forks source link

Creates a new layer whenever checked/unchecked instead of adding/removing from map #35

Closed ahalota closed 6 years ago

ahalota commented 6 years ago

I noticed the layer-id changes when I add/remove the same item via the checkbox. This really messes with any functionality such as click handlers that may be attached to a layer, or other adjustments that might have been made during use (such as opacity controls, editing).

ahalota commented 6 years ago

This is happening with sublayers in a group. For example, if I have a group of 3 layers added to the panel, and the groupLayer has id 70, this one remains 70. However, as I check or uncheck the sublayers, they are assigned a new id.

ahalota commented 6 years ago

Closing this issue, wasn't related to the plugin instead to an issue with sublayers of L.Esri.DynamicMapLayers.

stefanocudini commented 6 years ago

hi @ahalota are you solved the problem? can you send me the solution in a PR please.. tnks