This example shows how to use the Leaflet SplitMap slider with ipyleaflet.
In [ ]:
from ipyleaflet import (
Map, TileLayer, SplitMapControl
)
In [ ]:
center = [34.6252978589571, -77.34580993652344]
zoom = 10
In [ ]:
m = Map(center=center, zoom=zoom)
m
In [ ]:
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(control)
In [ ]: