leaflet-splitmap
leaflet-splitmap copied to clipboard
fix: layer.getContainer could return null
If the layers have already been removed from the map before the control, layer.getContainer can return null. This would make the change in style throw, preventing the rest of the remove function from executing. By guarding against this, the control will now be correctly removed in both cases.
this PR might be combined with https://github.com/QuantStack/leaflet-splitmap/pull/14