Disable map rotation
Replicates the MapLibre example Disable map rotation: north stays up.
The complete document
Section titled “The complete document”# 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/disable-map-rotation/# Right-drag and touch-rotate do nothing; north stays up.type: mapid: disable-map-rotationconfig: center: [12.4964, 41.9028] zoom: 10 dragRotate: false touchZoomRotate: false mapStyle: "https://demotiles.maplibre.org/style.json"What to notice
Section titled “What to notice”dragRotate: falsekills right-drag rotation;touchZoomRotate: falsedisables the touch gesture wholesale (the upstream version keeps pinch-zoom while disabling only rotation — that finer split needsgetMap()).