Geoportal Extension for OpenLayers 3 API Reference

Class: MeasureArea

ol.control.MeasureArea

Tool Measure Area Control. Allows users to measure the length of a path drawn on the map.

new MeasureArea(options)

Ol3/Controls/Measures/MeasureArea.js, line 47
Name Type Description
options Object

options for function call.

Name Type Default Description
geodesic Boolean true optional

If true, area will be computed on the global sphere using the ol.Sphere.geodesicArea() function. Otherwise, area will be computed on the projected plane.

styles Object {} optional

styles used when drawing. Specified with following properties.

Name Type Default Description
pointer Object {} optional

Style for mouse pointer when drawing the polygon to measure. Specified with an ol.style.Image subclass object.

start Object {} optional

Polygon Style when drawing. Specified with an ol.style.Style object.

finish Object {} optional

Polygon Style when finished drawing. Specified with an ol.style.Style object.

Example
var measureArea = new ol.control.MeasureArea({
   geodesic : false
});

Extends

  • ol.control.Control

Methods

setMap(map)

Ol3/Controls/Measures/MeasureArea.js, line 116

Overwrite OpenLayers setMap method

Name Type Description
map ol.Map

Map.