Skip to content

Commit

Permalink
Change layer-.focus() to layer.zoomTo() (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
prushforth authored Mar 15, 2023
1 parent 0cc1510 commit 151a614
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
11 changes: 4 additions & 7 deletions docs/api/layer-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,13 @@ let opacity = layer.opacity;
---
## Methods

### focus()
HTMLLayerElement.focus() Zoom to the layer's extent. Note: this method is mis-named. It will
be renamed, per [this issue](https://github.com/Maps4HTML/Web-Map-Custom-Element/issues/587).


To fit the layer's extent in the map as much as possible:
### zoomTo()
HTMLLayerElement.zoomTo() Zoom to the layer's extent in the map, at the maximum
zoom level in which the extent fits completely.

```js
let layer = document.querySelector('layer-');
layer.focus();
layer.zoomTo();
```

---
Expand Down
10 changes: 4 additions & 6 deletions i18n/fr/docusaurus-plugin-content-docs/current/api/layer-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,13 @@ let opacity = layer.opacity;
---
## Méthodes

### focus()
HTMLLayerElement.focus() effectue un zoom sur l’étendue de la couche. Remarque : le nom de cette méthode est erroné et sera corrigé, conformément à [ce problème](https://github.com/Maps4HTML/Web-Map-Custom-Element/issues/587).


Pour que l’étendue de la couche corresponde le plus possible à celle de la carte :
### zoomTo()
HTMLLayerElement.focus() Zoom sur l'étendue de la couche dans la carte,
au niveau de zoom maximum dans lequel l'étendue s'inscrit complètement.

```js
let layer = document.querySelector('layer-');
layer.focus();
layer.zoomTo();
```

---
Expand Down

0 comments on commit 151a614

Please sign in to comment.