ipyleaflet icon indicating copy to clipboard operation
ipyleaflet copied to clipboard

SplitControl With Heatmap Layers

Open maboualidev opened this issue 4 years ago • 10 comments

The following code will not produce proper results:

mymap = Map(center=(lat, lon), zoom=4)
right_layer = Heatmap(locations=right_locations, max_zoom=max_zoom, radius=radius, max=max_value)
left_layer = Heatmap(locations=left_locations, max_zoom=max_zoom, radius=radius, max=max_value)
split_map_control = SplitMapControl(left_layer=left_layer , right_layer=right_layer )
mymap.add_control(split_map_control )
mymap

Both layers are shown on one side (right_side).

maboualidev avatar Mar 26 '20 15:03 maboualidev

Thanks for reporting! The splitcontrol might need some improvements. I'll try to find time to look into it.

martinRenou avatar Mar 26 '20 15:03 martinRenou

Thank for the great tool. Is there another way to do it?

Also if I have a 2D numpy array, is there a way to convert it to a tile layer and show it on leaflet without saving it to GeoTiff and creating tiles?

maboualidev avatar Mar 26 '20 20:03 maboualidev

Also if I have a 2D numpy array, is there a way to convert it to a tile layer and show it on leaflet without saving it to GeoTiff and creating tiles?

You can have a look at https://github.com/jupyter-widgets/ipyleaflet/blob/master/examples/Numpy.ipynb.

davidbrochart avatar Mar 26 '20 21:03 davidbrochart

The following code will not produce proper results:

mymap = Map(center=(lat, lon), zoom=4)
right_layer = Heatmap(locations=right_locations, max_zoom=max_zoom, radius=radius, max=max_value)
left_layer = Heatmap(locations=left_locations, max_zoom=max_zoom, radius=radius, max=max_value)
split_map_control = SplitMapControl(left_layer=left_layer , right_layer=right_layer )
mymap.add_control(split_map_control )
mymap

Both layers are shown on one side (right_side).

The problem exists also when using other layers in combination with SplitControl, such as GeoJSON, GeoData and Choropleths

martinomiani avatar Mar 30 '20 12:03 martinomiani

I'm also having the same issue with SplitMapControl, it seems to be very bugged with a lot of different layers, with GeoJSON object it shows only right side as well.

perone avatar Apr 07 '20 10:04 perone

Yes, unfortunately, the Spitmap control does not work properly. This is actually an issue with the SplitMapControl plugin for LeafletJS that we use https://github.com/QuantStack/leaflet-splitmap#readme. We improved it a bit recently. It needs a bit more testing. Anyone with JavaScript knowledge is very welcome to fix this!

martinRenou avatar Apr 07 '20 12:04 martinRenou

Any update on this?

msameeruddin avatar Sep 13 '21 17:09 msameeruddin

Is it possible to display a widget (e.g., legend) on top of the SplitControl?

image

giswqs avatar Sep 28 '21 19:09 giswqs

Any update? It seems that the plugin behind has not much of activity.

data-henrik avatar Dec 17 '21 07:12 data-henrik

Yes, unfortunately it doesn't have much activity. If someone wants to pick that up I would be happy to review a PR.

martinRenou avatar Dec 17 '21 08:12 martinRenou