From 29664f354d68e92e25dd894201b3357b6ef40da7 Mon Sep 17 00:00:00 2001 From: Peter Rushforth Date: Wed, 28 Oct 2026 13:36:32 -0400 Subject: [PATCH] Add static controlslist keyword description to element and api --- docs/api/mapml-viewer-api.mdx | 19 ++++++++++++++++++- docs/elements/mapml-viewer.md | 4 +++- .../current/api/mapml-viewer-api.mdx | 19 ++++++++++++++++++- .../current/elements/mapml-viewer.md | 4 +++- 4 files changed, 42 insertions(+), 4 deletions(-) diff --git a/docs/api/mapml-viewer-api.mdx b/docs/api/mapml-viewer-api.mdx index 4457730c..0a9529ef 100644 --- a/docs/api/mapml-viewer-api.mdx +++ b/docs/api/mapml-viewer-api.mdx @@ -20,6 +20,7 @@ The HTMLMapmlViewerElement interface represents the `` element. | [lon](#lon) | Get or set the map's longitude. Reflects to the lon content attribute. No effect on map dynamic state. | | [projection](#projection) | The map's projection. Reflects the `projection` attribute. | | [zoom](#zoom) | Get or set the map's zoom level. Reflects to the `zoom` content attribute. No effect on map dynamic state. | +| [static](#static) | Turns interactive pan / zoom off (when present) or on (attribute removed). Reflects to the `static` content attribute and if rendered via the controlsList `static` keyword, the static control. | ### controls @@ -45,7 +46,7 @@ that helps the user select what controls to display on the `mapml-viewer` elemen To set the controlslist attribute: ```js let map = document.querySelector('mapml-viewer'); -map.controlsList.value = "noreload nozoom"; // values can be noreload | nofullscreen | nozoom | nolayer | search | geolocation +map.controlsList.value = "noreload nozoom"; // values can be noreload | nofullscreen | nozoom | nolayer | search | geolocation | static map.controlsList.add("nofullscreen"); // can also add using the 'add' method map.controlsList.add("geolocation"); // adds the locate control map.controlsList.add("search"); // adds the search control, disabled until a search URL template link is defined @@ -210,6 +211,22 @@ let map = document.querySelector('mapml-viewer'); let zoom = map.zoom; ``` +### static + +To make the map non-pannable and non-zoomable (static): + +```js +let map = document.querySelector('mapml-viewer'); +map.static = true; // or false to enable pan and zoom +``` + +To check if the map has disabled user's pan and zoom gestures: + +```js +let map = document.querySelector('mapml-viewer'); +let isFrozen = map.static; +``` + --- ## Methods diff --git a/docs/elements/mapml-viewer.md b/docs/elements/mapml-viewer.md index 5609db61..175be71f 100644 --- a/docs/elements/mapml-viewer.md +++ b/docs/elements/mapml-viewer.md @@ -82,10 +82,12 @@ The default projection is `OSMTILE`. ### `controlslist` -`controlslist` - an enumerated attribute, possible values are: "`nofullscreen`", "`nolayer`", "`noreload`", "`noscale`", "`nozoom`", "`geolocation`" and "`search`". The `no*` tokens let you prune the set of controls automatically presented (when you have used the `controls` boolean attribute), while unlike the `no*` tokens (which hide default controls), the `geolocation` and `search` tokens are **opt-in**. `geolocation` and `search` add location and search controls to the map, respectively. The search control is `disabled` by default, and becomes enabled only when at least one `checked` [``](../layer/) contains a [`