Skip to content

Commit 763a667

Browse files
Peter Rushforthprushforth
authored andcommitted
Add static controlslist keyword description to element and api
1 parent 21b0411 commit 763a667

4 files changed

Lines changed: 42 additions & 4 deletions

File tree

‎docs/api/mapml-viewer-api.mdx‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ The HTMLMapmlViewerElement interface represents the `<mapml-viewer>` element.
2020
| [lon](#lon) | Get or set the map's longitude. Reflects to the lon content attribute. No effect on map dynamic state. |
2121
| [projection](#projection) | The map's projection. Reflects the `projection` attribute. |
2222
| [zoom](#zoom) | Get or set the map's zoom level. Reflects to the `zoom` content attribute. No effect on map dynamic state. |
23+
| [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. |
2324

2425
### controls
2526

@@ -45,7 +46,7 @@ that helps the user select what controls to display on the `mapml-viewer` elemen
4546
To set the controlslist attribute:
4647
```js
4748
let map = document.querySelector('mapml-viewer');
48-
map.controlsList.value = "noreload nozoom"; // values can be noreload | nofullscreen | nozoom | nolayer | search | geolocation
49+
map.controlsList.value = "noreload nozoom"; // values can be noreload | nofullscreen | nozoom | nolayer | search | geolocation | static
4950
map.controlsList.add("nofullscreen"); // can also add using the 'add' method
5051
map.controlsList.add("geolocation"); // adds the locate control
5152
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');
210211
let zoom = map.zoom;
211212
```
212213

214+
### static
215+
216+
To make the map non-pannable and non-zoomable (static):
217+
218+
```js
219+
let map = document.querySelector('mapml-viewer');
220+
map.static = true; // or false to enable pan and zoom
221+
```
222+
223+
To check if the map has disabled user's pan and zoom gestures:
224+
225+
```js
226+
let map = document.querySelector('mapml-viewer');
227+
let isFrozen = map.static;
228+
```
229+
213230
---
214231

215232
## Methods

‎docs/elements/mapml-viewer.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,12 @@ The default projection is `OSMTILE`.
8282

8383
### `controlslist`
8484

85-
`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` [`<map-layer>`](../layer/) contains a [`<map-link rel="search">`](../link/) element.
85+
`controlslist` - an enumerated attribute, possible values are: "`nofullscreen`", "`nolayer`", "`noreload`", "`noscale`", "`nozoom`", "`geolocation`", "`search`" and "`static`". 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`, `search` and `static` 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` [`<map-layer>`](../layer/) contains a [`<map-link rel="search">`](../link/) element.
8686

8787
For a full guide to configuring and customizing search, see the [Search user guide](../../user-guide/search).
8888

89+
The `static` controlslist keyword adds a locked-unlocked control to the map that reflects the state of the [`static`](#static) boolean attribute, locking and unlocking the map from pan and zoom mouse or touch gestures.
90+
8991
---
9092

9193
### `height`

‎i18n/fr/docusaurus-plugin-content-docs/current/api/mapml-viewer-api.mdx‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ L’interface HTMLMapmlViewerElement représente l’élément `<mapml-viewer>`.
2020
| [lon](#lon) | Obtient ou définit la longitude de la carte. Reproduit dans l'attribut de contenu lon. Aucun effet sur l'état dynamique de la carte.|
2121
| [projection](#projection) | Projection de la carte. Reproduit l'attribut `projection`. |
2222
| [zoom](#zoom) | Obtient ou définit le niveau de zoom de la carte. Reproduit dans l'attribut de contenu `zoom`. Aucun effet sur l'état dynamique de la carte.|
23+
| [static](#static) | Désactive le déplacement et le zoom interactifs (lorsque présent) ou les réactive (attribut retiré). Reproduit dans l'attribut de contenu `static` et, s'il est affiché au moyen du mot-clé `static` de controlsList, dans le contrôle statique. |
2324

2425
### controls
2526

@@ -45,7 +46,7 @@ qui aide l'utilisateur à sélectionner les contrôles à afficher sur l'éléme
4546
Pour définir l’attribut controlslist :
4647
```js
4748
let map = document.querySelector('mapml-viewer');
48-
map.controlsList.value = "noreload nozoom"; // les valeurs peuvent être noreload | nofullscreen | nozoom | nolayer | search | geolocation
49+
map.controlsList.value = "noreload nozoom"; // les valeurs peuvent être noreload | nofullscreen | nozoom | nolayer | search | geolocation | static
4950
map.controlsList.add("nofullscreen"); // peut également être ajouté à l'aide de la méthode 'add'
5051
map.controlsList.add("geolocation"); // ajoute la commande de localisation
5152
map.controlsList.add("search"); // ajoute la commande de recherche, désactivée jusqu'à ce qu'un lien de gabarit d'URL de recherche soit défini
@@ -213,6 +214,22 @@ let map = document.querySelector('mapml-viewer');
213214
let zoom = map.zoom;
214215
```
215216

217+
### static
218+
219+
Pour rendre la carte non déplaçable et non zoomable (statique) :
220+
221+
```js
222+
let map = document.querySelector('mapml-viewer');
223+
map.static = true; // ou false pour activer le déplacement et le zoom
224+
```
225+
226+
Pour vérifier si la carte a désactivé les gestes de déplacement et de zoom de l'utilisateur :
227+
228+
```js
229+
let map = document.querySelector('mapml-viewer');
230+
let isFrozen = map.static;
231+
```
232+
216233
---
217234

218235
## Méthodes

‎i18n/fr/docusaurus-plugin-content-docs/current/elements/mapml-viewer.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,12 @@ La projection par défaut est `OSMTILE`.
8181

8282
### `controlslist`
8383

84-
`controlslist` - attribut énuméré. Les valeurs possibles sont les suivantes : "`nofullscreen`", "`nolayer`", "`noreload`", "`noscale`", "`nozoom`", "`geolocation`" et "`search`". Les jetons `no*` permettent de réduire l'ensemble des commandes offertes automatiquement (si vous avez utilisé l'attribut booléen `controls`), tandis que contrairement aux jetons `no*` (qui masquent les commandes par défaut), les jetons `geolocation` et `search` sont **optionnels**. `geolocation` et `search` ajoutent respectivement les commandes de localisation et de recherche à la carte. La commande de recherche est `disabled` par défaut, et ne devient activée que lorsqu'au moins une [`<map-layer>`](../layer/) cochée (`checked`) contient un élément [`<map-link rel="search">`](../link/).
84+
`controlslist` - attribut énuméré. Les valeurs possibles sont les suivantes : "`nofullscreen`", "`nolayer`", "`noreload`", "`noscale`", "`nozoom`", "`geolocation`", "`search`" et "`static`". Les jetons `no*` permettent de réduire l'ensemble des commandes offertes automatiquement (si vous avez utilisé l'attribut booléen `controls`), tandis que contrairement aux jetons `no*` (qui masquent les commandes par défaut), les jetons `geolocation`, `search` et `static` sont **optionnels**. `geolocation` et `search` ajoutent respectivement les commandes de localisation et de recherche à la carte. La commande de recherche est `disabled` par défaut, et ne devient activée que lorsqu'au moins une [`<map-layer>`](../layer/) cochée (`checked`) contient un élément [`<map-link rel="search">`](../link/).
8585

8686
Pour un guide complet sur la configuration et la personnalisation de la recherche, consultez le [guide d'utilisation de la recherche](../../user-guide/search).
8787

88+
Le jeton `static` de `controlslist` ajoute à la carte une commande de verrouillage-déverrouillage qui reflète l'état de l'attribut booléen [`static`](#static), verrouillant ou déverrouillant la carte vis-à-vis des gestes de déplacement et de zoom à la souris ou tactiles.
89+
8890
---
8991

9092
### `height`

0 commit comments

Comments
 (0)