ipyleaflet是基于leaflet的地图显示模块,提供了jupyterlab支持。ipyleaflet可进行地图动态显示,图形添加等。本人的安装环境为ubuntu18.04 + anaconda + python3.6

安装过程主要如下:

1、安装nodejs

conda install -c conda-forge nodejs=10.15.3

2、进行ipyleaflet安装

conda install -c conda-forge ipyleaflet

3、安装jupyter对应扩展

conda install -c conda-forge jupyterlab

jupyter labextension install jupyter-leaflet

jupyter labextension install @jupyter-widgets/jupyterlab-manager

jupyter lab build

4、检查扩展安装

 jupyter labextension list 

5、运行ipyleaflet示例

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

运行结果:

ipyleaflet 在ubuntu环境下的安装

注意:在jupyter扩展安装中,可能会报错,需要多次运行,安装完成后,有时需要重启jupyter notebook方可成功显示效果

 

6、相关链接:

ipyleaflet documention:https://ipyleaflet.readthedocs.io/en/latest/installation.html

参考博客:https://my.oschina.net/u/2306127/blog/1859080

相关文章:

  • 2021-12-12
  • 2021-12-12
  • 2021-08-19
  • 2021-08-06
  • 2021-09-27
  • 2021-09-14
  • 2021-07-20
  • 2022-01-02
猜你喜欢
  • 2021-07-17
  • 2021-09-20
  • 2021-08-18
  • 2021-11-29
  • 2021-08-17
  • 2021-04-20
  • 2022-12-23
相关资源
相似解决方案