Skip to content
import SwipeViewModel from "@arcgis/core/widgets/Swipe/SwipeViewModel.js";
Inheritance:
SwipeViewModelAccessor
Since
ArcGIS Maps SDK for JavaScript 4.13

Provides the logic for the Swipe widget and component.

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.

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

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

direction

Property
Type
Direction

The direction the Swipe moves across the view. If "horizontal", it will move left and right and if "vertical", it will move up and down.

horizontalvertical
widgets-swipe-horizontalwidgets-swipe-vertical
Default value
"horizontal"

leadingLayers

autocast Property
Type
Collection<Layer>

A collection of Layers that will show on the left or top side of the Swipe. See the image in the Swipe class description.

See also

max

readonly Property
Type
100
Since
ArcGIS Maps SDK for JavaScript 4.32

The maximum position of the Swipe, as a percentage.

min

readonly Property
Type
0
Since
ArcGIS Maps SDK for JavaScript 4.32

The minimum position of the Swipe, as a percentage.

position

Property
Type
number

The position of the Swipe. This determines what percentage of the view will be taken up by the leadingLayers.

Default value
25

state

readonly Property
Type
State

The current state of the Swipe.

Default value
"disabled"

step

Property
Type
number
Since
ArcGIS Maps SDK for JavaScript 4.32

The step value used to increment or decrement the position of the Swipe when using keyboard navigation.

Default value
0.5

stepMultiplier

Property
Type
number
Since
ArcGIS Maps SDK for JavaScript 4.32

The multiplier used to increase the step value when the Shift key is pressed in combination with one of the arrow keys.

Default value
10

trailingLayers

autocast Property
Type
Collection<Layer>

A collection of Layers that will show on the right or bottom side of the Swipe. See the image in the Swipe class description.

See also

view

Property
Type
MapView | null | undefined

A reference to the MapView. Set this to link the Swipe to a specific view.