Skip to content
import scaleRange from "@arcgis/core/smartMapping/heuristics/scaleRange.js";
Since
ArcGIS Maps SDK for JavaScript 4.12

Function for determining suggested min and max scale ranges for an input layer.

Known Limitations

Input SceneLayers must meet the following conditions:

  • SceneLayers without the supportsRenderer and supportsLayerQuery capabilities enabled, unless a predefined statistics object is passed to the statistics parameter of the method in conjunction with the layer. To check a SceneLayer's capabilities, use the SceneLayer.getFieldUsageInfo() method.

Functions

NameReturn TypeObject

scaleRange

Function

Generates a suggested scale range (i.e. FeatureLayer.minScale and FeatureLayer.maxScale) to apply to the input layer. These values suggest the best scale range for viewing the input layer.

Signature
scaleRange (parameters: ScaleRangeParameters): Promise<ScaleRangeResult>
Parameters
ParameterTypeDescriptionRequired
parameters

The function parameters.

Returns
Promise<ScaleRangeResult>

Resolves to an object containing the suggested min and max scale for the layer.

Example
scaleRange({
layer: featureLayer,
view: view
}).then(function(response){
// apply the suggested scale range to the input layer
featureLayer.minScale = response.minScale;
featureLayer.maxScale = response.maxScale;
view.map.add(featureLayer);
});