ipyleaflet

Jupyter - Leaflet.js 桥接器。「A Jupyter - Leaflet.js bridge」

Github星跟踪图

ipyleaflet

Documentation
Binder
Join the Gitter Chat
Downloads

A Jupyter / Leaflet bridge enabling interactive maps in the Jupyter notebook.

Usage

Selecting a basemap for a leaflet map:

Basemap Screencast

Loading a geojson map:

GeoJSON Screencast

Making use of leafletjs primitives:

Primitives Screencast

Using the splitmap control:

Splitmap Screencast

Displaying velocity data on the top of a map:

Velocity Screencast

Choropleth layer:

Choropleth Screencast

Widget control

Widget Control

Installation

Using conda:

conda install -c conda-forge ipyleaflet

Using pip:

pip install ipyleaflet

If you are using the classic Jupyter Notebook < 5.3 you need to run this extra command:

jupyter nbextension enable --py --sys-prefix ipyleaflet

If you are using JupyterLab, you will need to install the JupyterLab extension:

jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter-leaflet

Installation from sources

For a development installation (requires npm, you can install it with conda install -c conda-forge nodejs):

git clone https://github.com/jupyter-widgets/ipyleaflet.git
cd ipyleaflet
pip install -e .

If you are using the classic Jupyter Notebook you need to install the nbextension:

jupyter nbextension install --py --symlink --sys-prefix ipyleaflet
jupyter nbextension enable --py --sys-prefix ipyleaflet

If you are using JupyterLab, you need to install the labextension for ipywidgets and ipyleaflet:

jupyter labextension install @jupyter-widgets/jupyterlab-manager js

Note for developers:

  • the -e pip option allows one to modify the Python code in-place. Restart the kernel in order to see the changes.

  • the --symlink argument on Linux or OS X allows one to modify the JavaScript code in-place. This feature is not available with Windows.

    For automatically building the JavaScript code every time there is a change, run the following command from the ipyleaflet/js/ directory:

    npm run watch
    

    If you are on JupyterLab you also need to run the following in a separate terminal:

    jupyter lab --watch
    

    Every time a JavaScript build has terminated you need to refresh the Notebook page in order to load the JavaScript code again.

Documentation

To get started with using ipyleaflet, check out the full documentation

https://ipyleaflet.readthedocs.io/

License

We use a shared copyright model that enables all contributors to maintain the
copyright on their contributions.

This software is licensed under the BSD-3-Clause license. See the LICENSE file for details.

The ipyleaflet repository includes the jupyter-leaflet npm package, which
is a front-end component, and the ipyleaflet python package which is the
backend for the Python Jupyter kernel.

Similarly, the xleaflet project
provides a backend to jupyter-leaflet for the "xeus-cling" C++ Jupyter
kernel.

Xleaflet Screencast

主要指标

概览
名称与所有者jupyter-widgets/ipyleaflet
主编程语言TypeScript
编程语言Python (语言数: 5)
平台
许可证MIT License
所有者活动
创建于2014-05-07 16:32:10
推送于2025-06-19 13:12:24
最后一次提交2025-06-19 16:12:24
发布数84
最新版本名称0.20.0 (发布于 )
第一版名称0.2.0b2 (发布于 2016-04-19 15:22:08)
用户参与
星数1.5k
关注者数65
派生数362
提交数1.2k
已启用问题?
问题数630
打开的问题数264
拉请求数529
打开的拉请求数28
关闭的拉请求数75
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?