Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/workers
Class: ImageServiceMeasureTool

require(["esri/toolbars/ImageServiceMeasureTool"], function(ImageServiceMeasureTool) { /* code goes here */ });

Description

(Added at v3.14)

A toolbar that provides support for measuring image services.

The image services must support mensuration. Mensuration is a method of applying geometric rules to find the lengths of lines, areas of surfaces, or volumes using information obtained from lines and angles. It can also include measuring the height and absolute location of a feature.

Any Image service with georeferenced raster dataset can provide distance, area, point and centroid locations. Height measurements can be obtained when a sensor model exists. Sun angle information is required to make measurements using the shadows.

An instance of this toolbar is provided to an instance of the ImageServiceMeasure widget in the measureToolbar property. The widget provides a simple user interface to the application while leveraging all the properties, methods and events of the ImageServiceMeasureToolbar.

Samples

Search for samples that use this class.

Constructors

NameSummary
new ImageServiceMeasureTool(params)Creates a new instance of ImageServiceMeasureTool.

Properties

NameTypeSummary
angularUnitStringThe angular unit in which directions of line segments will be calculated.
areaUnitStringThe area unit in which areas of polygons will be calculated.
fillSymbolSimpleFillSymbolSymbol to be used when drawing a polygon or extent.
lineSymbolSimpleLineSymbolSymbol to be used when drawing a line.
linearUnitStringThe linear unit in which height, length, or perimeters will be calculated.
markerSymbolSimpleMarkerSymbolSymbol to be used when drawing a point.

Methods

NameReturn typeSummary
activate(operation)NoneActivates the toolbar for performing the measure operation.
deactivate()NoneDeactivates the toolbar.
getSupportedMeasureOperations()String[]Returns a list of measure operations supported by the image service.
getSupportedUnits()String[]Returns a list of supported linear, angular and area units.
hideDrawTooltip()NoneDisables the tooltip message for performing a draw.
setAngularUnit(unit)NoneSets the angularUnit.
setAreaUnit(unit)NoneSets the areaUnit.
setFillSymbol(fillSymbol)NoneSets the fillSymbol.
setLineSymbol(lineSymbol)NoneSets the lineSymbol.
setLinearUnit(unit)NoneSets the linearUnit.
setMarkerSymbol(markerSymbol)NoneSets the markerSymbol.
showDrawTooltip()NoneEnables the tooltip message for performing a draw.

Events

[ On Style Events | Connect Style Event ]
All On Style event listeners receive a single event object. Additionally, the event object also contains a 'target' property whose value is the object which fired the event.

Events

NameEvent ObjectSummary
draw-end
{
  geometry: <Geometry>
}
Fires when the drawing is complete.
draw-startFires when the user starts drawing.
measure-end
{
  measureResult: <Object>
}
Fires when the measure operation has been performed.
unit-change
{
  measureResult: <Object>
}
Fires when the unit has been changed.
Constructor Details

new ImageServiceMeasureTool(params)

Creates a new instance of ImageServiceMeasureTool.
Parameters:
<Object> params Required Constructor options. See Object Specification table below for more details on the properties of this object.
params properties:
<String> angularUnit Optional The angular unit in which directions of line segments will be calculated.
Possible Values: esriDURadians | esriDUDecimalDegrees (default)
<String> areaUnit Optional The area unit in which areas of polygons will be calculated.

Possible Values: esriSquareInches | esriSquareFeet | esriSquareYards | esriAcres | esriSquareMiles | esriSquareMillimeters | esriSquareCentimeters | esriSquareDecimeters | esriSquareMeters (default) | esriAres | esriHectares | esriSquareKilometers
<SimpleFillSymbol> fillSymbol Optional Symbol to be used when drawing a polygon or extent.
<ArcGISImageServiceLayer> layer Required Image service layer the toolbar is associated with.
<SimpleLineSymbol> lineSymbol Optional Symbol to be used when drawing a line.
<String> linearUnit Optional The linear unit in which height, length, or perimeters will be calculated.

Possible Values: esriInches | esriFeet | esriYards | esriMiles | esriNauticalMiles | esriMillimeters | esriCentimeters | esriDecimeters | esriMeters (default) | esriKilometers
<Map> map Required Map instance the toolbar is associated with.
<SimpleMarkerSymbol> markerSymbol Optional Symbol to be used when drawing a point.
Sample:
require([
  "esri/toolbars/ImageServiceMeasureTool", ... 
], function(ImageServiceMeasureTool, ... ) {
  var imageMeasureTool = new ImageServiceMeasureTool({
    map: map,
    layer: new ArcGISImageServiceLayer()
  });
  ...
});
Property Details

<String> angularUnit

The angular unit in which directions of line segments will be calculated.
Known values: esriDURadians | esriDUDecimalDegrees
Default value: esriDUDecimalDegrees

<String> areaUnit

The area unit in which areas of polygons will be calculated.
Known values: esriSquareInches | esriSquareFeet | esriSquareYards | esriAcres | esriSquareMiles | esriSquareMillimeters | esriSquareCentimeters | esriSquareDecimeters | esriSquareMeters | esriAcres | esriHectares | esriSquareKilometers
Default value: esriSquareMeters

<SimpleFillSymbol> fillSymbol

Symbol to be used when drawing a polygon or extent.

<SimpleLineSymbol> lineSymbol

Symbol to be used when drawing a line.

<String> linearUnit

The linear unit in which height, length, or perimeters will be calculated.
Known values: esriMeters | esriKilometers | esriInches | esriFeet | esriYards | esriMiles | esriNauticalMiles | esriMillimeters | esriCentimeters | esriDecimeters
Default value: esriMeters

<SimpleMarkerSymbol> markerSymbol

Symbol to be used when drawing a point.
Method Details

activate(operation)

Activates the toolbar for performing the measure operation.
Parameters:
<String> operation Required The mensuration rule to apply to the measure operation. Use getSupportedMeasureOperations() to obtain a list of possible values for this parameter.

deactivate()

Deactivates the toolbar.

getSupportedMeasureOperations()

Returns a list of measure operations supported by the image service.
Return type: String[]

getSupportedUnits()

Returns a list of supported linear, angular and area units.
Return type: String[]

hideDrawTooltip()

Disables the tooltip message for performing a draw.

setAngularUnit(unit)

Sets the angularUnit.
Parameters:
<String> unit Required The angular unit to set.

Possible Values: esriDURadians | esriDUDecimalDegrees

setAreaUnit(unit)

Sets the areaUnit.
Parameters:
<String> unit Required

Possible Values: esriSquareInches | esriSqudareFeet | esriSquareYards | esriAcres | esriSquareMiles | esriSquareMillimeters | esriSquareCentimeters | esriSquareDecimeters | esriSquareMeters | esriAres | esriHectares | esriSquareKilometers

setFillSymbol(fillSymbol)

Sets the fillSymbol.
Parameters:
<SimpleFillSymbol> fillSymbol Required The fill symbol to set.

setLineSymbol(lineSymbol)

Sets the lineSymbol.
Parameters:
<SimpleLineSymbol> lineSymbol Required The line symbol to set.

setLinearUnit(unit)

Sets the linearUnit.
Parameters:
<String> unit Required The linear unit to set.

Possible Values: esriMeters | esriKilometers | esriInches | esriFeet | esriYards | esriMiles | esriNauticalMiles | esriMillimeters | esriCentimeters | esriDecimeters

setMarkerSymbol(markerSymbol)

Sets the markerSymbol.
Parameters:
<SimpleMarkerSymbol> markerSymbol Required The marker symbol to set.

showDrawTooltip()

Enables the tooltip message for performing a draw.
Event Details
[ On Style Events | Connect Style Event ]

draw-end

Fires when the drawing is complete.
Event Object Properties:
<Geometry> geometry The geometry of the graphic created while performing the draw.

draw-start

Fires when the user starts drawing.

measure-end

Fires when the measure operation has been performed.
Event Object Properties:
<Object> measureResult An object that contains the following properties:
{
   error: , //An error object if the measurement operation fails
   geometry:  //A geometry of the graphic that was measured
}

unit-change

Fires when the unit has been changed.
Event Object Properties:
<Object> measureResult An object that contains the following properties:
{
   error: , //An error object if the unit change fails
   geometry:  //A geometry of the graphic that was measured
}