Skip to content

Display a non-interactive map

Replicates the MapLibre example Display a non-interactive map: a static map that ignores drag, scroll, and keyboard input.

Try dragging — nothing moves
display-a-non-interactive-map.yaml
# yaml-language-server: $schema=https://docs.maplibre-yaml.org/schema/latest/map.schema.json
# Gallery twin of https://maplibre.org/maplibre-gl-js/docs/examples/display-a-non-interactive-map/
type: map
id: display-a-non-interactive-map
config:
center: [2.3488, 48.8534]
zoom: 11
interactive: false
mapStyle: "https://demotiles.maplibre.org/style.json"
  • interactive: false disables every input handler at construction. For finer control, individual handlers (scrollZoom, dragPan, dragRotate, keyboard, …) are their own config flags.