Skip To ContentArcGIS for DevelopersSign In Dashboard
require(["esri/renderers/smartMapping/heuristics/sizeRange"], function(sizeRange) { /* code goes here */ });
Function: esri/renderers/smartMapping/heuristics/sizeRange
Since: ArcGIS API for JavaScript 4.12

Function for determining the suggested minSize and maxSize of a scale-dependent size visual variable.

Known Limitations

  • Only applicable to layers with polygon geometries.
  • This function is not intended for use in 3D SceneViews.

Method Overview

NameReturn TypeSummaryFunction
Promise<SizeRangeResult>

Generates a suggested size range (i.e.

more details
more detailssizeRange

Method Details

sizeRange(params){Promise<SizeRangeResult>}

Generates a suggested size range (i.e. the minSize and maxSize) of a scale-dependent size visual variable).

Known Limitations

  • Only applicable to layers with polygon geometries.
  • This function is not intended for use in 3D SceneViews.
Parameters:
Specification:
params Object

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

Specification:

The polygon layer for which to generate a suggested min/max size range based on scale for a size visual variable.

view MapView

The MapView where the layer will be rendered.

Returns:
TypeDescription
Promise<SizeRangeResult>Resolves to an object containing the suggested minSize and maxSize by scale for the layer's renderer.
Example:
sizeRange({
  layer: featureLayer,
  view: view
}).then(function(response){

  // update the minSize and maxSize of a size visual variable
  // on a layer's renderer to be scale-dependent
  const renderer = featureLayer.renderer.clone();
  const sizeVariable = renderer.visualVariables.filter( vv => vv.type === "size")[0].clone();
  sizeVariable.minSize = response.minSize;
  sizeVariable.maxSize = response.maxSize;

  renderer.visualVariables = [ sizeVariable ];
  featureLayer.renderer = renderer;
});

Type Definitions

SizeRangeResult

The suggested minSize and maxSize size stops generated from the sizeRange() function to apply to the scale-dependent size visual variable.

Properties:

The suggested sizes of the smallest icons at various scales in a layer with a size visualization.

The suggested sizes of the largest icons at various scales in a layer with a size visualization.

API Reference search results

NameTypeModule
Loading...