import "@arcgis/ai-components/components/arcgis-assistant-navigation-agent";- Inheritance:
- ArcgisAssistantNavigationAgent→
PublicLitElement
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The Navigation Agent enables the end user to navigate to different areas of a web map. See the list of capabilities below for more details.
This is an unrendered component that must be added as a child of the arcgis-assistant component in either HTML or JavaScript.
<arcgis-map id="my-map"></arcgis-map><arcgis-assistant reference-element="my-map"> <arcgis-assistant-navigation-agent></arcgis-assistant-navigation-agent></arcgis-assistant>const assistant = document.querySelector("arcgis-assistant");const navigationAgent = document.createElement("arcgis-assistant-navigation-agent");assistant.appendChild(navigationAgent);Once added to the assistant, the agent is loaded and ready to receive user messages related to navigation.
Capabilities
The navigation agent provides the following capabilities related to map navigation:
- Geocoding - Navigate to an address using Esri's World Geocoding Service.
- Go to extent - Navigate to the extent of a bookmark in the map, the home extent of the web map, or the extent of a layer.
- Go to features - Navigate to a specified feature or set of features.
- Go to viewpoint - Navigate to a specified viewpoint, which can include center, zoom, and/or rotation.
Example questions
The following are example questions a user can ask within the bounds of the navigation agent:
- "Go to the Golden Gate Bridge"
- "Zoom to a 1 to 24,000 scale"
- "Zoom in"
- "Go to the parks layer"
The following are examples of the types of questions that fall outside the bounds of the navigation agent and should therefore be avoided:
- "Rotate the map 45 degrees" (this capability is not currently supported but may be in the future)
- "Make this map 3D and tilt the view to a 45 degree angle" (3D navigation is currently not supported)
- "Where am I?" (the navigation agent does not have access to the user's location)
Due to the non-deterministic nature of generative AI, there may be inaccuracies or unexpected behavior when using the out-of-the-box agents.
Properties
| Property | Attribute | Type |
|---|---|---|
reference-element |
referenceElement
The reference element to the map that provides context for the navigation agent. Currently,
this is only scoped to arcgis-map elements. This shows the navigation agent which map on which to
perform navigation actions. This is required for the navigation agent to function properly.
Setting this property is not necessary if you set the reference element on the parent
arcgis-assistant component.
- Attribute
- reference-element
Example
<arcgis-map id="my-map"></arcgis-map><arcgis-assistant> <arcgis-assistant-navigation-agent reference-element="my-map"></arcgis-assistant-navigation-agent></arcgis-assistant>Methods
| Method | Signature |
|---|---|
componentOnReady inherited | componentOnReady(): Promise<this> |
componentOnReady
- Signature
-
componentOnReady (): Promise<this>
Creates a promise that resolves once the component is fully loaded.
- Returns
- Promise<this>
Example
const arcgisAssistantNavigationAgent = document.querySelector("arcgis-assistant-navigation-agent");document.body.append(arcgisAssistantNavigationAgent);await arcgisAssistantNavigationAgent.componentOnReady();console.log("arcgis-assistant-navigation-agent is ready to go!");