eoda-dev/py-openlayers
Python Bindings for OpenLayers JS
py-openlayers: OpenLayers for Python
Docs | Discord | Examples | Slack
Provides Python bindings for OpenLayers, a high-performance, full-featured web mapping library that displays maps from various sources and formats. It makes it easy to create interactive maps in Marimo and Jupyter notebooks with a few lines of code in a pythonic way.
Join the conversation
Features
Tiled Layers
Pull tiles from OSM, Carto, MapTiler and any other XYZ source.
Vector Layers
Render vector data from GeoJSON, TopoJSON, KML, GML and other formats.
Controls
Add geocoding, draw, full screen and other controls to your map.
WebGL
Render large data sets using WebGL.
PMTiles
Render PMTiles from vector and raster sources.
Interactions
Drag and drop GPX, GeoJSON, KML or TopoJSON files on to the map. Modify, draw and select features.
GeoPandas Extension
import openlayers as ol
data = "zip+https://github.com/Toblerity/Fiona/files/11151652/coutwildrnp.zip"
gdf = ol.GeoDataFrame.from_file(data)
gdf.ol.color_category("STATE").explore()Installation
uv init
uv add openlayers
uv add "git+https://github.com/eoda-dev/py-openlayers@main"Quickstart
import openlayers as ol
# Jupyter or Marimo
m = ol.MapWidget()
m # Display map
# Standalone
m = ol.Map()
m.save()Marimo Live Notebooks
Shiny Live Apps
Documentation
Note
The documentation is still in an early stage, more examples will be added as soon as possible.