Allows for drawing of features for measurements.
OpenLayers. Control. Measure | Allows for drawing of features for measurements. |
Constants | |
EVENT_TYPES | {Array(String)} Supported application event types. |
Properties | |
handlerOptions | {Object} Used to set non-default properties on the control’s handler |
callbacks | {Object} The functions that are sent to the handler for callback |
displaySystem | {String} Display system for output measurements. |
displaySystemUnits | {Object} Units for various measurement systems. |
Constructor | |
OpenLayers. Control. Measure | |
Functions | |
updateHandler | |
measureComplete | Called when the measurement sketch is done. |
measurePartial | Called each time a new point is added to the measurement sketch. |
measure | |
getBestArea | Based on the displaySystem returns the area of a geometry. |
getArea | |
getBestLength | Based on the displaySystem returns the length of a geometry. |
getLength |
{Array(String)} Supported application event types. Register a listener for a particular event with the following syntax:
control.events.register(type, obj, listener);
Listeners will be called with a reference to an event object. The properties of this event depends on exactly what happened.
handler | {OpenLayers.Handler} |
options | {Object} |
measureComplete: function( geometry )
Called when the measurement sketch is done.
geometry | {OpenLayers.Geometry} |
measurePartial: function( point, geometry )
Called each time a new point is added to the measurement sketch.
point | {OpenLayers.Geometry.Point} The last point added. |
geometry | {OpenLayers.Geometry} The sketch geometry. |
getBestArea: function( geometry )
Based on the displaySystem returns the area of a geometry.
geometry | {OpenLayers.Geometry} |
{Array([Float, String])} Returns a two item array containing the area and the units abbreviation.
getArea: function( geometry, units )
geometry | {OpenLayers.Geometry} |
units | {String} Unit abbreviation |
{Float} The geometry area in the given units.
getBestLength: function( geometry )
Based on the displaySystem returns the length of a geometry.
geometry | {OpenLayers.Geometry} |
{Array([Float, String])} Returns a two item array containing the length and the units abbreviation.
getLength: function( geometry, units )
geometry | {OpenLayers.Geometry} |
units | {String} Unit abbreviation |
{Float} The geometry length in the given units.
updateHandler: function( handler, options )
Called when the measurement sketch is done.
measureComplete: function( geometry )
Called each time a new point is added to the measurement sketch.
measurePartial: function( point, geometry )
measure: function( geometry, eventType )
Based on the displaySystem returns the area of a geometry.
getBestArea: function( geometry )
getArea: function( geometry, units )
Based on the displaySystem returns the length of a geometry.
getBestLength: function( geometry )
getLength: function( geometry, units )