Split map
Creating a split-panel map
This notebook demonstrates how to add a split-panel map with leafmap anf folium. It also supports streamlit. Note that the ipyleaflet SplitControl does not support streamlit.
Uncomment the following line to install geonexus if needed.
In [1]:
Copied!
# !pip install leafmap
# !pip install leafmap
In [2]:
Copied!
import geonexus.foliumap as geonexus
import geonexus.foliumap as geonexus
The split-panel map requires two layers: left_layer
and right_layer
. The layer instance can be a string representing a basemap, or an HTTP URL to a Cloud Optimized GeoTIFF (COG), or a folium TileLayer instance.
Using basemaps
In [3]:
Copied!
m = geonexus.Map()
m.add_split_map(left="openstreetmap", right="Esri World Imagery")
m.add_layer_control()
m
m = geonexus.Map()
m.add_split_map(left="openstreetmap", right="Esri World Imagery")
m.add_layer_control()
m
Out[3]:
Make this Notebook Trusted to load map: File -> Trust Notebook
***italicised text*Using COG**
In [4]:
Copied!
m = geonexus.Map(center=(32.7748, 22.6282), zoom=13)
left = "https://github.com/opengeos/data/releases/download/raster/Libya-2023-07-01.tif"
right = "https://github.com/opengeos/data/releases/download/raster/Libya-2023-09-13.tif"
m.add_split_map(left, right)
m
m = geonexus.Map(center=(32.7748, 22.6282), zoom=13)
left = "https://github.com/opengeos/data/releases/download/raster/Libya-2023-07-01.tif"
right = "https://github.com/opengeos/data/releases/download/raster/Libya-2023-09-13.tif"
m.add_split_map(left, right)
m
Out[4]:
Make this Notebook Trusted to load map: File -> Trust Notebook