import SwipeViewModel from "@arcgis/core/widgets/Swipe/SwipeViewModel.js";const SwipeViewModel = await $arcgis.import("@arcgis/core/widgets/Swipe/SwipeViewModel.js");- Inheritance:
- SwipeViewModel→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.13
Provides the logic for the Swipe widget and component.
- See also
Swipe widget - Deprecated since 4.32. Use the Swipe component instead.
Constructors
Constructor
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| 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.
| Property | Type | Class |
|---|---|---|
declaredClass readonly inherited | ||
| | ||
| | ||
max readonly | 100 | |
min readonly | 0 | |
| | ||
state readonly | | |
| | ||
| | ||
| | ||
| |
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.
| horizontal | vertical |
|---|---|
![]() | ![]() |
- Default value
- "horizontal"
leadingLayers
autocast
Property
- Type
- Collection<Layer>
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
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
trailingLayers
autocast
Property
- Type
- Collection<Layer>

