Format
esri/widgets/CoordinateConversion/support/Format
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
Name | Type | Summary | Object | |
---|---|---|---|---|
ConversionInfo | Contains information that describes how this Format should be converted. more details | more details | Format | |
CoordinateSegment[] | A array of Coordinate Segments. more details | more details | Format | |
String | A string that serves as a pattern describing how this Format should be displayed. more details | more details | Format | |
String | The default pattern describing how this Format should be displayed. more details | more details | Format | |
String | The name of the coordinate. more details | more details | Format | |
SpatialReference | The SpatialReference for this format. more details | more details | Format | |
CoordinateConversionViewModel | The view model of the CoordinateConversion widget that is utilizing this format. more details | more details | Format |
Property Details
- conversionInfo
Contains information that describes how this Format should be converted. This property should only be set when creating a custom Format.
- Default Value:null
- coordinateSegments
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.
- viewModel
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.
- CoordinateSegment
A coordinate segment represents one piece of a coordinate string.
A MGRS coordinate, for example
30UVG898998
, is described by four segments:- Alias
Z
, the gridzone:30U
- Alias
S
, the 100,000 meter square designator:VG
- Alias
X
, the easting (x coordinate with respect to the 10,000 meter square):898
- Alias
Y
, the northing (y coordinate with respect to the 10,000 meter square):998
- Alias