Clustering Feature Reduction
Method for aggregating and summarizing features in a point FeatureLayer or point graphics in a GraphicsOverlay in dynamic rendering mode (FeatureRenderingMode.Dynamic, or GraphicsRenderingMode.Dynamic). Clustering is configured via the FeatureLayer.featureReduction property of the FeatureLayer or the GraphicsOverlay.featureReduction of the GraphicsOverlay.
Feature clustering allows you to visually represent large numbers of point geoelements in relatively small areas by aggregating them into clusters. Each cluster of two or more points is represented with an AggregateGeoElement that has its own symbol. If a point feature is not clustered, it continues to draw as an individual feature using the layer's renderer. As a user navigates the map, clusters update dynamically depending on the map's scale and extent. Feature clustering only applies to layers with point geometries in a 2D map. It does not apply to layers with polyline and polygon geometries and is not supported in 3D. In such unsupported scenarios, the original features or graphics are drawn. In case of FeatureLayer, a LayerViewState is bubbled up indicating the appropriate error. The symbol for the cluster is determined by the renderer passed to ClusteringFeatureReduction and cluster symbol size is determined by the ClusteringFeatureReduction.minSymbolSize and ClusteringFeatureReduction.maxSymbolSize properties. At present, this API does not support configuring cluster symbol size from another AggregateField.
Since
200.2.0
Constructors
Creates a ClusteringFeatureReduction object using the given renderer and default values for min size, max size and radius of the cluster. Only SimpleRenderer, UniqueValueRenderer, and ClassBreaksRenderer are currently supported for AggregationFeatureReduction.renderer. UniqueValueRenderer with multiple fields is not supported. If the renderer passed is not one of the supported renderer types listed above, then original features from the FeatureLayer or original graphics from the GraphicsOverlay are drawn using FeatureLayer.renderer or GraphicsOverlay.renderer respectively. In case of FeatureLayer, a LayerViewState that contains an error indicating the use of an unsupported renderer is bubbled up. Also note, AggregationFeatureReduction.renderer is independent of FeatureLayer.renderer and GraphicsOverlay.renderer.
Properties
The symbol size of the largest cluster in device-independent pixels. The default value is 70. The ClusteringFeatureReduction.maxSymbolSize and ClusteringFeatureReduction.radius complement each other. If you adjust one, you should adjust the other (a larger ClusteringFeatureReduction.maxSymbolSize should have a larger ClusteringFeatureReduction.radius). Note, if a custom renderer is defined for clusters and that renderer contains size visual variables, this property is ignored and cluster sizes are determined using the cluster renderer's size variable. Note: Changing this property causes data to be re-clustered.
The symbol size of the smallest cluster in device-independent pixels. The default value is 12. If a custom renderer is defined for the clusters, and that renderer contains size visual variables, this property is ignored and cluster sizes are determined using the cluster renderer's size variable. Note: changing this property causes data to be re-clustered.
The radius in device-independent pixels of the area in which multiple points will be grouped and visualized as a single cluster. The default value is 60. If you don't want cluster graphics to overlap, the ClusteringFeatureReduction.radius should be larger than the ClusteringFeatureReduction.maxSymbolSize. Note: changing this property causes data to be re-clustered.
Inherited properties
An array of AggregateField that summarizes one or more attributes for a group of geoelements visualized with FeatureReduction. AggregationFeatureReduction.aggregateFields define the attributes of an AggregateGeoElement. Each AggregateField stores a value that is generated by aggregating values from a field referenced in the feature layer. These aggregate fields may be used in popups, labels, and renderers. Note that aggregated geoelements only have access to the AggregationFeatureReduction.aggregateFields defined. The fields from the feature layer are not accessible for use in popups, labels, or renderers for aggregated geoelements. For example, to display the sum of the population values in a cluster of features, you can create an aggregate field called 'sum_population' using the 'population' attribute of the FeatureLayer. You can then use the 'sum_population' attribute as a label for the AggregateGeoElement, but not the original 'population' attribute from the feature layer. See AggregateField for more info. Note: Updates to this collection cause data to be re-aggregated.
A flag indicating whether the PopupDefinition defined on the PopupSource is enable / disable. Will return false if an error occurs.
The collection of LabelDefinition objects that define label display for the summarized attribute values of aggregated geoelements. Label expressions can only refer to the fields defined in AggregationFeatureReduction.aggregateFields. Feature layer fields are not accessible to aggregated geoelements. AggregationFeatureReduction.labelDefinitions is independent of FeatureLayer.labelDefinitions and GraphicsOverlay.labelDefinitions. Labels on aggregated geoelements will only appear if there is at least one LabelDefinition defined.
The pop-up definition. The PopupDefinition associated with the popup source. A null if an error occurs or if the popup source is not associated with a pop-up definition.
Defines the symbology for displaying aggregated geoelements. Only SimpleRenderer, UniqueValueRenderer, and ClassBreaksRenderer are currently supported for AggregationFeatureReduction.renderer. UniqueValueRenderer with multiple fields is not supported. If the renderer passed is not one of the supported renderer types listed above then original features from the FeatureLayer or original graphics from the GraphicsOverlay are drawn using FeatureLayer.renderer or GraphicsOverlay.renderer respectively. In the case of FeatureLayer, a LayerViewState that contains an error indicating the use of an unsupported renderer is bubbled up. Also, note that AggregationFeatureReduction.renderer is independent of FeatureLayer.renderer and GraphicsOverlay.renderer.
True to display labels for aggregated geoelements, false to turn them off. The default value is true.