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

Fixed the rendering when there are groups and a layer is added #11

Closed droyad closed 9 years ago

droyad commented 9 years ago

When a layer is added after the initial creation, any groups vanish. The _update() function clears out the html of the base and overlay divs, and then recreates all the items using _addItem. However the _groups hash still contains the previous html element, so new groups do not get created. This change clears out the _groups hash before calling _update.

stefanocudini commented 9 years ago

tnk @droyad !