require(["esri/widgets/Zoom/ZoomViewModel"], function(ZoomVM) { /* code goes here */ });
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:
var view = new MapView({
  container: "viewDiv",
  map: map
});

var 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.
NameTypeSummary
Boolean

Indicates if the view can zoom in.

more details
more details
Boolean

Indicates if the view can zoom out.

more details
more details
String

The name of the class.

more details
more details
String

The current state of the widget.

more details
more details
MapView | SceneView

The view from which to operate.

more details
more details

Property Details

canZoomInBoolean

Indicates if the view can zoom in.

canZoomOutBoolean

Indicates if the view can zoom out.

declaredClassStringreadonly

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

stateStringreadonly

The current state of the widget.

Possible Values: disabled | ready

Default Value: disabled

The view from which to operate.

Method Overview

NameReturn TypeSummary

Zooms the view in by an LOD factor of 0.5.

more details
more details

Zooms the view out by an LOD factor of 2.

more details
more details

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.

API Reference search results

NameTypeModule

There were no match results from your search criteria.