Object: esri/widgets/CoordinateConversion/support/Format
Since: ArcGIS API for JavaScript 4.7

The Format class represents one of the formats in the Coordinate Conversion widget. Each format describes how a Point should be transformed into a coordinate for display purposes.

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
NameTypeSummaryObject
ConversionInfo

Contains information that describes how this Format should be converted.

more details
more detailsFormat
CoordinateSegment[]

A array of Coordinate Segments.

more details
more detailsFormat
String

A string that serves as a pattern describing how this Format should be displayed.

more details
more detailsFormat
String

The default pattern describing how this Format should be displayed.

more details
more detailsFormat
String

The name of the coordinate.

more details
more detailsFormat
SpatialReference

The SpatialReference for this format.

more details
more detailsFormat
CoordinateConversionViewModel

The view model of the CoordinateConversion widget that is utilizing this format.

more details
more detailsFormat

Property Details

conversionInfoConversionInfo

Contains information that describes how this Format should be converted. This property should only be set when creating a custom Format.

Default Value:null
coordinateSegmentsCoordinateSegment[]

A array of Coordinate Segments. Each segment represents a section of the Format's coordinate.

Default Value:null
currentPatternString

A string that serves as a pattern describing how this Format should be displayed. The pattern should contain all of aliases specified by the Format's coordinateSegments property.

Default Value:null
Example:
// Remove the spaces from an mgrs coordinate
var format = coordinateConversionWidget.formats.find(function(format) {
  return format.name === "mgrs";
});

console.log.(format.currentPattern);
// > Z S X Y
format.currentPattern = "ZSXY"
defaultPatternString

The default pattern describing how this Format should be displayed. See currentPattern.

Default Value:null
nameString

The name of the coordinate. A CoordinateConversion widget should not contain multiple Formats with the same name.

Default Value:null
spatialReferenceSpatialReference

The SpatialReference for this format. Coordinates generated for a format will be derived from points in this spatial reference.

The view model of the CoordinateConversion widget that is utilizing this format.

Type Definitions

ConversionInfo

This object describes how a Format should be projected and formatted for display. Used to define custom Formats that require custom conversion and/or projection logic.

Properties:
convert Function
optional

A function that takes a point and returns a position.

reverseConvert Function
optional

A function that takes a string and returns a Point.

CoordinateSegment

A coordinate segment represents one piece of a coordinate string.

A MGRS coordinate, for example 30UVG898998, is described by four segments:

  1. Alias Z, the gridzone: 30U
  2. Alias S, the 100,000 meter square designator: VG
  3. Alias X, the easting (x coordinate with respect to the 10,000 meter square): 898
  4. Alias Y, the northing (y coordinate with respect to the 10,000 meter square): 998
Properties:
alias String

A string that provides the name for this segment of a coordinate string.

description String

A string that describes the role of this segment.

searchPattern RegExp

A regular expression that should extract this segment from the complete coordinate.

PositionObject

Describes a point in terms of a location, a Point, and a coordinate, a string.

Properties:
location Point

A point geometry representing the location described by the conversion.

coordinate String

A string representing the location.

API Reference search results

NameTypeModule
Loading...