import "@arcgis/map-components/components/arcgis-track";
Track component is a button that animates the map or scene to the user's location when clicked. The view rotates based on device heading. The default heading symbol will display when speed is greater than zero and the browser provides heading information.
Known Limitations
- The heading symbol is not currently supported within an
arcgis-scene
component.
Demo
Properties
Property | Attribute | Type |
---|---|---|
auto-destroy-disabled | boolean | |
error | any | |
geolocation-options | any | |
go-to-location-disabled | boolean | |
| (((view: MapView | SceneView, goToParameters: GoToParameters) => void)) | |
| ||
icon | string | |
label | string | |
| {
componentLabel?: string | undefined;
startTracking?: string | undefined;
stopTracking?: string | undefined;
permissionError?: string | undefined;
timeoutError?: string | undefined;
positionUnavailable?: string | undefined;
} | |
position | "bottom-leading" | "bottom-left" | "bottom-right" | "bottom-trailing" | "manual" | "top-leading" | "top-left" | "top-right" | "top-trailing" | |
| Function | |
reference-element | ArcgisLinkChart | ArcgisMap | ArcgisScene | string | |
scale | number | |
state readonly |
| "disabled" | "error" | "feature-unsupported" | "ready" | "tracking" | "waiting" |
tracking readonly |
| boolean |
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 temporary 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
error
error: any
Error that caused the last track-error event to fire.
- Attribute
- error
- Default value
- null
geolocationOptions
geolocationOptions: any
An object used for setting optional position parameters.
- Attribute
- geolocation-options
- Default value
- null
goToLocationDisabled
goToLocationDisabled: boolean
Indicates whether to navigate the view to the position and scale of the geolocated result.
- Attribute
- go-to-location-disabled
- Default value
- false
goToOverride
goToOverride: (((view: MapView | SceneView, goToParameters: GoToParameters) => void))
This function provides the ability to override either the MapView goTo() or SceneView goTo() methods.
messageOverrides
messageOverrides: {
componentLabel?: string | undefined;
startTracking?: string | undefined;
stopTracking?: string | undefined;
permissionError?: string | undefined;
timeoutError?: string | undefined;
positionUnavailable?: string | undefined;
}
Replace localized message strings with your own strings.
position
position: "bottom-leading" | "bottom-left" | "bottom-right" | "bottom-trailing" | "manual" | "top-leading" | "top-left" | "top-right" | "top-trailing"
- Attribute
- position
- Default value
- "top-left"
positionFilterFunction
positionFilterFunction: Function
A function that is used as an expression to evaluate geolocation points, and returns a boolean value.
- Default value
- null
referenceElement
referenceElement: ArcgisLinkChart | ArcgisMap | ArcgisScene | string
- Attribute
- reference-element
scale
scale: number
Indicates the scale to set on the view when navigating to the position of the geolocated result, after a location is returned from the track event.
- Attribute
- scale
- Default value
- null
state
state: "disabled" | "error" | "feature-unsupported" | "ready" | "tracking" | "waiting"
The current state of the component.
- Default value
- "disabled"
tracking
tracking: boolean
Indicates whether new positions are being watched.
- Default value
- false
Methods
Method | Signature |
---|---|
componentOnReady(): Promise<void> | |
destroy(): Promise<void> | |
start(): Promise<void> | |
stop(): Promise<void> |
componentOnReady
componentOnReady(): Promise<void>
Create a promise that resolves once component is fully loaded.
- Returns
- Promise<void>
Events
Event | Type |
---|---|
TrackViewModelTrackEvent | |
TrackViewModelTrackErrorEvent | |
{ name: "state"; } | |
undefined |