ipyleaflet
ipyleaflet copied to clipboard
SplitControl With Heatmap Layers
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).
Thanks for reporting! The splitcontrol might need some improvements. I'll try to find time to look into it.
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?
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.
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
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.
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!
Any update on this?
Is it possible to display a widget (e.g., legend) on top of the SplitControl?
Any update? It seems that the plugin behind has not much of activity.
Yes, unfortunately it doesn't have much activity. If someone wants to pick that up I would be happy to review a PR.