Skip To ContentArcGIS for DevelopersSign In Dashboard
require(["esri/smartMapping/heuristics/scaleRange"], function(scaleRange) { /* code goes here */ });
Function: esri/smartMapping/heuristics/scaleRange
Since: ArcGIS API 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 getFieldInfoUsage() method.

Moved from esri/renderers/smartMapping/... at 4.16.

Method Overview

NameReturn TypeSummaryFunction

Generates a suggested scale range (i.e.

more details
more detailsscaleRange

Method Details


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

params Object

See the table below for details about parameters that may be passed to this function.


The layer for which to generate a suggested min/max scale range.

view View

The SceneView or MapView where the layer will be rendered.

sampleSize Number
Default Value: 500

The number of features in the layer to sample for spatial statistics. A higher sample size will yield more precise results. However, higher sample sizes also require more time for the function to process the result.


Allows for cancelable requests. If canceled, the promise will be rejected with an error named AbortError. See also AbortController.

Promise<ScaleRangeResult>Resolves to an object containing the suggested min and max scale for the layer.
  layer: featureLayer,
  view: view
  // apply the suggested scale range to the input layer
  featureLayer.minScale = response.minScale;
  featureLayer.maxScale = response.maxScale;;

Type Definitions


Suggested min and max scales to apply to the input layer for the scaleRange() function.

minScale Number

The suggested minScale to apply to the input layer.

maxScale Number

The suggested maxScale to apply to the input layer.

API Reference search results