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.
Demo
Properties
Property | Attribute | Type |
---|---|---|
auto-destroy-disabled | boolean | |
| ||
currentLocation readonly |
| |
| ||
| (((view: MapView | SceneView, goToParameters: GoToParameters) => void)) | |
heading-level | number | |
hide-capture-button | boolean | |
hide-expand-button | boolean | |
hide-input-button | boolean | |
hide-settings-button | boolean | |
icon | string | |
label | string | |
| ||
mode | "capture" | "live" | |
multiple-conversions-disabled | boolean | |
orientation | "auto" | "expand-down" | "expand-up" | |
position | "bottom-leading" | "bottom-left" | "bottom-right" | "bottom-trailing" | "manual" | "top-leading" | "top-left" | "top-right" | "top-trailing" | |
reference-element | ||
state readonly | state | "disabled" | "loading" | "ready" |
storage-disabled | boolean | |
storage-type | "local" | "session" |
autoDestroyDisabled
autoDestroyDisabled: boolean
If 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 containing every Conversion that the widget is currently displaying.
currentLocation
currentLocation: Point
Describes the location of the coordinates currently displayed by the widget as a Point.
formats
formats: Collection<Format>
A Collection containing every Format that the widget is capable of displaying.
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: number
Indicates the heading level to use for the coordinate input and coordinate settings headings.
- Attribute
- heading-level
- Default value
- 4
hideSettingsButton
hideSettingsButton: boolean
- Attribute
- hide-settings-button
- Default value
- false
icon
icon: string
Icon which represents the component. Typically used when the component is controlled by another component (e.g. by the Expand component).
- See also
- Attribute
- icon
- Default value
- "coordinate-system"
locationSymbol
locationSymbol: CIMSymbol | PictureMarkerSymbol | PointSymbol3D | SimpleMarkerSymbol
This symbol is used to visualize the location currently described by the widget when capture
mode
is active.
mode
mode: "capture" | "live"
Describes the current mode of the widget.
- Attribute
- mode
- Default value
- "live"
multipleConversionsDisabled
multipleConversionsDisabled: boolean
If this property is set to false
, multiple conversions cannot be displayed.
- Attribute
- multiple-conversions-disabled
- Default value
- false
orientation
orientation: "auto" | "expand-down" | "expand-up"
Determines whether the widget should expand up or down.
- Attribute
- orientation
- Default value
- "auto"
position
position: "bottom-leading" | "bottom-left" | "bottom-right" | "bottom-trailing" | "manual" | "top-leading" | "top-left" | "top-right" | "top-trailing"
- Attribute
- position
- Default value
- "bottom-left"
referenceElement
referenceElement: HTMLArcgisLinkChartElement | HTMLArcgisMapElement | HTMLArcgisSceneElement | string
By 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: boolean
Unless this property is set to false
, sessionStorage or localStorage (depending on storageType)
will be used to hydrate and persist the Coordinate Conversion 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 widget state.
- Attribute
- storage-type
- Default value
- "session"
Slots
Events
Event | Type |
---|---|
CustomEvent<{ name: "state" | "currentLocation"; }> | |
CustomEvent<void> |
arcgisPropertyChange
arcgisPropertyChange: CustomEvent<{ name: "state" | "currentLocation"; }>
Emitted when the value of a property is changed. Use this to listen to changes to properties.
Events triggered on this element will be propagated to their outermost elements.
The event is composable and will propagate across the shadow DOM into the standard DOM.
The event's default behavior can be canceled, allowing for custom behavior to be implemented instead.
arcgisReady
arcgisReady: CustomEvent<void>
Emitted when the component associated with a map or scene view is is ready to be interacted with.
Events triggered on this element will be propagated to their outermost elements.
The event is composable and will propagate across the shadow DOM into the standard DOM.
The event's default behavior can be canceled, allowing for custom behavior to be implemented instead.
Methods
Method | Signature |
---|---|
componentOnReady(): Promise<void> | |
destroy(): Promise<void> | |
reverseConvert(coordinate: string, format: __esri.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>