This page describes an older version, please see latest API at http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/clusterers/WeightedClusterer.html.
Packagecom.esri.ags.clusterers
Classpublic class WeightedClusterer
InheritanceWeightedClusterer Inheritance ESRIClusterer Inheritance BaseClusterer Inheritance flash.events.EventDispatcher

Since : ArcGIS API for Flex 2.0

Clusters a set of graphics based on an adaptive weighted pruning algorithm. The algorithm first converts each visible graphic to a cluster where the cluster centroid is derived using the graphicToMapPointFunction function. Each cluster is placed in a cell in a trellis where the cell width and height is based on the sizeInPixels property. The trellis is used as a spatial index. Each populated cell in the trellis searches its immediate neighbors and merges the neighbors graphic into it. This merging process adjusts the cluster center based on its weight and its neighbor's weight. The process of search and merge repeats until no overlaping clusters exist.

See also

com.esri.ags.clusterers.supportClasses.FlareSymbol
Live sample - Clustering


Public Properties
 PropertyDefined By
  center : MapPoint
The clustering algorithm trellis center.
WeightedClusterer
 InheritedclusterWeightFunction : Function
Reference to a function to calculate the weight of a cluster.
ESRIClusterer
 InheritedextentExpandFactor : Number
How much to expand the map extent to find all enclosing graphics.
ESRIClusterer
 InheritedgraphicToMapPointFunction : Function
Reference to a function to convert a graphic geometry to a MapPoint instance.
ESRIClusterer
  graphicWeightFunction : Function
Reference to a function to calculate the weight of a graphic.
WeightedClusterer
 InheritedminGraphicCount : int
The minimum number of graphic to display in a cluster, before rendering the cluster using the clusterer symbol.
ESRIClusterer
 InheritedoverallMaxCount : int
The overall maximum number of graphics in a computed cluster.
ESRIClusterer
 InheritedoverallMaxWeight : Number
The overall maximum weight of a computed cluster.
ESRIClusterer
 InheritedoverallMinCount : int
The overall minimum number of graphics in a computed cluster.
ESRIClusterer
 InheritedoverallMinWeight : Number
The overall mininum weight of a computed cluster.
ESRIClusterer
 InheritedsizeInPixels : Number
The cluster size in pixels.
ESRIClusterer
 Inheritedsymbol : Symbol
Default symbol for the clustered graphics.
ESRIClusterer
Public Methods
 MethodDefined By
  
Creates a new WeightedClusterer instance.
WeightedClusterer
 Inherited
clusterGraphics(graphicsLayer:GraphicsLayer, graphicCollection:ArrayCollection):Array
This function _has_ to be implemented by subclasses.
BaseClusterer
 Inherited
destroy(graphicsLayer:GraphicsLayer):void
Empty implementation of interface that can be overridden by subclasses.
BaseClusterer
 Inherited
initialize(graphicsLayer:GraphicsLayer):void
Empty implementation of interface that can be overridden by subclasses.
BaseClusterer
Protected Methods
 MethodDefined By
 Inherited
createClusterGraphic(cluster:Cluster, arr:Array):void
Create a ClusterGraphic instance given a Cluster instance.
ESRIClusterer
 Inherited
dispatchEventChange(type:String = null):void
Helper function to dispatch an event.
BaseClusterer
Property Detail
centerproperty
center:MapPoint

The clustering algorithm trellis center. The trellis cells are computed relative to that location. If this property is not defined, then, first time through, it will be set to the map extent center.

This property can be used as the source for data binding.


Implementation
    public function get center():MapPoint
    public function set center(value:MapPoint):void
graphicWeightFunctionproperty 
graphicWeightFunction:Function

Reference to a function to calculate the weight of a graphic. When this function is invoked, a graphic reference is passed as an argument and a Number is expected to be returned. public function myGraphicWeight(graphic:Graphics):Number { return graphic.attributes.weight; } By default, each graphic has a weight of 1.0;

This property can be used as the source for data binding.


Implementation
    public function get graphicWeightFunction():Function
    public function set graphicWeightFunction(value:Function):void
Constructor Detail
WeightedClusterer()Constructor
public function WeightedClusterer()

Creates a new WeightedClusterer instance.