Image Overlay question

824
1
11-30-2011 01:49 PM
Labels (1)
JamesMcElroy
New Contributor
Hi,

We're adding image overlays to our map to display weather patterns.  We're using the images from Weather.gov which provides a set of images that show the pattern over a period of time (15-30 minutes).  So to simulate a "doppler radar" animation effect we're using a timer to switch out the images every second or two.  The issue I'm seeing is that when I remove an image from a layer and add a new image, the old image disappears and then new one takes almost a second to appear.  I have also tried adding the new image to the layer first and then removing the old image but the same behavior occurs.  This leads me to think that maybe the layers refresh on their own schedule in the runtime and incorporate all new changes?  Is there anyway to make the adding/removing of images to a layer smoother?  Below are the two methods I tried with the same behavioral result.

Method 1:
if (_weatherOverlaysLayer.Graphics.Count != 0)
   _weatherOverlaysLayer.Graphics.Clear();

_weatherOverlaysLayer.Graphics.Add(graphic);


Method 2:
_weatherOverlaysLayer.Graphics.Add(graphic);

if (_weatherOverlaysLayer.Graphics.Count > 1)
   _weatherOverlaysLayer.Graphics.RemoveAt(0);


Thanks,

James
0 Kudos
1 Reply
DavidLednik
Occasional Contributor II
Hi James,

How about you load each image into it's own graphics layer an you just show/hide them with timer.
Or even better, make the opacity change so you get smooth animation of cloud images 🙂

Regards,
David
0 Kudos