ipyleaflet icon indicating copy to clipboard operation
ipyleaflet copied to clipboard

Documentation error - SplitMapControl

Open lachlanfrancis opened this issue 2 years ago • 2 comments

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

lachlanfrancis avatar May 25 '23 05:05 lachlanfrancis

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

giswqs avatar Jun 01 '23 03:06 giswqs

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

banesullivan avatar Jun 14 '23 15:06 banesullivan