Types
import type { FeatureReductionLayer } from "@arcgis/core/layers/mixins/FeatureReductionLayer.js";- Subclasses:
- CSVLayer, FeatureLayer, GeoJSONLayer, OGCFeatureLayer, ParquetLayer, StreamLayer, WFSLayer, KnowledgeGraphSublayer
- Since
- ArcGIS Maps SDK for JavaScript 4.25
Mixin for layers that support featureReduction.
Properties
| Property | Type | Class |
|---|---|---|
| |
featureReduction
autocast
Property
- Type
- FeatureReductionUnion | null | undefined
Configures the method for reducing the number of features in the view.
By default this property is null, which indicates the layer view should draw every feature.
There are three types of feature reduction: selection, cluster, and binning.
- Selection only applies to points in a SceneView and involves thinning overlapping features so no features intersect on screen. This has been available since version 4.4.
- Cluster groups points, lines, or polygons in a MapView into clusters defined in screen space. Each cluster is a point geometry whose size is proportional to the number of features within the cluster. This has been available since version 4.14.
- Binning spatially groups points, lines, or polygons in a MapView into bins, clearly defining the area aggregating features in map space. Each bin is a polygon geometry typically rendered so its color represents the number of features within the bin. This has been available since version 4.24.
Examples
// clusters features based on their spatial proximity to other featureslayer.featureReduction = { type: "cluster", clusterRadius: 100};// thins features in the viewlayer.featureReduction = { type: "selection"};// Aggregates features to binslayer.featureReduction = { type: "binning", renderer: { type: "simple", // autocasts as new SimpleRenderer() symbol: { type: "simple-fill", // autocasts as new SimpleFillSymbol() outline: { // autocasts as new SimpleLineSymbol() width: 0.5, color: "white" } }, visualVariables: [{ type: "color", field: "aggregateCount", stops: [ { value: 1, color: "white" }, { value: 1000, color: "blue" } ] }] }, popupTemplate: { content: "This bin contains <b>{aggregateCount}</b> features.", fieldInfos: [{ fieldName: "aggregateCount", format: { digitSeparator: true, places: 0 } }] }};