MCPcopy Index your code
hub / github.com/emilhe/dash-leaflet

github.com/emilhe/dash-leaflet @1.1.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.1.3 ↗ · + Follow
155 symbols 648 edges 96 files 9 documented · 6%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Dash Leaflet

Dash Leaflet is a light wrapper around React-Leaflet. The syntax is similar to other Dash components, with naming conventions following the React-Leaflet API.

Getting started

The easiest way to get started is to install the latest version of Dash and Dash Leaflet via pip.

pip install dash
pip install dash-leaflet

Once the installation is completed, paste the following lines of code into a .py file and run it.

from dash import Dash
import dash_leaflet as dl

app = Dash()
app.layout = dl.Map(dl.TileLayer(), style={'height': '50vh'}, center=[56, 10], zoom=6)

if __name__ == '__main__':
    app.run_server()

That's it! If you visit http://127.0.0.1:8050/ in your browser, you should see a Leaflet map.

Documentation

The documentation has been moved to a separate page to enable an interactive example gallery.

NB: The 1.0.0 release contains a wide range of breaking changes, please refer to the migration guidelines

Support

Please ask questions on StackOverflow using the dash-leaflet tag, use GitHub issues only for bug reports.

Build instructions

Start by cloning this repository,

git clone git@github.com:thedirtyfew/dash-leaflet.git
cd dash-leaflet

Next, create a virtual environment and install the python dependencies (make sure to have Python 3.12 and uv installed),

uv venv && source .venv/bin/activate && uv sync

Finally, install packages via npm (ignore errors) and run the build script,

npm i --ignore-scripts
npm run build

Donation

paypal

Extension points exported contracts — how you extend this code

LayerProps (Interface)
(no doc)
src/ts/leaflet-props.ts
ControlProps (Interface)
(no doc)
src/ts/leaflet-props.ts
GridLayerProps (Interface)
(no doc)
src/ts/leaflet-props.ts
TileLayerProps (Interface)
(no doc)
src/ts/leaflet-props.ts
WMSTileLayerProps (Interface)
(no doc)
src/ts/leaflet-props.ts

Core symbols most depended-on inside this repo

event_app_stub
called by 21
tests/stubs.py
TileLayer
called by 13
src/ts/components/TileLayer.tsx
assignClickEventHandlers
called by 11
src/ts/props.ts
app_stub
called by 11
tests/stubs.py
Marker
called by 6
src/ts/components/Marker.tsx
pick
called by 5
src/ts/dash-extensions-js.ts
_makeGeojson
called by 4
src/ts/components/EditControl.tsx
mergeEventHandlers
called by 3
src/ts/utils.ts

Shape

Function 121
Interface 33
Route 1

Languages

TypeScript90%
Python10%

Modules by API surface

src/ts/leaflet-props.ts33 symbols
src/ts/react-leaflet/GeoJSON.ts22 symbols
src/ts/dash-extensions-js.ts12 symbols
src/ts/utils.ts7 symbols
tests/test_components.py6 symbols
src/ts/react-leaflet/EditControl.ts6 symbols
src/ts/components/MapContainer.tsx5 symbols
src/ts/components/EditControl.tsx5 symbols
tests/stubs.py4 symbols
src/ts/props.ts4 symbols
dash_leaflet/express.py4 symbols
src/ts/components/GeoJSON.tsx3 symbols

For agents

$ claude mcp add dash-leaflet \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact