Navigation

AMD: require(["esri/views/navigation/Navigation"], (Navigation) => { /* code goes here */ });
ESM: import Navigation from "@arcgis/core/views/navigation/Navigation.js";
Class: esri/views/navigation/Navigation
Inheritance: Navigation Accessor
Since: ArcGIS Maps SDK for JavaScript 4.9

Navigation related configuration settings on the View.

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
Show inherited properties Hide inherited properties
Name Type Summary Class

Indicates if single finger touch drag events are enabled or disabled.

Navigation

The name of the class.

Accessor

Gamepad navigation specific configuration settings.

Navigation

When true, the view will temporarily continue to pan after the pointer (e.g.

Navigation

Indicates whether the view can be zoomed in or out with the mouse wheel.

Navigation

Property Details

browserTouchPanEnabled

Property
browserTouchPanEnabled Boolean
Since: ArcGIS Maps SDK for JavaScript 4.14 Navigation since 4.9, browserTouchPanEnabled added at 4.14.

Indicates if single finger touch drag events are enabled or disabled. When false, the map cannot be panned with single finger touch gesture on touch devices. This will allow web pages to scroll down without panning the map on touch devices. While single touch panning and zooming is disabled, the map can still be panned, zoomed, and rotated (if unconstrained) with two fingers. This property does not affect mouse-based dragging.

Default Value:true
Example
// Disable single touch panning in a MapView.
const view = new MapView({
  container: "viewDiv",
  map: new Map({
    basemap: "streets-vector"
  })
});
view.navigation.browserTouchPanEnabled = false;

declaredClass

Inherited
Property
declaredClass Stringreadonly
Inherited from Accessor

The name of the class. The declared class name is formatted as esri.folder.className.

gamepad

Property
gamepad GamepadSettings

Gamepad navigation specific configuration settings.

Example
// Disable the gamepad usage in MapView
const view = new MapView({
  container: "viewDiv",
  map: new Map({
    basemap: "satellite"
  }),
  center: [176.185, -37.643],
  zoom: 13,
  navigation: {
    gamepad: {
      enabled: false
    }
  }
});

// Disable gamepad usage in SceneView.
const view = new SceneView({
  container: "viewDiv",
  map: new Map({
    basemap: "satellite",
    ground: "world-elevation"
  }),
  camera: {
    position: [176.171, -37.660, 2000],
    heading: 0,
    tilt: 60
  },
  navigation: {
    gamepad: {
      enabled: false
    }
  }
});

momentumEnabled

Property
momentumEnabled Boolean
Since: ArcGIS Maps SDK for JavaScript 4.14 Navigation since 4.9, momentumEnabled added at 4.14.

When true, the view will temporarily continue to pan after the pointer (e.g. mouse, stylus, finger) has lifted.

With respect to MapView, this property will be ignored if config.respectPrefersReducedMotion is true and the user has requested reduced motion. See prefers-reduced-motion for more information.

Default Value:true
Example
// Disable pan animation in the MapView.
const view = new MapView({
  container: "viewDiv",
  map: new Map({
    basemap: "streets-vector"
  })
});
view.navigation.momentumEnabled = false;

mouseWheelZoomEnabled

Property
mouseWheelZoomEnabled Boolean
Since: ArcGIS Maps SDK for JavaScript 4.14 Navigation since 4.9, mouseWheelZoomEnabled added at 4.14.

Indicates whether the view can be zoomed in or out with the mouse wheel. When a map occupies part the screen, page navigation may be difficult at times since mouse wheel movement over the map can be interpreted as map zooming rather than page scrolling. In some cases, setting mouseWheelZoomEnabled to false can make scrollable webpages with maps easier to navigate.

Default Value:true
Example
// To disable mouse wheel zooming in a MapView.
const view = new MapView({
  container: "viewDiv",
  map: new Map({
    basemap: "streets-vector"
  })
});
view.navigation.mouseWheelZoomEnabled = false;

Method Overview

Show inherited methods Hide inherited methods
Name Return Type Summary Class

Adds one or more handles which are to be tied to the lifecycle of the object.

Accessor

Returns true if a named group of handles exist.

Accessor

Removes a group of handles owned by the object.

Accessor

Method Details

addHandles

Inherited
Method
addHandles(handleOrHandles, groupKey)
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, addHandles added at 4.25.

Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.

// Manually manage handles
const handle = reactiveUtils.when(
  () => !view.updating,
  () => {
    wkidSelect.disabled = false;
  },
  { once: true }
);

this.addHandles(handle);

// Destroy the object
this.destroy();
Parameters
handleOrHandles WatchHandle|WatchHandle[]

Handles marked for removal once the object is destroyed.

groupKey *
optional

Key identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.

hasHandles

Inherited
Method
hasHandles(groupKey){Boolean}
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, hasHandles added at 4.25.

Returns true if a named group of handles exist.

Parameter
groupKey *
optional

A group key.

Returns
Type Description
Boolean Returns true if a named group of handles exist.
Example
// Remove a named group of handles if they exist.
if (obj.hasHandles("watch-view-updates")) {
  obj.removeHandles("watch-view-updates");
}

removeHandles

Inherited
Method
removeHandles(groupKey)
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, removeHandles added at 4.25.

Removes a group of handles owned by the object.

Parameter
groupKey *
optional

A group key or an array or collection of group keys to remove.

Example
obj.removeHandles(); // removes handles from default group

obj.removeHandles("handle-group");
obj.removeHandles("other-handle-group");

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