Class: Zoom

ol/control/Zoom~Zoom


import Zoom from 'ol/control/Zoom';

A control with 2 buttons, one for zoom in and one for zoom out. This control is one of the default controls of a map. To style this control use css selectors .ol-zoom-in and .ol-zoom-out.

new Zoom(opt_options)

control/Zoom.js, line 35
Name Type Description
options

Zoom options.

Name Type Default Description
duration number 250

Animation duration in milliseconds.

className string 'ol-zoom'

CSS class name.

zoomInLabel string | HTMLElement '+'

Text label to use for the zoom-in button. Instead of text, also an element (e.g. a span element) can be used.

zoomOutLabel string | HTMLElement '-'

Text label to use for the zoom-out button. Instead of text, also an element (e.g. a span element) can be used.

zoomInTipLabel string 'Zoom in'

Text label to use for the button tip.

zoomOutTipLabel string 'Zoom out'

Text label to use for the button tip.

delta number 1

The zoom delta applied on each click.

target HTMLElement | string

Specify a target if you want the control to be rendered outside of the map's viewport.