Add a default marker
Replicates the MapLibre example Add a default marker. The upstream new maplibregl.Marker().setLngLat(...).addTo(map) is one markers: entry — and unlike a layer, it’s a real DOM marker, exactly what the imperative API creates.
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/add-a-default-marker/# The whole new-Marker-addTo dance is one markers: entry.type: mapid: add-a-default-markerconfig: center: [12.55, 55.665] zoom: 8 mapStyle: "https://demotiles.maplibre.org/style.json"markers: - at: [12.55, 55.665]What to notice
Section titled “What to notice”markers:entries are DOM markers live; onmlym emit --with-fallbacksthey lower to a symbol layer with a generated pin sprite (the format’s first construct that exports with a fallback — see Export classes).--strictrefuses marker documents: a DOM marker and a symbol layer are close, not identical, and strict means nothing visual changes.