Reputation: 203
In Google Colaboratory I have tried installing Ipleaflet using the command:
!pip install ipyleaflet
!jupyter nbextension enable --py --sys-prefix ipyleaflet
Which according to the output gets installed correctly however when I use the code:
from ipyleaflet import Map, basemaps, basemap_to_tiles
m = Map(center=(52.204793, 360.121558), zoom=9)
dark_matter_layer = basemap_to_tiles(basemaps.CartoDB.DarkMatter)
m.add_layer(dark_matter_layer)
m
The output I recieve is the text:
Map(basemap={'url': 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', 'max_zoom': 19, 'attribution': 'Map … rather than the map.
Is there a way to get Google-Colaboratory to be able to output this kind of a widget? Are there additional libraries that need to be installed?
I have tested the code (taken from the Ipleaflet documentation) in a Jupyter notebook on my PC and it works fine.
Upvotes: 2
Views: 1825