Locate the user
Replicates the MapLibre example Locate the user.
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/locate-the-user/# The control tracks with high accuracy by default; click it and grant the# browser permission.type: mapid: locate-the-userconfig: center: [-24, 42] zoom: 1 mapStyle: "https://demotiles.maplibre.org/style.json"controls: geolocate: trueWhat to notice
Section titled “What to notice”controls.geolocate: trueadds the control with high-accuracy tracking enabled.- Position takes the usual
{ enabled, position }block form.