Select to view content in your preferred language

Pan/Zoom Event

4943
11
04-09-2010 10:17 AM
JustinWilliams
Emerging Contributor
Just curious, if anyone has run into this before...

I have a National Weather Service radar layer which is being auto-refreshed at a specific interval. There seems to be an issue with the layer's refresh not overriding a cached image from the current zoom/extent. I have tried everything possible to remedy this, including rewriting my refresh method to construct an entire new layer and add it to the map.

So... I am curious. What event is firing when I zoom/pan, as this is the only action which will draw the latest data.

Any help would be appreciated!

Thanks,

Justin
GIS Analyst
Indiana Department of Homeland Security
Tags (2)
0 Kudos
11 Replies
CoreySchafer
Deactivated User
Has anyone found a solution to this? I am having the same problem. I have even added in the map.Pan functions without any success. I have set my disableClientCaching = true and then refresh the layer with no luck:

private function refreshLayers():void
   {
                                var pd:Number = map.panDuration;
    map.panDuration = 15;
    var layers:Array = getLayers();
    for each(var layer:Object in layers)
    {
     var dLayer:ArcGISDynamicMapServiceLayer = layer as ArcGISDynamicMapServiceLayer;
     dLayer.disableClientCaching = true;
   
     map.panDown();
     dLayer.refresh();
     map.panUp();
     }
    } 
    map.panDuration = pd;
}


I can run this function as much as I want with updating to the weather. The weather only updates when I Pan or Zoom the map. I can see in FireBug that the refresh function is sending some requests (I'm assuming two because of the two pan functions I am calling), but I'm not sure why the map is not updating. Picture 1 is a non-updated Map. Picture 2 is what I get in Firebug when I call the refresh function above. Picture 3 is What I get in Firebug when I very slightly Pan the map, and Picture 4 is the updated Weather I get after the Pan.

I would like to have a function that updates this weather for me and as of now am stumped as to why this isn't working. Any help will be appreciated...
0 Kudos
CoreySchafer
Deactivated User
After a little more investigation, it seem that images are getting cached for specific extents. For example, when I first load my map, I am getting the same image every time because my map loads the same initial extent every time. If I use the buttons in the Navigatoion to pan left and right, I will get images that I have previously seen as well as long as I have panned there before.

I only get the newest weather maps when I either pan somewhere I have not previously panned or if I move the map around with my cursor (even slightly will send a different extent and therefore causes the map to update). So it definitely seems like a caching issue. Just not sure why it is still doing it...
0 Kudos