require(["esri/widgets/ScaleRangeSlider/ScaleRanges"], (ScaleRanges) => { /* code goes here */ });
import ScaleRanges from "@arcgis/core/widgets/ScaleRangeSlider/ScaleRanges.js";
esri/widgets/ScaleRangeSlider/ScaleRanges
The ScaleRanges class represents the ranges of scales for the ScaleRangeSlider widget.
Property Overview
Name | Type | Summary | Class |
---|---|---|---|
The recommended scales at each of the named scale ranges. | ScaleRanges | ||
The name of the class. | Accessor |
Property Details
-
RecommendedScales
RecommendedScales Objectstatic,constant
-
The recommended scales at each of the named scale ranges.
- Properties
-
world Numbercontinent NumberDefault Value:50000000countriesBig NumberDefault Value:25000000countriesSmall NumberDefault Value:12000000statesProvinces NumberDefault Value:6000000stateProvince NumberDefault Value:3000000counties NumberDefault Value:1500000county NumberDefault Value:750000metropolitanArea NumberDefault Value:320000cities NumberDefault Value:160000city NumberDefault Value:80000town NumberDefault Value:40000neighborhood NumberDefault Value:20000streets NumberDefault Value:10000street NumberDefault Value:5000buildings NumberDefault Value:2500building NumberDefault Value:1250smallBuilding NumberDefault Value:800rooms NumberDefault Value:400room NumberDefault Value:100
Method Overview
Name | Return Type | Summary | Class |
---|---|---|---|
Adds one or more handles which are to be tied to the lifecycle of the object. | Accessor | ||
Clamps the scale to the closest minScale or maxScale on the scale range. | ScaleRanges | ||
Determines whether the given scale is within the current scale range. | ScaleRanges | ||
Finds the scale range name at a given index. | ScaleRanges | ||
Helper to create a ScaleRanges object from a minimum and maximum scale. | ScaleRanges | ||
Returns true if a named group of handles exist. | Accessor | ||
Determines if the input scale value can be considered to be at the smallest scale range edge. | ScaleRanges | ||
Determines if the input scale value can be considered to be at the largest scale range edge. | ScaleRanges | ||
Removes a group of handles owned by the object. | Accessor |
Method Details
-
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25Accessor since 4.0, addHandles added at 4.25. -
Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.
// Manually manage handles const handle = reactiveUtils.when( () => !view.updating, () => { wkidSelect.disabled = false; }, { once: true } ); this.addHandles(handle); // Destroy the object this.destroy();
ParametershandleOrHandles WatchHandle|WatchHandle[]Handles marked for removal once the object is destroyed.
groupKey *optionalKey identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.
-
clampScale
clampScale(scale){Number}
-
Clamps the scale to the closest minScale or maxScale on the scale range. If the provided scale goes beyond the allowed range, it snaps back to the clamped value.
Parameterscale NumberThe scale value from the slider.
ReturnsType Description Number The scale number to which the slider will clamp.
-
findScaleRangeByIndex
findScaleRangeByIndex(index){NamedScaleRange}
-
Finds the scale range name at a given index.
Parameterindex NumberThe index of the scale.
ReturnsType Description NamedScaleRange The named scale range for the given index.
-
fromScaleRange
fromScaleRange(minScale, maxScale){ScaleRanges}
-
Helper to create a ScaleRanges object from a minimum and maximum scale.
ReturnsType Description ScaleRanges The scale ranges.
-
hasHandles
InheritedMethodhasHandles(groupKey){Boolean}
Inherited from AccessorSince: ArcGIS Maps SDK for JavaScript 4.25Accessor since 4.0, hasHandles added at 4.25. -
Returns true if a named group of handles exist.
ParametergroupKey *optionalA group key.
ReturnsType Description Boolean Returns true
if a named group of handles exist.Example// Remove a named group of handles if they exist. if (obj.hasHandles("watch-view-updates")) { obj.removeHandles("watch-view-updates"); }
-
isMaxScaleEdge
isMaxScaleEdge(scale){Boolean}
-
Determines if the input scale value can be considered to be at the smallest scale range edge.
ParameterscaleThe scale value to test against the scale range.
ReturnsType Description Boolean If true
, the input scale value is considered to be at the smallest scale range.
-
isMinScaleEdge
isMinScaleEdge(scale){Boolean}
-
Determines if the input scale value can be considered to be at the largest scale range edge.
ParameterscaleThe scale value to test against the scale range.
ReturnsType Description Boolean If true
, the input scale value is considered to be at the largest scale range.
-
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25Accessor since 4.0, removeHandles added at 4.25. -
Removes a group of handles owned by the object.
ParametergroupKey *optionalA group key or an array or collection of group keys to remove.
Exampleobj.removeHandles(); // removes handles from default group obj.removeHandles("handle-group"); obj.removeHandles("other-handle-group");