Skip to content
import ScaleRangeSliderViewModel from "@arcgis/core/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js";
Inheritance:
ScaleRangeSliderViewModelAccessor
Since
ArcGIS Maps SDK for JavaScript 4.13

Provides the logic for the ScaleRangeSlider 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.

layer

Property
Type
Layer | Sublayer | null | undefined

When provided, the initial minScale and maxScale values will match the layer's.

When a tiled layer is used, the slider will be restricted from moving the slider thumbs past the lods of the layer's tiling scheme. Since version 4.28, when a MapImageLayer is used, the slider will be restricted from moving past the min/max scale defined on the map service. The unavailable scale range will be designated with a dashed line.

maxScale

autocast Property
Type
number

The maximum scale of the active scale range. When the maxScale reaches the maxScaleLimit, the maxScale value becomes 0 and there is no maximum scale set.

maxScaleLimit

Property
Type
number

The lowest possible maximum scale value from the slider.

minScale

autocast Property
Type
number

The minimum scale of the active scale range. When the minScale reaches the minScaleLimit, the minScale value becomes 0 and there is no minimum scale set.

minScaleLimit

Property
Type
number

The highest possible minimum scale value from the slider.

scaleRanges

readonly Property
Type
ReturnType<typeof ScaleRanges.fromScaleRange>

The valid scale ranges available based on the slider position.

sliderViewModel

autocast Property
Type
SliderViewModel

The [SliderViewModel]SliderViewModel for supporting the scale range slider widget.

state

readonly Property
Type
ScaleRangeSliderViewModelState

The current state of the widget.

Default value
"disabled"

view

Property
Type
MapViewOrSceneView | null | undefined

A reference to the MapView or SceneView. Set this to link the widget to a specific view.

Methods

MethodSignatureClass
mapScaleToSlider(scale: number): number
mapSliderToScale(value: number): number

mapScaleToSlider

Method
Signature
mapScaleToSlider (scale: number): number

Utility method for converting scale-to-slider values.

Parameters
ParameterTypeDescriptionRequired
scale

The map scale to be converted.

Returns
number

The value of the slider.

mapSliderToScale

Method
Signature
mapSliderToScale (value: number): number

Utility method for converting slider-to-scale values.

Parameters
ParameterTypeDescriptionRequired
value

The value of the slider.

Returns
number

The map scale that corresponds to the value of the slider.

Type definitions

ScaleRangeSliderViewModelState

Type definition
Type
"disabled" | "ready"