ESM
import "@arcgis/map-components/components/arcgis-slider-scale-range";
Inheritance
ArcgisSliderScaleRange→HTMLElement
Since
ArcGIS Maps SDK for JavaScript 5.1

The Scale Range Slider component allows the user to set a minimum and maximum scale based on named scale ranges. When a layer is provided, the component's minScale and maxScale properties will be set to the scale range of the layer.

Demos

Properties

PropertyAttributeType
auto-destroy-disabled
reflected
disabled
hide-max-scale-menu
hide-min-scale-menu
hide-preview
icon
label
max-scale
max-scale-limit
min-scale
min-scale-limit
mode
"max-scale-only" | "min-scale-only" | "range"
reference-element
region
show-scale-range-indicator
show-world-value
readonly
"disabled" | "ready"

autoDestroyDisabled

Property
Type
boolean

If true, the component will not be destroyed automatically when it is disconnected from the document. This is useful when you want to move the component to a different place on the page, or temporarily hide it. If this is set, make sure to call the destroy() method when you are done to prevent memory leaks.

Attribute
auto-destroy-disabled
Default value
false
Example
<arcgis-slider-scale-range auto-destroy-disabled></arcgis-slider-scale-range>
sliderScaleRangeElement.autoDestroyDisabled = true;

disabled

reflected Property
Type
boolean

When true, the component is visually de-emphasized and does not accept user interaction.

Attribute
disabled
Default value
false

hideMaxScaleMenu

Property
Type
boolean | undefined

Indicates whether the maximum scale dropdown menu is hidden. Default value is false.

Attribute
hide-max-scale-menu
Default value
false

hideMinScaleMenu

Property
Type
boolean | undefined

Indicates whether the minimum scale dropdown menu is hidden. Default value is false.

Attribute
hide-min-scale-menu
Default value
false

hidePreview

Property
Type
boolean | undefined

Indicates whether the preview thumbnail of the scale is hidden. Default value is false.

Attribute
hide-preview
Default value
false

icon

Property
Type
IconName

Icon which represents the component. Typically used when the component is controlled by another component (e.g. by the Expand component).

See also
Attribute
icon
Default value
"actual-size"

label

Property
Type
string | undefined

The component's default label.

Attribute
label

layer

Property
Type
Layer | Sublayer | SubtypeSublayer | undefined

When provided, the initial minScale and maxScale values will match the scale range within which the layer will render.

If a TileLayer with resampling disabled is provided, the slider thumbs will not be allowed to move past the lods of the layer's tiling scheme. If a MapImageLayer is provided, the same restrictions to the thumbs will be applied via the min/max scale defined by the map service. The unavailable range will be designated with a dashed line.

maxScale

Property
Type
number

The maximum scale of the active scale range.

Attribute
max-scale
Default value
0

maxScaleLimit

Property
Type
number

The lowest possible maximum scale value on the slider, at which maxScale may not be set below.

Attribute
max-scale-limit
Default value
100000000

minScale

Property
Type
number

The minimum scale of the active scale range.

Attribute
min-scale
Default value
0

minScaleLimit

Property
Type
number

The highest possible minimum scale value on the slider, at which minScale may not be set above.

Attribute
min-scale-limit
Default value
147914382

mode

Property
Type
"max-scale-only" | "min-scale-only" | "range"

The mode of the component, indicating which slider thumbs can be adjusted.

Attribute
mode
Default value
"range"

referenceElement

Property
Type
ArcgisReferenceElement | string | undefined

By assigning the id attribute of the Map or Scene component to this property, you can position a child component anywhere in the DOM while still maintaining a connection to the Map or Scene.

See also
Attribute
reference-element

region

Property
Type
Region | Uppercase<Region> | undefined

The region that the scale thumbnails will focus on. Each region comes from the ISO 3166-1 alpha-2 code. Both lowercase and uppercase region codes are supported.

Attribute
region

showScaleRangeIndicator

Property
Type
boolean
Since
ArcGIS Maps SDK for JavaScript 5.2

If an arcgis-scene is associated with the component and this property is set to true, the current scale indicator will be represented as a highlighted range of the slider track. The width of the indicator will increase as the camera's tilt approaches 90 degrees. If this property is set to false, a small caret will render under the track indicating the current scale instead.

This property is not supported when the component is used in 2D maps.

Attribute
show-scale-range-indicator
Default value
false

showWorldValue

Property
Type
boolean

Indicates whether the world scale value is shown in the scale menu.

Attribute
show-world-value
Default value
false

state

readonly Property
Type
"disabled" | "ready"

The current state of the component.

Default value
"disabled"

view

Property
Type
LinkChartView | MapView | SceneView | undefined

The view associated with the component.

Note: The recommended approach is to fully migrate applications to use map and scene components and avoid using MapView and SceneView directly. However, if you are migrating a large application from widgets to components, you might prefer a more gradual transition. To support this use case, the SDK includes this view property which connects a component to a MapView or SceneView. Ultimately, once migration is complete, the arcgis-slider-scale-range component will be associated with a map or scene component rather than using the view property.

Methods

MethodSignature
inherited
componentOnReady(): Promise<this>
destroy(): Promise<void>

componentOnReady

inherited Method
Signature
componentOnReady (): Promise<this>

Creates a promise that resolves once the component is fully loaded.

Returns
Promise<this>
Example
const arcgisSliderScaleRange = document.createElement("arcgis-slider-scale-range");
document.body.append(arcgisSliderScaleRange);
await arcgisSliderScaleRange.componentOnReady();
console.log("arcgis-slider-scale-range is ready to go!");

destroy

Method
Signature
destroy (): Promise<void>

Permanently destroy the component.

Returns
Promise<void>

Events

arcgisChange

Event
arcgisChange: CustomEvent<void>

Fires when the thumb or range is released on the component. Use @arcgisInput for continuous updates during a drag.

bubbles composed cancelable

arcgisInput

Event
arcgisInput: CustomEvent<void>

Fires continuously while the thumb or range is being dragged. This event can fire frequently; consider debouncing or throttling expensive work.

bubbles composed cancelable

arcgisPropertyChange

Event
arcgisPropertyChange: CustomEvent<{ name: "state" | "minScale" | "maxScale"; }>

Emitted when the value of a property is changed. Use this to listen to changes to properties.

bubbles composed cancelable

arcgisReady

Event
arcgisReady: CustomEvent<void>

Emitted when the component associated with a map or scene view is ready for user interaction.

bubbles composed cancelable

Type definitions

Region

Type definition
Since
ArcGIS Maps SDK for JavaScript 5.2

The supported lowercase ISO 3166-1 alpha-2 code region codes for scale preview thumbnails. The region property also accepts uppercase versions of these codes.

Type
"ae" | "ar" | "at" | "au" | "be" | "bg" | "bo" | "br" | "ca" | "ch" | "ci" | "cl" | "cn" | "co" | "cr" | "cz" | "de" | "dk" | "ee" | "eg" | "es" | "fi" | "fr" | "gb" | "gl" | "gr" | "gt" | "hk" | "id" | "ie" | "il" | "in" | "iq" | "is" | "it" | "jp" | "ke" | "kr" | "kw" | "li" | "lt" | "lu" | "lv" | "ma" | "mg" | "ml" | "mo" | "mx" | "my" | "ni" | "nl" | "no" | "nz" | "pe" | "pl" | "pr" | "pt" | "ro" | "ru" | "rw" | "se" | "sg" | "sk" | "sr" | "sv" | "th" | "tn" | "tw" | "us" | "ve" | "vi" | "za"