import NavigationToggleViewModel from "@arcgis/core/widgets/NavigationToggle/NavigationToggleViewModel.js";const NavigationToggleViewModel = await $arcgis.import("@arcgis/core/widgets/NavigationToggle/NavigationToggleViewModel.js");- Inheritance:
- NavigationToggleViewModel→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.0
Provides the logic for the NavigationToggle widget, which provides two simple buttons for toggling the navigation mode of a SceneView. Note that this is not designed for 2D mouse interaction in a MapView, nor for touch navigation.

The default navigation mode of the SceneView is always
pan. The various mouse interactions of this mode are outlined
here.
The alternate navigation mode to toggle to is rotate. This allows the user to
rotate the view with a mouse drag and pan the view with a right-click and drag
gesture.
- See also
NavigationToggle widget - Deprecated since 4.32. Use the Navigation Toggle component instead.
Example
// creates a new instance of the NavigationTogglelet navigationToggle = new NavigationToggle({ viewModel: { view: view }, layout: "horizontal"});
// and adds it to the top right of the viewview.ui.add(navigationToggle, "top-right");Constructors
Constructor
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
See the properties table for a list of all the
properties that may be passed into the constructor.
Properties
Any properties can be set, retrieved or listened to. See the
Watch for changes
topic.
| Property | Type | Class |
|---|---|---|
declaredClass readonly inherited | ||
| | ||
state readonly | | |
| |
navigationMode
Property
The navigation mode of the view. See the table below for a list of possible values.
| Possible Value | Description |
|---|---|
| pan | The mouse drag gesture pans the view. Right-click + drag allows the user to perform a 3D rotate around the center of the view. |
| rotate | The mouse drag gesture performs a 3D rotate around the center of the view and the right-click + drag gesture pans the view. |
- Default value
- "pan"