ipyleaflet 在ubuntu环境下的安装

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

安装过程主要如下:

1、安装nodejs

conda install -c conda-forge nodejs=16.6.0

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

运行结果:

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

6、相关链接:

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

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值