ScaleRanges
esri/widgets/ScaleRangeSlider/ScaleRanges
The ScaleRanges class represents the ranges of scales for the the ScaleRangeSlider widget.
Property Overview
Name | Type | Summary | Class | |
---|---|---|---|---|
String | The name of the class. more details | more details | Accessor | |
The recommended scales at each of the named scale ranges. more details | more details | ScaleRanges |
Property Details
The name of the class. The declared class name is formatted as
esri.folder.className
.
- 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 | |
---|---|---|---|---|
Number | Clamps the scale to the closest minScale or maxScale on the scale range. more details | more details | ScaleRanges | |
Boolean | Determines whether the given scale is within the current scale range. more details | more details | ScaleRanges | |
NamedScaleRange | Finds the scale range name at a given index. more details | more details | ScaleRanges | |
ScaleRanges | Helper to create a ScaleRanges object from a minimum and maximum scale. more details | more details | ScaleRanges | |
Boolean | Determines if the input scale value can be considered to be at the smallest scale range edge. more details | more details | ScaleRanges | |
Boolean | Determines if the input scale value can be considered to be at the largest scale range edge. more details | more details | ScaleRanges |
Method Details
- 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.
Parameter:scale NumberThe scale value from the slider.
Returns:Type Description Number The scale number to which the slider will clamp.
- contains(scale){Boolean}
Determines whether the given scale is within the current scale range.
Parameter:scale NumberThe scale value.
Returns:Type Description Boolean If true
, the scale is contained within the range.
- findScaleRangeByIndex(index){NamedScaleRange}
Finds the scale range name at a given index.
Parameter:index NumberThe index of the scale.
Returns:Type Description NamedScaleRange The named scale range for the given index.
- fromScaleRange(minScale, maxScale){ScaleRanges}
Helper to create a ScaleRanges object from a minimum and maximum scale.
Parameters:minScale NumberThe minimum scale.
maxScale NumberThe maximum scale.
Returns:Type Description ScaleRanges The scale ranges.
- isMaxScaleEdge(scale){Boolean}
Determines if the input scale value can be considered to be at the smallest scale range edge.
Parameter:scaleThe scale value to test against the scale range.
Returns:Type Description Boolean If true
, the input scale value is considered to be at the smallest scale range.
- isMinScaleEdge(scale){Boolean}
Determines if the input scale value can be considered to be at the largest scale range edge.
Parameter:scaleThe scale value to test against the scale range.
Returns:Type Description Boolean If true
, the input scale value is considered to be at the largest scale range.