Class: DragZoom

ol.interaction. DragZoom

experimental new ol.interaction.DragZoom(opt_options)

Allows the user to zoom the map by clicking and dragging on the map, normally combined with an ol.events.condition that limits it to when the shift key is held down.

Name Type Argument Description
options optional

Options.

Name Type Description
condition ol.events.ConditionType | undefined

A conditional modifier (i.e. Shift key) that determines if the interaction is active or not, default is shift key.

style ol.style.Style

Style for the box.

Fires:

Extends

Methods

experimental inherited dispatchChangeEvent()

Dispatches a change event. Register a listener for this event to get notified of changes.

Fires:
  • change

Returns geometry of last drawn box.

experimental inherited on(type, listener, opt_this){goog.events.Key}

Listen for a certain type of event.

Name Type Argument Description
type string | Array.<string>

The event type or array of event types.

listener function

The listener function.

this Object <optional>
optional

The object to use as this in listener.

Returns:
key for the listener.

experimental inherited once(type, listener, opt_this){goog.events.Key}

Listen once for a certain type of event.

Name Type Argument Description
type string | Array.<string>

The event type or array of event types.

listener function

The listener function.

this Object <optional>
optional

The object to use as this in listener.

Returns:
key for the listener.

experimental inherited un(type, listener, opt_this)

Unlisten for a certain type of event.

Name Type Argument Description
type string | Array.<string>

The event type or array of event types.

listener function

The listener function.

this Object <optional>
optional

The object to use as this in listener.

experimental inherited unByKey(key)

Removes an event listener using the key returned by on() or once().

Name Type Description
key goog.events.Key

Key.