ipyleaflet
ipyleaflet copied to clipboard
Documentation error - SplitMapControl
Hi!
A minor issue with the documentation, not sure where was the best place to identify it.
In the documentation for SplitMapControl it displays correctly via web interface example, but when run locally the slider is glitchy and doesn't work. This is because dragging = True is default for Map. dragging needs to be changed to False for this to work as intended locally. Code change below with dragging change added.
from ipyleaflet import Map, basemaps, basemap_to_tiles, SplitMapControl
m = Map(center=(42.6824, 365.581), zoom=5, dragging = False)
right_layer = basemap_to_tiles(basemaps.NASAGIBS.ModisTerraTrueColorCR, "2017-11-11")
left_layer = basemap_to_tiles(basemaps.NASAGIBS.ModisAquaBands721CR, "2017-11-11")
control = SplitMapControl(left_layer=left_layer, right_layer=right_layer)
m.add_control(control)
m
Setting dragging=False is only a temporary workaround. Previously, you can drag the map in addition to using the SplitControl. The SplitControl bug needs to be fixed. The dragging param is not the root cause.
Just encountered this as well. There is a broken example on this page: https://localtileserver.banesullivan.com/user-guide/rgb.html