Map features
Share & permalink
"Send me the link" — the everyday request in any authority. The whole map state rides along in the URL.
Try it: move the map, switch a layer, change opacity — the address bar updates as you go. The share button (top-left) copies the current link; open it in a new tab and everything is back.
What travels in the link
- View: centre, zoom, and bearing/pitch when they differ from north-up
- The active basemap
- Layer visibility and opacity — but only where they differ from the config
- Layers the user added at runtime, with their full definition
Only deltas are stored, so a shared link stays short and — more importantly — keeps inheriting later config changes. Give a layer a new title tomorrow and yesterday's links show the new one.
Living with the host page
The state is base64url-encoded into a single hash parameter, by default
#map0=…. Other hash content is left untouched, so a single-page app that
routes on the hash keeps working; rename the parameter if it collides:
"permalink": true,
"permalink": { "param": "karte" }
Updates use history.replaceState and are debounced, so panning the map does
not fill the browser's back button with entries.
Configuration
From code
const api = document.querySelector('map0-viewer').api;
const url = api.getShareUrl(); // null when permalink is disabled