Coordinate Conversion

ESM:
Use dark colors for code blocksCopy
1
import "@arcgis/map-components/components/arcgis-coordinate-conversion";
CDN:
No specific import is needed for this component.

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

PropertyAttributeType
auto-destroy-disabled
boolean
(((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

Property
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

Property
conversions: Collection<Conversion>

A Collection containing every Conversion that the widget is currently displaying.

Read more...

currentLocation

readonlyProperty
currentLocation: Point

Describes the location of the coordinates currently displayed by the widget as a Point.

Read more...

formats

Property
formats: Collection<Format>

A Collection containing every Format that the widget is capable of displaying.

Read more...

goToOverride

Property
goToOverride: (((view: MapView | SceneView, goToParameters: GoToParameters) => void))

This function provides the ability to override either the MapView goTo() or SceneView goTo() methods.

Read more...

headingLevel

Property
headingLevel: number

Indicates the heading level to use for the coordinate input and coordinate settings headings.

Attribute
heading-level
Default value
4

hideCaptureButton

Property
hideCaptureButton: boolean
Attribute
hide-capture-button
Default value
false

hideExpandButton

Property
hideExpandButton: boolean
Attribute
hide-expand-button
Default value
false

hideInputButton

Property
hideInputButton: boolean
Attribute
hide-input-button
Default value
false

hideSettingsButton

Property
hideSettingsButton: boolean
Attribute
hide-settings-button
Default value
false

icon

Property
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"

label

Property
label: string

The widget's default label.

Read more...

Attribute
label

locationSymbol

Property

This symbol is used to visualize the location currently described by the widget when capture mode is active.

Read more...

mode

Property
mode: "capture" | "live"

Describes the current mode of the widget.

Attribute
mode
Default value
"live"

multipleConversionsDisabled

Property
multipleConversionsDisabled: boolean

If this property is set to false, multiple conversions cannot be displayed.

Attribute
multiple-conversions-disabled
Default value
false

orientation

Property
orientation: "auto" | "expand-down" | "expand-up"

Determines whether the widget should expand up or down.

Attribute
orientation
Default value
"auto"

position

Property
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

Property

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.

See also
Attribute
reference-element

state

readonlyreflected

Attribute changes are reflected on the DOM.

Property
state: "disabled" | "loading" | "ready"

The current state of the component.

Attribute
state
Default value
"disabled"

storageDisabled

Property
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

Property
storageType: "local" | "session"

This property determines whether sessionStorage or localStorage will be used to store widget state.

Attribute
storage-type
Default value
"session"

Slots

No slots to display.

Events

EventType
CustomEvent<{ name: "state" | "currentLocation"; }>

arcgisPropertyChange

Event
arcgisPropertyChange: CustomEvent<{ name: "state" | "currentLocation"; }>

Emitted when the value of a property is changed. Use this to listen to changes to properties.

bubbles

Events triggered on this element will be propagated to their outermost elements.

composed

The event is composable and will propagate across the shadow DOM into the standard DOM.

cancelable

The event's default behavior can be canceled, allowing for custom behavior to be implemented instead.

arcgisReady

Event
arcgisReady: CustomEvent<void>

Emitted when the component associated with a map or scene view is is ready to be interacted with.

bubbles

Events triggered on this element will be propagated to their outermost elements.

composed

The event is composable and will propagate across the shadow DOM into the standard DOM.

cancelable

The event's default behavior can be canceled, allowing for custom behavior to be implemented instead.

Methods

MethodSignature
componentOnReady(): Promise<void>
destroy(): Promise<void>
reverseConvert(coordinate: string, format: __esri.Format): Promise<__esri.Point | nullish>

componentOnReady

Method
componentOnReady(): Promise<void>

Create a promise that resolves once component is fully loaded.

Example
Use dark colors for code blocksCopy
1
2
3
4
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>

destroy

Method
destroy(): Promise<void>

Permanently destroy the component.

Returns
Promise<void>

reverseConvert

Method
reverseConvert(coordinate: string, format: __esri.Format): Promise<__esri.Point | nullish>
Parameters
ParameterTypeOptional?
coordinate
string
format
Returns
Promise<Point | null | undefined>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.