Skip to content

Display map navigation controls

Replicates the MapLibre example Display map navigation controls: zoom and rotation controls, placed top-left.

display-map-navigation-controls.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-map-navigation-controls/
type: map
id: display-map-navigation-controls
config:
center: [-74.5, 40]
zoom: 9
mapStyle: "https://demotiles.maplibre.org/style.json"
controls:
navigation:
enabled: true
position: top-left
  • Each control is a boolean (navigation: true) or a { position } block. Available controls: navigation, geolocate, scale, fullscreen, attribution.