Class: Rotate

ol/control/Rotate~Rotate


import Rotate from 'ol/control/Rotate';

A button control to reset rotation to 0. To style this control use css selector .ol-rotate. A .ol-hidden css selector is added to the button when the rotation is 0.

new Rotate(opt_options)

control/Rotate.js, line 36
Name Type Description
options

Rotate options.

Name Type Default Description
className string 'ol-rotate'

CSS class name.

label string | HTMLElement '⇧'

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

tipLabel string 'Reset rotation'

Text label to use for the rotate tip.

duration number 250

Animation duration in milliseconds.

autoHide boolean true

Hide the control when rotation is 0.

render function

Function called when the control should be re-rendered. This is called in a requestAnimationFrame callback.

resetNorth function

Function called when the control is clicked. This will override the default resetNorth.

target HTMLElement | string

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