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
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.
You're looping over elements in the panel, while going down the list, the thing that comes first gets removed and the thing you clicked gets added. Going up the list, you add before you remove.
I fixed this by adding two vars, toBeAdded and toBeRemoved, replaced addLayer and removeLayer in the if/else and stored the object in those, then simply fired removeLayer(toBeRemoved) followed by addLayer(toBeAdded) after the if/else to guarantee we always do the remove before the add.
When calling
removeLayer()
from withinmap.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.Removing a layer outside of the
map.on
event works as expected, the menu doesn't get wonky.The text was updated successfully, but these errors were encountered: