Skip to content

Set pitch and bearing

Replicates the MapLibre example Set pitch and bearing: an oblique initial camera over Montréal.

set-pitch-and-bearing.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/set-pitch-and-bearing/
type: map
id: set-pitch-and-bearing
config:
center: [-73.5804, 45.53483]
zoom: 9
pitch: 60
bearing: -60
mapStyle: "https://demotiles.maplibre.org/style.json"
  • config.pitch (0–85) and config.bearing (−180–180) join center/zoom as the four initial-camera fields.