Open topic with navigation
The ClusterLayers Module works with a number of other modules to implement clustering. For information about configuring clustering for a layer, see Clustering.
Specifically, the ClusterLayers Module implements the
visualizationProvider for clustering and the commands and events that work with clusters. It also tracks the cluster layers that are enabled. A cluster layer is a graphics layers that sits on top of a feature layer that has clustering enabled. When the user turns on clustering or the viewer loads a layer that has clustering turned on, a cluster layer is created for that feature layer. The ClusterLayers Module uses the data from the feature layer to calculate the clusters and renders the cluster symbols on the cluster layer. When the user turns off clustering, the cluster layer is removed.
The ClusterLayers Module provides two commands and two events, which you can use in hyperlinks and workflows. The
AddClusterLayer command creates a cluster layer for the specified feature layer, calculates the clusters, and renders the cluster symbols.
ClusterLayerAddedEvent is raised when a cluster layer is added to the map. The
RemoveClusterLayer command removes the cluster layer for the specified feature layer.
ClusterLayerRemovedEvent is raised when a cluster layer is removed. At most, one visualization can be active at a time. For more information, see Viewer Commands and Events.
The ClusterLayers Module works with the Menu Module, Visualization Module, and Results Module. The Menu Module has a
LayerActions menu item, Turn on/off layer visualizations, that opens the Visualization Options panel, where the user can change visualizations and their settings. The Visualization Options panel is implemented by the Visualization Module. The Results Module has a
resultMappings item called
ClusterFeatures that lists the commands to run when the user clicks a cluster symbol.
The ClusterLayers Module has one view,
ClusterLayerView presents the clustering settings that end users can configure. By default,
ClusterLayerView is hosted in the
LayerVisualizationRegion container region, which is reference by the Visualization Module's
hideClusters: Choose to show or hide other clusters when a cluster is selected on the map. Configurable options include
none, which does not hide other clusters, or
unselected, which hides other clusters. The default value is