ZoomViewModel

AMD: require(["esri/widgets/Zoom/ZoomViewModel"], (ZoomVM) => { /* code goes here */ });
ESM: import ZoomViewModel from "@arcgis/core/widgets/Zoom/ZoomViewModel";
Class: esri/widgets/Zoom/ZoomViewModel
Inheritance: ZoomViewModel Accessor
Since: ArcGIS API for JavaScript 4.0

Provides the logic for the Zoom widget.

See also:
Example:
let view = new MapView({
  container: "viewDiv",
  map: map
});

let zoom = new Zoom({
  viewModel: {  // autocasts as new ZoomViewModel()
    view: view
  }
}, "zoomDiv");

Constructors

new ZoomViewModel(properties)
Parameter:
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

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
Booleanmore details

Indicates if the view can zoom in.

more detailsZoomViewModel
Booleanmore details

Indicates if the view can zoom out.

more detailsZoomViewModel
Stringmore details

The name of the class.

more detailsAccessor
Stringmore details

The current state of the widget.

more detailsZoomViewModel
MapView|SceneViewmore details

The view from which to operate.

more detailsZoomViewModel

Property Details

canZoomIn Boolean

Indicates if the view can zoom in.

canZoomOut Boolean

Indicates if the view can zoom out.

declaredClass Stringreadonly inherited
Since: ArcGIS API for JavaScript 4.7

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

state Stringreadonly

The current state of the widget.

Possible Values:"disabled"|"ready"

Default Value:disabled

The view from which to operate.

Method Overview

Name Return Type Summary Class
more details

Zooms the view in by an LOD factor of 0.5.

more detailsZoomViewModel
more details

Zooms the view out by an LOD factor of 2.

more detailsZoomViewModel

Method Details

zoomIn()

Zooms the view in by an LOD factor of 0.5.

zoomOut()

Zooms the view out by an LOD factor of 2.

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