leaflet-panel-layers
leaflet-panel-layers copied to clipboard
`removeLayer()` not working properly from within `map.on`
When calling removeLayer()
from within map.on
event the baselayer menu gets a bit wonky. After removing even a single layer I can click thru the baselayers top to bottom just fine, but going out of order clicking at random requires I click the radio button twice. This also seemed to happen with overlay layers, requiring two clicks to check the box.
map.on('baselayerchange', (e) => {
control.removeLayer(somelayergrouphere);
}
Removing a layer outside of the map.on
event works as expected, the menu doesn't get wonky.