Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion docs/api/mapml-viewer-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The HTMLMapmlViewerElement interface represents the `<mapml-viewer>` 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

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion docs/elements/mapml-viewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` [`<map-layer>`](../layer/) contains a [`<map-link rel="search">`](../link/) element.
`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.

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

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.

---

### `height`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ L’interface HTMLMapmlViewerElement représente l’élément `<mapml-viewer>`.
| [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.|
| [projection](#projection) | Projection de la carte. Reproduit l'attribut `projection`. |
| [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.|
| [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. |

### controls

Expand All @@ -45,7 +46,7 @@ qui aide l'utilisateur à sélectionner les contrôles à afficher sur l'éléme
Pour définir l’attribut controlslist :
```js
let map = document.querySelector('mapml-viewer');
map.controlsList.value = "noreload nozoom"; // les valeurs peuvent être noreload | nofullscreen | nozoom | nolayer | search | geolocation
map.controlsList.value = "noreload nozoom"; // les valeurs peuvent être noreload | nofullscreen | nozoom | nolayer | search | geolocation | static
map.controlsList.add("nofullscreen"); // peut également être ajouté à l'aide de la méthode 'add'
map.controlsList.add("geolocation"); // ajoute la commande de localisation
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
Expand Down Expand Up @@ -213,6 +214,22 @@ let map = document.querySelector('mapml-viewer');
let zoom = map.zoom;
```

### static

Pour rendre la carte non déplaçable et non zoomable (statique) :

```js
let map = document.querySelector('mapml-viewer');
map.static = true; // ou false pour activer le déplacement et le zoom
```

Pour vérifier si la carte a désactivé les gestes de déplacement et de zoom de l'utilisateur :

```js
let map = document.querySelector('mapml-viewer');
let isFrozen = map.static;
```

---

## Méthodes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,12 @@ La projection par défaut est `OSMTILE`.

### `controlslist`

`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/).
`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/).

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

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.

---

### `height`
Expand Down
Loading