import "@arcgis/map-components/components/arcgis-coordinate-conversion";The Coordinate Conversion component provides a way to display user cursor position either as map coordinates or as any of several popular coordinate notations. Additionally, the component provides a way to convert user input coordinates into a point.
Several common formats are included by default:
- XY - Longitude, Latitude (WGS84)
 - MGRS - Military Grid Reference System
 - UTM - Universal Transverse Mercator
 - DD - Decimal Degrees
 - DDM - Degrees Decimal Minutes
 - DMS - Degrees Minutes Seconds
 - Basemap - X, Y in the coordinate system used by the current basemap in the units used by the basemap. Web Mercator is the standard for Esri-provided basemaps.
 
Additional formats can be created by a developer and made available through the component
Example
<arcgis-map item-id="45b3b2fb35e94ab09381d0caa0da5946">
  <arcgis-coordinate-conversion slot="bottom-left"></arcgis-coordinate-conversion>
</arcgis-map>Demo
Properties
| Property | Attribute | Type | 
|---|---|---|
autoDestroyDisabled | auto-destroy-disabled | boolean | 
conversions |  | Collection<Conversion> | 
currentLocation |  | Point | 
expandedreflected  | expanded | boolean | 
formats |  | Collection<Format> | 
goToOverride |  | (((view: MapView | SceneView, goToParameters: GoToParameters) => void)) | 
headingLevel | heading-level | 1 | 2 | 3 | 4 | 5 | 6 | 
hideCaptureButtonreflected  | hide-capture-button | boolean | 
hideExpandButtonreflected  | hide-expand-button | boolean | 
hideInputButtonreflected  | hide-input-button | boolean | 
hideSettingsButtonreflected  | hide-settings-button | boolean | 
icon | icon | string | 
label | label | string | 
locationSymbol |  | CIMSymbol | PictureMarkerSymbol | PointSymbol3D | SimpleMarkerSymbol | 
modereflected  | mode | "capture" | "live" | 
multipleConversionsDisabledreflected  | multiple-conversions-disabled | boolean | 
orientationreflected  | orientation | "auto" | "expand-down" | "expand-up" | 
positiondeprecatedreflected  | position | "bottom-leading" | "bottom-left" | "bottom-right" | "bottom-trailing" | "manual" | "top-leading" | "top-left" | "top-right" | "top-trailing" | 
referenceElement | reference-element | HTMLArcgisLinkChartElement | HTMLArcgisMapElement | HTMLArcgisSceneElement | string | 
statereadonlyreflected  | state | "disabled" | "loading" | "ready" | 
storageDisabledreflected  | storage-disabled | boolean | 
storageType | storage-type | "local" | "session" | 
view |  | MapView | SceneView | 
autoDestroyDisabled
autoDestroyDisabled: booleanIf true, the component will not be destroyed automatically when it is disconnected from the document. This is useful when you want to move the component to a different place on the page, or temporarily hide it. If this is set, make sure to call the destroy method when you are done to prevent memory leaks.
- Attribute
 - auto-destroy-disabled
 - Default value
 - false
 
conversions
conversions: Collection<Conversion>A collection of conversions that the component is currently displaying. Each row in the component displaying a coordinate is a conversion.
Example
Conversions can be set with an array of strings where each string is a format's name.
coordinateConversionComponent.conversions = ["mgrs"];currentLocation
currentLocation: PointDescribes the location of the coordinates currently displayed by the component as a Point. Setting this property will update all conversions.
Example
Set the current location.
coordinateConversionComponent.currentLocation = { x: 77.0369, y: 38.9072, spatialReference: { wkid: 4326 } };expanded
expanded: booleanDescribes whether the component is expanded or not. If true, the component is expanded and all conversions are visible.
Example
Expand the component.
coordinateConversionComponent.expanded = true;- Attribute
 - expanded
 - Default value
 - false
 
formats
formats: Collection<Format>A collection containing every coordinate format that the component is capable of displaying.
The default formats are basemap, dd, ddm, dms, mgrs, usng, utm, and xy.
Examples
Only show the "xy" format.
const coordinateConversionComponent = document.getElementsByTagName("arcgis-coordinate-conversion")[0];
const toRemove = coordinateConversionComponent.formats.filter(format => format.name !== "xy");
coordinateConversionComponent.formats.removeMany(toRemove);Show every format except "xy".
const coordinateConversionComponent = document.getElementsByTagName("arcgis-coordinate-conversion")[0];
const toRemove = coordinateConversionComponent.formats.filter(format => format.name === "xy");
coordinateConversionComponent.formats.removeMany(toRemove);goToOverride
goToOverride: (((view: MapView | SceneView, goToParameters: GoToParameters) => void))This function provides the ability to override either the MapView goTo() or SceneView goTo() methods.
headingLevel
headingLevel: 1 | 2 | 3 | 4 | 5 | 6Indicates the heading level to use for the coordinate input and coordinate settings headings. By default,
these headings are rendered as level 4 headings (e.g. <h4>Input coordinate</h4>). Depending on the coordinate conversion component's
placement in your app, you may need to adjust this heading for proper semantics. This is important for meeting
accessibility standards.
- Attribute
 - heading-level
 - Default value
 - 4
 
hideCaptureButton
hideCaptureButton: booleanDetermines whether the capture button will be shown in the component. If true, the capture button will be hidden.
Example
Hide the capture button.
<arcgis-map item-id="45b3b2fb35e94ab09381d0caa0da5946">
  <arcgis-coordinate-conversion hide-capture-button slot="bottom-left"></arcgis-coordinate-conversion>
</arcgis-map>- Attribute
 - hide-capture-button
 - Default value
 - false
 
hideExpandButton
hideExpandButton: booleanDetermines whether the expand button will be shown in the component. If true, the expand button will be hidden.
Example
Hide the expand button.
<arcgis-map item-id="45b3b2fb35e94ab09381d0caa0da5946">
  <arcgis-coordinate-conversion hide-expand-button slot="bottom-left"></arcgis-coordinate-conversion>
</arcgis-map>- Attribute
 - hide-expand-button
 - Default value
 - false
 
hideInputButton
hideInputButton: booleanDetermines whether the input coordinate button will be shown in the component. If true, the input button will be hidden.
Example
Hide the input button.
<arcgis-map item-id="45b3b2fb35e94ab09381d0caa0da5946">
  <arcgis-coordinate-conversion hide-input-button slot="bottom-left"></arcgis-coordinate-conversion>
</arcgis-map>- Attribute
 - hide-input-button
 - Default value
 - false
 
hideSettingsButton
hideSettingsButton: booleanDetermines whether the settings button will be shown in the component. If true, the settings button will be hidden.
Example
Hide the settings button.
<arcgis-map item-id="45b3b2fb35e94ab09381d0caa0da5946">
  <arcgis-coordinate-conversion hide-settings-button slot="bottom-left"></arcgis-coordinate-conversion>
</arcgis-map>- Attribute
 - hide-settings-button
 - Default value
 - false
 
icon
icon: stringIcon which represents the component. Typically used when the component is controlled by another component (e.g. by the Expand component). Search Calcite Icons for possible values.
- Attribute
 - icon
 - Default value
 - "coordinate-system"
 
label
label: stringThe component's default label.
- Attribute
 - label
 - Default value
 - "Coordinate conversion"
 
locationSymbol
locationSymbol: CIMSymbol | PictureMarkerSymbol | PointSymbol3D | SimpleMarkerSymbolThis symbol is used to visualize the location currently described by the component when capture mode
is active.
This property should be set to a point symbol, typically a Simple Marker Symbol.
Example
Set the location symbol to be an 'x'.
const coordinateConversionComponent = document.getElementsByTagName("arcgis-coordinate-conversion")[0];
coordinateConversionComponent.locationSymbol = { type: "simple-marker", style: "x" };mode
mode: "capture" | "live"Describes the current mode of the component.
- While in 
livemode, the component will update as the cursor moves. - While in 
capturemode, the component will update on mouse click and display a graphic marking the current location. 
Example
Programmatically set the component to capture mode.
const coordinateConversionComponent = document.getElementsByTagName("arcgis-coordinate-conversion")[0];
coordinateConversionComponent.mode = "capture";- Attribute
 - mode
 - Default value
 - "live"
 
multipleConversionsDisabled
multipleConversionsDisabled: booleanIf this property is set to true, multiple conversions will be disabled, and only a single conversion will be displayed. Otherwise, multiple conversions will be shown.
- Attribute
 - multiple-conversions-disabled
 - Default value
 - false
 
orientation
orientation: "auto" | "expand-down" | "expand-up"Determines whether the component should expand up or down.  If set to auto,
the component will be oriented based on its position in the view.
- Attribute
 - orientation
 - Default value
 - "auto"
 
position
position: "bottom-leading" | "bottom-left" | "bottom-right" | "bottom-trailing" | "manual" | "top-leading" | "top-left" | "top-right" | "top-trailing"slot instead.- Attribute
 - position
 
referenceElement
referenceElement: HTMLArcgisLinkChartElement | HTMLArcgisMapElement | HTMLArcgisSceneElement | stringBy assigning the id attribute of the Map or Scene component to this property, you can position a child component anywhere in the DOM while still maintaining a connection to the Map or Scene.
- Attribute
 - reference-element
 
state
state: "disabled" | "loading" | "ready"The current state of the component.
- Attribute
 - state
 - Default value
 - "disabled"
 
storageDisabled
storageDisabled: booleanIf this property is set to true, sessionStorage or localStorage (depending on storageType)
will not be used to hydrate and persist the component's state.
- Attribute
 - storage-disabled
 - Default value
 - false
 
storageType
storageType: "local" | "session"This property determines whether sessionStorage or localStorage will be used to store component's state.
- Attribute
 - storage-type
 - Default value
 - "session"
 
view
The view associated with the component.
Note: The recommended approach is to fully migrate applications to use map and scene components and avoid using MapView and SceneView directly. However, if you are migrating a large application from widgets to components, you might prefer a more gradual transition. To support this use case, the SDK includes this
viewproperty which connects a component to a MapView or SceneView. Ultimately, once migration is complete, the Coordinate Conversion component will be associated with a map or scene component rather than using theviewproperty.
Methods
| Method | Signature | 
|---|---|
componentOnReady | componentOnReady(): Promise<void> | 
destroy | destroy(): Promise<void> | 
reverseConvert | reverseConvert(coordinate: string, format: Format): Promise<__esri.Point | nullish> | 
componentOnReady
componentOnReady(): Promise<void>Create a promise that resolves once component is fully loaded.
Example
const arcgisCoordinateConversion = document.querySelector("arcgis-coordinate-conversion");
document.body.append(arcgisCoordinateConversion);
await arcgisCoordinateConversion.componentOnReady();
console.log("arcgis-coordinate-conversion is ready to go!");- Returns
 - Promise<void>
 
reverseConvert
reverseConvert(coordinate: string, format: Format): Promise<__esri.Point | nullish>Attempt to convert a string into a point. The format of the string must be specified. A collection of available formats can be obtained from the formats property.
Parameters
| Parameter | Type | Optional? | 
|---|---|---|
| coordinate | string | |
| format | Format | 
- Returns
 - Promise<Point | null | undefined>
 
Events
| Event | Type | 
|---|---|
arcgisConversionChange | CustomEvent<void> | 
arcgisPropertyChange | CustomEvent<{ name: "state" | "mode" | "expanded" | "currentLocation"; }> | 
arcgisReady | CustomEvent<void> | 
arcgisConversionChange
arcgisConversionChange: CustomEvent<void>Emitted when a conversion is added or removed, or when the order of conversions changes.
arcgisPropertyChange
arcgisPropertyChange: CustomEvent<{ name: "state" | "mode" | "expanded" | "currentLocation"; }>Emitted when the value of a property is changed. Use this to listen to changes to properties.
arcgisReady
arcgisReady: CustomEvent<void>Emitted when the component associated with a map or scene view is ready to be interacted with.