Class: ZoomToExtent
This documentation is for OpenLayers v
5.1.3. The
latest is v
.
import ZoomToExtent from 'ol/control/ZoomToExtent';
A button control which, when pressed, changes the map view to a specific
extent. To style this control use the css selector .ol-zoom-extent
.
new ZoomToExtent(opt_options)
control/ZoomToExtent.js, line 30
Name |
Type |
Description |
options |
Options.
Name |
Type |
Default |
Description |
className |
string
|
'ol-zoom-extent'
|
Class name. |
target |
HTMLElement
|
string
|
|
Specify a target if you want the control
to be rendered outside of the map's viewport. |
label |
string
|
HTMLElement
|
'E'
|
Text label to use for the button.
Instead of text, also an element (e.g. a span element) can be used. |
tipLabel |
string
|
'Fit to extent'
|
Text label to use for the button tip. |
extent |
module:ol/extent~Extent
|
|
The extent to zoom to. If undefined the validity
extent of the view projection is used. |
|