Hierarchy (View Summary)

Constructors

Properties

active: boolean
autoActivate: boolean
cancel: () => void

APIMethod: cancel Stop the control from measuring. If is true, the temporary sketch will be erased.

CLASS_NAME: "OpenLayers.Control.Measure"
deactivate: () => boolean

APIMethod: deactivate

displayClass: string
div: HTMLElement
events: Events

APIProperty: events {<OpenLayers.Events>} Events instance for listeners and triggering control specific events.

Register a listener for a particular event with the following syntax: (code) control.events.register(type, obj, listener); (end)

Supported event types (in addition to those from <OpenLayers.Control.events>): measure - Triggered when a measurement sketch is complete. Listeners will receive an event with measure, units, order, and geometry properties. measurepartial - Triggered when a new point is added to the measurement sketch or if the property is true and the measurement sketch is modified. Listeners receive an event with measure, units, order, and geometry.

handler: null | Handler
map: null | Map

Property: map {<OpenLayers.Map>} this gets set in the addControl() function in OpenLayers.Map

setImmediate: (immediate: boolean) => void

APIMethod: setImmediate Sets the property. Changes the activity of immediate measurement.

TYPE_BUTTON: 1

Constant: OpenLayers.Control.TYPE_BUTTON

TYPE_TOGGLE: 2

Constant: OpenLayers.Control.TYPE_TOGGLE

TYPE_TOOL: 3

Constant: OpenLayers.Control.TYPE_TOOL

Methods

  • APIMethod: activate Explicitly activates a control and it's associated handler if one has been set. Controls can be deactivated by calling the deactivate() method.

    Returns: {Boolean} True if the control was successfully activated or false if the control was already active.

    Returns boolean

  • Method: destroy The destroy method is used to perform any clean up before the control is dereferenced. Typically this is where event listeners are removed to prevent memory leaks.

    Returns void

  • Method: draw The draw method is called when the control is ready to be displayed on the page. If a div has not been created one is created. Controls with a visual component will almost always want to override this method to customize the look of control.

    Parameters: px - {<OpenLayers.Pixel>} The top-left pixel position of the control or null.

    Returns: {DOMElement} A reference to the DIV DOMElement containing the control

    Parameters

    Returns HTMLElement

  • Method: setMap Set the map property for the control. This is done through an accessor so that subclasses can override this and take special action once they have their map variable set.

    Parameters: map - {<OpenLayers.Map>}

    Parameters

    Returns void