Clustering using Flex API

1031
5
04-13-2010 04:47 AM
MuzammilAK
New Contributor
Dear All,,


Do we have featurelayer Clusterer similar to what we have in Silverlight API for doing clustering?

Thank you.

Regards
Muzammil
Tags (2)
0 Kudos
5 Replies
PrashanthSukumaran
New Contributor II
It is available in ArcGIS API for Flex 2.0 Beta.  Couple of clustering type i saw at the developer conference was Grid Clustering and Simple Clustering by proximity.  I think there are some more.  Clustering is as simple as specifying cluster attribute in the graphics layer/feature layer.

But if you are using 1.3 version then you have to write your own clustering.  Sample ideas are provided by Mansour Raad on this Thunderhead Explorer site.
 
Thanks
Prashanth Sukumaran
0 Kudos
JasonHight
New Contributor
Curious if anyone knows the difference in coding.  The ESRI sample appears to have a where statement - something like where population is > 50,000.  I am only interested in clustering for proximity - to clean up a map with MANY points on it.

I guess it would also depend on the zoom level?

Thanks in advance...
0 Kudos
deleted-user-rQoEFM5qzbHE
New Contributor II
Did you have any luck figuring this out? We are trying to do the same thing, cluster by proximity.
0 Kudos
AlexJones
New Contributor II
You can use the weighted cluster sample without the where statement. The sample uses snapshot mode and a definition query. Just take the definition query line out and the mode line out(This will default to onDemand mode) When using on demand you don't need the definition query.
You can also play around with the Weighted cluster itself for example, the sizeInPixels property:

<esri:WeightedClusterer id="clusterer" symbol="{flareSymbol}" sizeInPixels="20" />


<esri:FeatureLayer id="featureLayer"
         clusterer="{clusterer}"
         graphicAdd="featureLayer_graphicAddHandler(event)"
         outFields="*"
         symbol="{defaultsym}"


From the help:

sizeInPixels property 
sizeInPixels:Number

The cluster size in pixels.

The default value is 70 pixels.

//More from the help.
The onDemand mode - MODE_ON_DEMAND - features are fetched from the server as they are needed.

The snapshot mode - MODE_SNAPSHOT - features are fetched from the server based on DefinitionExpression and/or TimeDefinition. When either definition change, the layer updates itself by querying features back from the server. Once the features are fetched to the client, their "visibility" on the map is based on the time and spatial extents of the map. So for example, for a time animation, you can request all features from server, then adjust time extent on Map to only show some of them.

The selection mode - MODE_SELECTION - only selected features are available on the client side. Usually used in combination with an underlying map service showing the features that can be selected.

The default value is MODE_ON_DEMAND.

Does that help at all?
0 Kudos
CarmenDurham
Occasional Contributor II
I am not sure if it helped Jeremy, but your reply sure helped me!

Thanks,
0 Kudos