jupyter-widgets / ipyleaflet

A Jupyter - Leaflet.js bridge
https://ipyleaflet.readthedocs.io
MIT License
1.48k stars 363 forks source link

Documentation error - SplitMapControl #1115

Open lachlanfrancis opened 1 year ago

lachlanfrancis commented 1 year ago

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
giswqs commented 1 year ago

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.

Peek 2023-05-31 23-15

banesullivan commented 1 year ago

Just encountered this as well. There is a broken example on this page: https://localtileserver.banesullivan.com/user-guide/rgb.html