Clustering, time-aware,  queries

664
5
11-16-2010 08:53 AM
DeminHu
New Contributor
Hi,

I am working on two issures, any help will be appreciated.

#1. Clustering on the map does not change when value changes on timeslider
#2. When  query a feature layers, if the returned records is 0, the clustering not change, still display on the map.

Thanks again.
0 Kudos
5 Replies
DarinaTchountcheva
Occasional Contributor II
Hi Demin,

I have encountered the same behavior of time-aware GraphicsLayer.

1. Clusters don't change when the value of the time slider changes:

To resolve this problem, I am manually removing/adding the graphics from/to the GraphicsLayer that are not within the Curent Slider Value TimeExtent. To accomplish this I am performing a loop during the ValueChanged event handler of the TimeSlider. Be aware, the OldValue and NewValue of the TimeSlider.ValueChangedEventArgs are reversed. Kind of cumbursome, but it works.
There is the option to use LINQ to SQL to filter the Graphics by the TimeExtent, and assign the result to the Graphics of the GraphicsLayer, but I didn't like the jumping of the graphics on the screen when the new GraphicCollection is assigned. It defeats the purpose of using a time slider to smoothly remove/add graphics.

2. When the count of the graphics is 0, the clusters don't clear:

Same behavior on the GraphicsLayer, and I found out that graphicsLayer.Refresh() fixes the problem. So, you might try to call Refresh during the featureLayer_UpdateCompleted if the count of the graphics is 0.

If you decide to go the way of manually removing/adding graphics, let me know, and I will post the code.

Hope, this will be resolved soon.

Good Luck!
0 Kudos
DeminHu
New Contributor
Darina

Thank you so much.

#1,  I did the same thing as you suggested, it wroked as you described, but I do hope there is a more smoothly way.
#2, I tried us refresh(), it didn't work for me, so I just set the cluster to null, when the result records is 0, if it is not 0, I reset the cluster to the one I declared in the code. so I moved the flarecluster from .xaml to the code.

If you could kindly post your code here, certainly will help  many people they may need.

Thanks again !!
0 Kudos
JenniferNery
Esri Regular Contributor
Thank you for reporting this. We will try to get this fixed in future releases.
0 Kudos
DeminHu
New Contributor
Darina

Sorry, Refresh()  worked for me too.

Thanks.
0 Kudos
LuisCÃ_spedes
New Contributor
Just want to thank too!
0 Kudos