OpenLayers.Control.DynamicMeasure

Allows for drawing of features for measurements.

Inherits from

Summary
OpenLayers.Control.DynamicMeasureAllows for drawing of features for measurements.
Properties
accuracy{Integer} Digits measurement accuracy, default is 5.
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.
layerSegments{<OpenLayers.Layer.Vector>} The temporary drawing layer to show the length of the segments.
layerSegments{<OpenLayers.Layer.Vector>} The temporary drawing layer to show total length.
layerArea{<OpenLayers.Layer.Vector>} The temporary drawing layer to show total area.
dynamicObj{Object} Internal use.
isArea{Boolean} Internal use.
Constructor
OpenLayers.Control.Measure
Functions
destroy
drawThis control does not have HTML component, so this method should be empty.
activate
deactivate
setImmediateSets the immediate property.
callbackCreate
callbackPoint
callbackModify
showLabelSegment
showLabel
setMesureAttributesFormat measure[0] with digits of accuracy.
Constants
OpenLayers.Control.DynamicMeasure.styles

Properties

accuracy

{Integer} Digits measurement accuracy, default is 5.

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, default is true.

immediate

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

layerSegments

{<OpenLayers.Layer.Vector>} The temporary drawing layer to show the length of the segments.

layerSegments

{<OpenLayers.Layer.Vector>} The temporary drawing layer to show total length.

layerArea

{<OpenLayers.Layer.Vector>} The temporary drawing layer to show total area.

dynamicObj

{Object} Internal use.

isArea

{Boolean} Internal use.

Constructor

OpenLayers.Control.Measure

Parameters

handler{<OpenLayers.Handler>}
options{Object}

Valid options

styles{Object} Alterations of styles along the lines of default on OpenLayers.Control.DynamicMeasure.styles, can use keys, “Point”, “Line”, “Polygon”, “labelSegments”, “labelLength”, “labelArea”.
handlerOptions{Object} Used to set non-default properties on the control’s handler.  If `layerOptions[“styleMap”]` is set then the keys: “Point”, “Line” and “Polygon” of the `styles` option are ignored.
layerSegmentsOptions{Object} Any optional properties to be set on the layer of layerSegments of the lengths of the segments.  If `styleMap` is set then the key “labelSegments” of the `styles` option is ignored.  If set to null the layer does not act.
layerLengthOptions{Object} Any optional properties to be set on the layer of <layerLength> of the total length.  If `styleMap` is set then the key “labelLength” of the `styles` option is ignored.  If set to null the layer does not act.
layerAreaOptions{Object} Any optional properties to be set on the layer of layerArea of the total area.  If `styleMap` is set then the key “labelArea” of the `styles` option is ignored.  If set to null the layer does not act.

Functions

destroy

destroy: function()

draw

draw: function()

This control does not have HTML component, so this method should be empty.

activate

activate: function()

deactivate

deactivate: function()

setImmediate

setImmediate: function(immediate)

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

callbackCreate

callbackCreate: function()

callbackPoint

callbackPoint: function(point,
geometry)

callbackModify

callbackModify: function(point,
feature,
drawing)

showLabelSegment

showLabelSegment: function(layer,
index,
points)

Parameters

layer<OpenLayers.Layer.Vector>
pointsArray(<OpenLayers.Geometry.Point>)

Returns

{Boolean}

showLabel

showLabel: function(layer,
index,
measure,
x,
y)

Parameters

pointsArray(<OpenLayers.Geometry.Point>)

Returns

{Boolean}

setMesureAttributes

setMesureAttributes: function(attributes,
measure)

Format measure[0] with digits of accuracy.  Could internationalize the format customizing <OpenLayers.Number.thousandsSeparator> and <OpenLayers.Number.decimalSeparator>

Parameters

attributes{object} Target attributes.
measureArray({*})

Constants

OpenLayers.Control.DynamicMeasure.styles

destroy: function()
draw: function()
This control does not have HTML component, so this method should be empty.
activate: function()
deactivate: function()
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.
callbackCreate: function()
callbackPoint: function(point,
geometry)
callbackModify: function(point,
feature,
drawing)
showLabelSegment: function(layer,
index,
points)
showLabel: function(layer,
index,
measure,
x,
y)
setMesureAttributes: function(attributes,
measure)
Format measure[0] with digits of accuracy.
{Integer} Digits measurement accuracy, default is 5.
{OpenLayers.Layer.Vector} The temporary drawing layer to show the length of the segments.
{OpenLayers.Layer.Vector} The temporary drawing layer to show total area.
Close