import Format from "@arcgis/core/widgets/CoordinateConversion/support/Format.js";
Inheritance
FormatAccessor
Since
ArcGIS Maps SDK for JavaScript 4.7

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

See also

Constructors

Constructor

Constructor

Parameters

ParameterTypeDescriptionRequired
properties
See the properties table for a list of all the properties that may be passed into the constructor.

Properties

Any properties can be set, retrieved or listened to. See the Watch for changes topic.

conversionInfo

Property
Type
ConversionInfo | null | undefined

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

coordinateSegments

Property
Type
CoordinateSegment[] | null | undefined

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

currentPattern

autocast Property
Type
string

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.

Example
// Remove the spaces from an mgrs coordinate
let format = coordinateConversionWidget.formats.find(function(format) {
return format.name === "mgrs";
});
console.log.(format.currentPattern);
// > Z S X Y
format.currentPattern = "ZSXY"

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

The name of the class. The declared class name is formatted as esri.folder.className.

defaultPattern

Property
Type
string | null | undefined

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

label

autocast Property
Type
string
Since
ArcGIS Maps SDK for JavaScript 4.24

A string that is used to label this Format in the UI. If not set, it will default to name

name

Property
Type
string | null | undefined

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

spatialReference

autocast Property
Type
SpatialReference

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

viewModel

Property
Type
CoordinateConversionViewModel | null | undefined

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

Methods

MethodSignatureClass
reverseConvert(coordinate: string): Promise<Point | null | undefined>

reverseConvert

Method
Signature
reverseConvert (coordinate: string): Promise<Point | null | undefined>
Since
ArcGIS Maps SDK for JavaScript 4.34

Attempt to convert a valid string for this Format into a Point

See also

Parameters

ParameterTypeDescriptionRequired
coordinate

The coordinate string.

Returns
Promise<Point | null | undefined>

When resolved, returns a Point