Skip To Content
ArcGIS Developer
Dashboard

Measurement

The Measurement widget provides tools to calculate the current location and measure distance and area. If the map’s coordinate system is not Web Mercator or geographic, or if complex polygons are drawn, it uses the geometry service to project or simplify geometries.

Configurable attributes

The following table describes the configurable attributes of the Measurement widget.

AttributeDescription
measurement

An object of ArcGIS API for JavaScript. See the params of Measurement Constructor.

  • lineSymbol—A JSON object of ArcGIS API for JavaScript. See the input parameter json for SimpleLineSymbol constructor.
  • pointSymbol—A JSON object of ArcGIS API for JavaScript. See the input parameter json for the SimpleMarkSymboland PictureMarkSymbolconstructors.
    • defaultAreaUnit—String. Valid values are esriAcres, esriSquareMiles, esriSquareKilometers, esriHectares, esriSquareYards, esriSquareFeet, and esriSquareMeters.
    • defaultLengthUnit—String. Valid values are esriMiles, esriKilometers, esriFeet, esriMeters, esriYards, and esriNauticalMiles.

Example

{
  "measurement": {
    "pointSymbol": {
      "type": "esriSMS",
      "style": "esriSMSSquare",
      "color": [76, 115, 0, 255],
      "size": 8,
      "angle": 0,
      "xoffset": 0,
      "yoffset": 0,
      "outline": {
        "color": [152, 230, 0, 255],
        "width": 1
      }
    },
    "defaultAreaUnit": "esriAcres",
    "defaultLengthUnit": "esriMiles"
  }
}