Constructors
-
new Format(properties)
-
Parameterproperties Objectoptional
See the properties for a list of all the properties that may be passed into the constructor.
Property Overview
Name | Type | Summary | Class |
---|---|---|---|
ConversionInfo | Contains information that describes how this Format should be converted. more details | Format | |
CoordinateSegment[] | A array of Coordinate Segments. more details | Format | |
String | A string that serves as a pattern describing how this Format should be displayed. more details | Format | |
String | The name of the class. more details | Accessor | |
String | The default pattern describing how this Format should be displayed. more details | Format | |
String | A string that is used to label this Format in the UI. more details | Format | |
String | The name of the coordinate. more details | Format | |
SpatialReference | The SpatialReference for this format. more details | Format | |
CoordinateConversionViewModel | The view model of the CoordinateConversion widget that is utilizing this format. more details | Format |
Property Details
-
conversionInfo 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 CoordinateSegment[]
-
A array of Coordinate Segments. Each segment represents a section of the Format's coordinate.
- Default Value:null
-
currentPattern 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.
- Default Value:null
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"
-
The name of the class. The declared class name is formatted as
esri.folder.className
.
-
defaultPattern String
-
The default pattern describing how this Format should be displayed. See currentPattern.
- Default Value:null
-
label StringSince: 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 String
-
The name of the coordinate. A CoordinateConversion widget should not contain multiple Formats with the same name.
- Default Value:null
-
spatialReference SpatialReference
-
The SpatialReference for this format. Coordinates generated for a format will be derived from points in this spatial reference.
-
viewModel CoordinateConversionViewModel
-
The view model of the CoordinateConversion widget that is utilizing this format.
Method Overview
Name | Return Type | Summary | Class |
---|---|---|---|
Adds one or more handles which are to be tied to the lifecycle of the object. more details | Accessor | ||
Boolean | Returns true if a named group of handles exist. more details | Accessor | |
Removes a group of handles owned by the object. more details | Accessor |
Method Details
-
addHandles(handleOrHandles, groupKey)inheritedSince: ArcGIS Maps SDK for JavaScript 4.25
-
Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.
// Manually manage handles const handle = reactiveUtils.when( () => !view.updating, () => { wkidSelect.disabled = false; }, { once: true } ); this.addHandles(handle); // Destroy the object this.destroy();
ParametershandleOrHandles WatchHandle|WatchHandle[]Handles marked for removal once the object is destroyed.
groupKey *optionalKey identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.
-
Since: ArcGIS Maps SDK for JavaScript 4.25
-
Returns true if a named group of handles exist.
ParametergroupKey *optionalA group key.
ReturnsType Description Boolean Returns true
if a named group of handles exist.Example// Remove a named group of handles if they exist. if (obj.hasHandles("watch-view-updates")) { obj.removeHandles("watch-view-updates"); }
-
removeHandles(groupKey)inheritedSince: ArcGIS Maps SDK for JavaScript 4.25
-
Removes a group of handles owned by the object.
ParametergroupKey *optionalA group key or an array or collection of group keys to remove.
Exampleobj.removeHandles(); // removes handles from default group obj.removeHandles("handle-group"); obj.removeHandles("other-handle-group");
Type Definitions
-
ConversionInfo Object
-
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 ConvertFunction
A function that takes a point and returns a position.
reverseConvert ReverseConvertFunctionA function that takes a string and returns a Point.
-
ConvertFunction(point){Position}
-
A user-provided function that converts a Point into a Position. This function may be necessary to provide as part of ConversionInfo when creating a custom Format.
Parameterpoint PointA point to be converted.
ReturnsType Description Position The returned position.
-
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
-
ReverseConvertFunction(coordinate){Point}
-
A user-provided function that converts a coordinate string into a Point. This function may be necessary to provide as part of ConversionInfo when creating a custom Format.
Parametercoordinate StringThe string to be reversed.
ReturnsType Description Point The returned point