Skip to content

Removing SplitMapControl doesn't update the map layers #1233

Open
QuantStack/leaflet-splitmap
#14
@dfguerrerom

Description

@dfguerrerom

Removing SplitMapControl doesn't update the map layers, if I remove this control, I would expect to leave the map as it was before of adding it? this, however doesn't happen in the MapView who triggered the event, but if I create a new view, it removes successfully the added layres.

To recreate

Screencast.from.04-10-2024.11.28.59.webm
from ipyleaflet import Map, TileLayer, SplitMapControl
center = [34.6252978589571, -77.34580993652344]
zoom = 10
m = Map(center=center, zoom=zoom)


left = TileLayer(
    url="https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"
)
right = TileLayer(
    url="https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"
)
control = SplitMapControl(left_layer=left, right_layer=right)
m.add(control)

And, then....

m.remove(control)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions