Using ipyleaflet widgets
ipyleaflet
is described as a bridge for producing interactive maps in a Jupyter Notebook. This means we can put a map into a Notebook and allow the user to scroll around to a different point of view with this widget.
The documentation on the maps used is sparse. I have found a reasonable example in the following points. Finally, looking at the source code for the widget on GitHub, there are a few dozen maps visible that the widget knows about and which can be pulled in.
Getting ready
We can install the widget using a conda
command:
conda install -c conda-forge ipyleaflet
ipyleaflets
can be installed with pip
as well.
Once completed, we can reference ipyleaflet
in a Notebook.
How to do it...
We are using a detailed worldwide street map from Esri
. The Notebook statements are:
from ipyleaflet import * m = Map(zoom=4, basemap=basemaps.Esri.WorldStreetMap) m m.zoom
This generates the first image of the west coast of Africa. I navigated to the streets of Boston for the shot.