You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: I currently have about 5 groups with several layers inside. Anytime I add or remove a layer in the code, using layer.addTo(map) or map.removeLayer(layer) it closes all the groups. This is understandably annoying.
Code example:
constlegendGroups=Array.from(document.querySelectorAll(`.leaflet-panel-layers-grouplabel`));legendGroups.forEach((group)=>{group.addEventListener('click',()=>{switch(group.innerText){case'-\nLayer1':
cleanMap();map.fitBounds(layer1.getBounds());layer1.addTo(map);/* The layer control collapses when this method executes */break;case'-\nLayer2':
cleanMap();map.fitBounds(layer2.getBounds());layer2.addTo(map);break;};});});
Edit: This also happens if I try to add any layer manually in the browser console. This really makes it seem that addTo and removeLayer methods are the point of conflict with the plugin.
The text was updated successfully, but these errors were encountered:
I did some tests and i think it is a problem of L.Control.Layers inherited from L.Control.PanelLayers
unless you have a solution to send in PR I don't think I can solve it in this plugin
Description: I currently have about 5 groups with several layers inside. Anytime I add or remove a layer in the code, using
layer.addTo(map)
ormap.removeLayer(layer)
it closes all the groups. This is understandably annoying.Code example:
Edit: This also happens if I try to add any layer manually in the browser console. This really makes it seem that
addTo
andremoveLayer
methods are the point of conflict with the plugin.The text was updated successfully, but these errors were encountered: