ReadonlyidUnique id of this format.
ReadonlylabelHuman readable label of this format.
ReadonlysegmentsInput segments required by the format, for example x and y coordinates.
The coordinate conversion widget shows one input field for each segment.
Optional ReadonlyspatialWhen specified, points will be projected to this spatial reference before being passed to pointToSegments.
If this is not specified, you will receive the point in the current spatial reference of the view, and you will have to perform any necessary projections yourself.
Renders a point to segment values. The returned record is indexed by segment ids and contains a string for each segment.
The output of this function should be compatible with segmentsToPoint.
Example:
const point = ...;
const segments = format.pointToSegments(point);
// segments == { x: "...", y: "..." }
Parses a set of (validated) segment values into a Point.
This can be used, for example, to place a marker on the map.
Example:
const segments = { x: "1", y: "2" }
const point = await format.segmentsToPoint(segments).value; // assumes success
// point == { x: 1234, y: 5678, spatialReference: { ... }}
Formats a set of segment values to a human readable string. This combines the segment values to a final display string, including separating characters (like ',' or ' ') and units (like '°' and '"').
The segments parameter can be assumed to contain valid strings: either
The value returned here should be compatible with stringToSegments.
Example:
const segments = { x: "1", y: "2" }
const output = format.segmentsToString(segments);
// output == "1°, 2°"
Splits a human readable coordinates string (like returned by segmentsToString) into its input segment.
For example:
const input = "123.4 567.8";
const segments = format.stringToSegments(input).value; // assumes success
// segments == { x: "123.4", y: "567.8" };
Implements a format for coordinate conversions.
You can extend the builtin set of formats by providing a service with
"coordinateconversion.SegmentedFormat".