Ok, I know a am pushing the limits here with 50,000 points, but what we would like almost works...These 50,000 points spread across different areas in California, but some points are pretty close together, within feet. So the initial extent of the map is zoomed out to roughly the California area, the AGS service is set to return up to 75,000 points, and the FeatureLayer is setup as this:
<esri:FeatureLayer ID="Well" Url="http://bkgis02/ArcGIS/rest/services/Global/Well-FeatureLayer/MapServer/0" Mode="OnDemand" OnDemandCacheSize="75000" OutFields="WELL_NME,WELL_API_NBR">
<esri:FeatureLayer.MapTip>
...
Since it is loading all these points initially, I figured I might as well cache them all... it takes about 10 seconds to load all the points and create the initial cluster (I give the user a progress bar). First question, is this a bad idea? I am ok with this one time initial wait...Once loaded, the cluster works good, as I zoom in and pan around it responds pretty quickly... But since some of these points are pretty close, when the extent gets pretty far in, I would like to drop the cluster. I have tried this in two ways:Option 1:
void Map_ExtentChanged(Object sender, ExtentEventArgs e)
{
FeatureLayer featureLayer = ((FeatureLayer)Map.Layers[7]);
if (Map.Resolution > 2)
{
if (featureLayer.Clusterer == null)
featureLayer.Clusterer = flareClusterer;
}
else
featureLayer.Clusterer = null;
}
Option 2:
void Map_ExtentChanged(object sender, ExtentEventArgs e)
{
if (Map.Resolution > 3)
Clusterer.Radius = ClusterRadius;
else
Clusterer.Radius = 1; //Radius 0 doesn't work
}
I like option 1 the best and it works really good except for one issue, which option 2 has this same issue too. Zooming in works great, panning works great, but zooming out causes the application to hang. I think the problem lies that when zooming out, the Map is now trying to render thousands of feature points, and it is doing this before the cluster has been set...Any ideas? Am I missing something simple here? A great feature enhancement would be to add a MinimumResolution to Clusters (I might add this in the beta community)...Also, I tried using ExtentChanging instead of ExtentChanged... and this does fix the above issue, but it is causing any panning and zooming to lag too much then... *EDIT* I tweaked the code a bit to make this more efficient, but still seems like overkillThanks a lot for any help!!!*EDIT* Also, Another issue... while the cluster refreshes real fast, and so do the ESRI imagery tiled layers, the maps progress bar seems to hang... and so does the refreshing of other ArcGISDynamicMapServiceLayers (mostly when zooming out)