# OpenLayers.Control.Measure

Allows for drawing of features for measurements.

#### Inherits from

- OpenLayers.Control

Summary

OpenLayers.Control.Measure | Allows for drawing of features for measurements.
Properties |
events | {OpenLayers.Events} Events instance for listeners and triggering control specific events.
handlerOptions | {Object} Used to set non-default properties on the control’s handler
displaySystem | {String} Display system for output measurements.
geodesic | {Boolean} Calculate geodesic metrics instead of planar metrics.
persist | {Boolean} Keep the temporary measurement sketch drawn after the measurement is complete.
immediate | {Boolean} Activates the immediate measurement so that the “measurepartial” event is also fired once the measurement sketch is modified.
Constructor |
OpenLayers.Control.Measure |
Functions |
deactivate |
cancel | Stop the control from measuring.
setImmediate | Sets the immediate property.

### Properties

### events

{OpenLayers.Events} Events instance for listeners and triggering control specific events.

#### Register a listener for a particular event with the following syntax

>     control.events.register(type, obj, listener);

#### 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 immediate property is true and the measurement sketch is modified. Listeners receive an event with measure, units, order, and geometry.

### handlerOptions

{Object} Used to set non-default properties on the control’s handler

### displaySystem

{String} Display system for output measurements. Supported values are ‘english’, ‘metric’, and ‘geographic’. Default is ‘metric’.

### geodesic

{Boolean} Calculate geodesic metrics instead of planar metrics. This requires that geometries can be transformed into Geographic/WGS84 (if that is not already the map projection). Default is false.

### persist

{Boolean} Keep the temporary measurement sketch drawn after the measurement is complete. The geometry will persist until a new measurement is started, the control is deactivated, or cancel is called.

### immediate

{Boolean} Activates the immediate measurement so that the “measurepartial” event is also fired once the measurement sketch is modified. Default is false.

### Constructor

### OpenLayers.Control.Measure

#### Parameters

handler | {OpenLayers.Handler}
options | {Object}

### Functions

### deactivate

> deactivate: function()

### cancel

> cancel: function()

Stop the control from measuring. If persist is true, the temporary sketch will be erased.

### setImmediate

> setImmediate: function( | immediate | )

Sets the immediate property. Changes the activity of immediate measurement.

> deactivate: function()

> cancel: function()

Stop the control from measuring.

> setImmediate: function( | immediate | )

Sets the immediate property.
{Boolean} Activates the immediate measurement so that the “measurepartial” event is also fired once the measurement sketch is modified.
Controls affect the display or behavior of the map.
{OpenLayers.Events} Events instance for listeners and triggering control specific events.
Base class to construct a higher-level handler for event sequences.
{Boolean} Keep the temporary measurement sketch drawn after the measurement is complete.
Close