Skip to content
import ZoomViewModel from "@arcgis/core/widgets/Zoom/ZoomViewModel.js";
Inheritance:
ZoomViewModelAccessor
Since
ArcGIS Maps SDK for JavaScript 4.0

Provides the logic for the Zoom widget.

See also

Constructors

Constructor

Constructor
Parameters
ParameterTypeDescriptionRequired
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.
PropertyTypeClass
canZoomIn
readonly
canZoomOut
readonly
declaredClass
readonly inherited
state
readonly

canZoomIn

readonly Property
Type
boolean

Indicates if the view can zoom in.

canZoomOut

readonly Property
Type
boolean

Indicates if the view can zoom out.

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor
Since
ArcGIS Maps SDK for JavaScript 4.7

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

state

readonly Property
Type
ZoomViewModelState

The current state of the widget.

Default value
"disabled"

view

Property
Type
MapViewOrSceneView | null | undefined

The view from which to operate.

Methods

MethodSignatureClass
zoomIn(): void
zoomOut(): void

zoomIn

Method
Signature
zoomIn (): void

Zooms the view in by an LOD factor of 0.5.

Returns
void

zoomOut

Method
Signature
zoomOut (): void

Zooms the view out by an LOD factor of 2.

Returns
void

Type definitions

ZoomViewModelState

Type definition
Type
"disabled" | "ready"