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.
NameTypeSummaryClass
Boolean

Indicates if the view can zoom in.

more details
more detailsZoomViewModel
Boolean

Indicates if the view can zoom out.

more details
more detailsZoomViewModel
String

The name of the class.

more details
more detailsAccessor
String

The current state of the widget.

more details
more detailsZoomViewModel
MapView | SceneView

The view from which to operate.

more details
more detailsZoomViewModel

Property Details

canZoomInBoolean

Indicates if the view can zoom in.

canZoomOutBoolean

Indicates if the view can zoom out.

declaredClassStringreadonly inherited
Since: ArcGIS API for JavaScript 4.7

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 TypeSummaryClass

Zooms the view in by an LOD factor of 0.5.

more details
more detailsZoomViewModel

Zooms the view out by an LOD factor of 2.

more details
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.

API Reference search results

NameTypeModule
Loading...