Skip to content

Get started

import openlayers as ol

# Add components during initialization
m = ol.Map(controls=[ol.ZoomSliderControl()])

# Add components after initialization
m.add_control(ol.FullScreenControl())

Use the Map class if you just want to create an HTML document and the MapWidget class for an interactive widget in Marimo or Jupyter notebooks:

# Widget
m = ol.MapWidget(controls=[ol.ZoomSliderControl()])
m

# Standalone
m = Map(controls=[ol.ZoomSliderControl()])
m.save()