I've been working with Silverlight FeatureLayer point clustering, which is a _really_ nice feature by the way. Here is the ESRI sample that I started with:
How can I show point clusters in my print/pdf export? I have modified the code to use a SimpleMarkerSymbol. That's working.
The problem is shown below. When I iterate on layer graphics, I get unclustered graphics. I want the clustered graphics.
foreach (GraphicsLayer gl in lyrs)
{
if (gl == null || gl.Graphics == null || gl.Graphics.Count == 0) continue;
Symbol symbol = null;
foreach (Graphic g in gl.Graphics)
{
Even though I see clusters on my map (drawn by FeatureLayer), gl.Graphics count shows that these are the unclustered graphics. (g.Symbol also confirms this. I don't get the cluster symbol, I get the orig renderer symbol).
a) Does anyone know how to make this work?
b) Will IRenderer.GetSymbol(graphic) return the clustered symbol? If so, how can I access the "cluster definition", that is which graphics are in which clusters? Does the renderer know anything about the clusterer?
c) are there FeatureLayer/GraphicLayer members that I could use?
d) ... about the only other idea I have is rather heavy-handed. I could always maintain the set of "last drawn" cluster graphics. That'd be possible by overriding this method of GrahpicsCluster (as demonstrated in the above sample).
protected override Graphic OnCreateGraphic(GraphicCollection cluster, MapPoint point, int maxClusterCount) {