Refresh dynamic map Layer

3978
4
11-22-2013 01:53 PM
Labels (1)
Jose_LuisDiez_Chueca
New Contributor
I'm trying to refresh a map view loaded in a WPF application, based on a timer. (ArcGIS API for WPF).

I am using a dynamic map service that contains a point layer that changes frequently. I refresh the dynamic layer every 30 seconds using the Layer.Refresh() on the timer's interval, but , the problem I am having is that each time I refresh the map, it blinks.

How I can to prevent this flicker effect?

Thanks
0 Kudos
4 Replies
DavidLednik
Occasional Contributor II
Hi,

How many points are we talking about?
I would suggest creating an observable collection of graphics bound to graphicslayer and every 30 second you could update that collection. This should remove the blinking as long as you don't clear the collection but iterate through it and modify/add/remove the points that need to be modified.

Regards,
David
0 Kudos
Jose_LuisDiez_Chueca
New Contributor
David, thanks a lot for replying.

I have ten layers. Some layer has 50 points and 700 points other layers. The point layer uses cluster symbology, so that all points are not shown. Also, for managing layer I use the layer list.

I hope to use the collection of graphics that suggest,  it do not prevent the continued use of these features as cluster symbology, Maptips, and layer list. What do you think about this?

This points are using the icon symbol that is in the dynamic map service. It can recover the symbols to draw it on the graphic-layers?

Thanks in advance.
0 Kudos
DavidLednik
Occasional Contributor II
I would suggest a peek at moving graphics sample: http://resources.arcgis.com/en/help/runtime-wpf/samples/index.html#/Moving_Objects/02q2000000mm00000...

Observable collection just holds the geometry for the graphicslayer. How you decide to present that information is up to you. And you just set the preferred renderer you wan't to use.

One quick note would be to modify the OC class so that you can use it on all your layers (as long as all are points).
So that you create new OC class for each layer that holds your common functionality for add/remove/modify graphics.

If you get stuck with anything or you have any question let me know 🙂

Regards,
David
0 Kudos
Jose_LuisDiez_Chueca
New Contributor
Thank David for your help. I will try to make changes in the code.

Regards
0 Kudos