Skip to content

Scale Range Slider

ESM:
Use dark colors for code blocksCopy
1
import "@arcgis/map-components/components/arcgis-scale-range-slider";
CDN:
No specific import is needed for this component.
Since:ArcGIS Maps SDK for JavaScript 4.28

The Scale Range Slider component allows the user to set a minimum and maximum scale based on named scale ranges.

Demo

Properties

PropertyAttributeType
autoDestroyDisabledauto-destroy-disabledboolean
disabled
reflected
disabledboolean
hidePreviewhide-previewboolean
hideScaleMenusMaxScaleMenuhide-scale-menus-max-scale-menuboolean
hideScaleMenusMinScaleMenuhide-scale-menus-min-scale-menuboolean
iconiconstring
labellabelstring
layerLayer | Sublayer
maxScalemax-scalenumber
maxScaleLimitmax-scale-limitnumber
minScalemin-scalenumber
minScaleLimitmin-scale-limitnumber
modemode"max-scale-only" | "min-scale-only" | "range"
position
deprecated
position"bottom-leading" | "bottom-left" | "bottom-right" | "bottom-trailing" | "manual" | "top-leading" | "top-left" | "top-right" | "top-trailing"
referenceElementreference-elementHTMLArcgisLinkChartElement | HTMLArcgisMapElement | HTMLArcgisSceneElement | string
regionSupportedRegion
showWorldValueshow-world-valueboolean
state
readonlyreflected
state"disabled" | "ready"
viewMapView | SceneView

autoDestroyDisabled

Property
autoDestroyDisabled: 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

disabled

reflected
Property
disabled: boolean

When true, sets the widget to a disabled state so the user cannot interact with it.

Attribute
disabled
Default value
false

hidePreview

Property
hidePreview: boolean
Attribute
hide-preview
Default value
false

hideScaleMenusMaxScaleMenu

Property
hideScaleMenusMaxScaleMenu: boolean
Attribute
hide-scale-menus-max-scale-menu
Default value
false

hideScaleMenusMinScaleMenu

Property
hideScaleMenusMinScaleMenu: boolean
Attribute
hide-scale-menus-min-scale-menu
Default value
false

icon

Property
icon: string

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
label: string

The widget's default label.

Read more...

Attribute
label

layer

Property
layer: Layer | Sublayer

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

Read more...

maxScale

Property
maxScale: number

The maximum scale of the active scale range.

Read more...

Attribute
max-scale

maxScaleLimit

Property
maxScaleLimit: number

The lowest possible maximum scale value on the slider.

Read more...

Attribute
max-scale-limit

minScale

Property
minScale: number

The minimum scale of the active scale range.

Read more...

Attribute
min-scale

minScaleLimit

Property
minScaleLimit: number

The highest possible minimum scale value on the slider.

Read more...

Attribute
min-scale-limit

mode

Property
mode: "max-scale-only" | "min-scale-only" | "range"

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

Attribute
mode
Default value
"range"

position

deprecatedProperty
position: "bottom-leading" | "bottom-left" | "bottom-right" | "bottom-trailing" | "manual" | "top-leading" | "top-left" | "top-right" | "top-trailing"
Deprecatedsince 4.34, use slot instead.
Attribute
position

referenceElement

Property

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

The region that the scale thumbnails will focus on.

Default value
"US"

showWorldValue

Property
showWorldValue: boolean
Since:ArcGIS Maps SDK for JavaScript 4.34Scale Range Slider since 4.28, showWorldValue added at 4.34.

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

Attribute
show-world-value
Default value
false

state

readonlyreflected
Property
state: "disabled" | "ready"

The current state of the component.

Attribute
state
Default value
"disabled"

view

Property

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 Scale Range Slider component will be associated with a map or scene component rather than using the view property.

Methods

MethodSignature
componentOnReadycomponentOnReady(): Promise<void>
destroydestroy(): Promise<void>

componentOnReady

Method
componentOnReady(): Promise<void>

Create a promise that resolves once component is fully loaded.

Example
Use dark colors for code blocksCopy
1
2
3
4
const arcgisScaleRangeSlider = document.querySelector("arcgis-scale-range-slider");
document.body.append(arcgisScaleRangeSlider);
await arcgisScaleRangeSlider.componentOnReady();
console.log("arcgis-scale-range-slider is ready to go!");
Returns
Promise<void>

destroy

Method
destroy(): Promise<void>

Permanently destroy the component.

Returns
Promise<void>

Events

EventType
arcgisPropertyChangeCustomEvent<{ name: "state" | "maxScale" | "minScale"; }>
arcgisReadyCustomEvent<void>

arcgisPropertyChange

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

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 to be interacted with.

bubbles
composed
cancelable

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.