Skip to main content

Leaflet component for Dash

Project description

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. A minimal working example can be implemented in a few lines,

import dash
import dash_leaflet as dl
import dash_html_components as html

app = dash.Dash()
app.layout = html.Div([
    dl.Map(style={'width': '1000px', 'height': '500px'}, center=[56.05, 10.25], zoom=10, children=[
        dl.TileLayer(url="https://a.tile.openstreetmap.org/{z}/{x}/{y}.png"),
    ])
])

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

Not all React-Leaflet component have been implemented, but the basics are in place:

  • TileLayer
  • WMSTileLayer
  • LayerGroup
  • Polygon
  • Polyline
  • Rectangle
  • Circle
  • CircleMarker
  • Marker
  • ImageOverlay
  • VideoOverlay
  • Popup
  • Tooltip

Component documentation is available on the React-Leaflet website,

https://react-leaflet.js.org/docs/en/components

More advanced Dash Leaflet examples are available in the usage gallery,

https://github.com/thedirtyfew/dash-leaflet/blob/master/usage_gallery.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for dash-leaflet, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size dash_leaflet-0.0.3.tar.gz (1.4 MB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page