Select to view content in your preferred language

refresh query layer

2730
1
05-18-2012 07:24 AM
ChrisBradberry
Deactivated User
Hey,

I have a dynamic map service layer that shows lightning data.  The source data is from a point query layer from a SQL database that is updated every 3 minutes.  The problem is that I cannot seem to get the map service layer to refresh when the SQL data is updated.  I have disabled the client caching,  and have a timer set up to refresh the layer every 3 minutes.  The only way that I can get the lightning to update is to pan or change the extent.

I have a break on the timer and it fires as expected.
 void lightningTimer_Tick(object sender, EventArgs e)
        {
            try
            {
                ArcGISDynamicMapServiceLayer lightningLayer = Map.Layers["Lightning 24 Hours"] as ArcGISDynamicMapServiceLayer;
                lightningLayer.Refresh();        
            }
            catch 
            {           
                //do nothing if the system can't read the lightning data layer.
            }
        }


Am I missing something?

Thanks, Chris
0 Kudos
1 Reply
JenniferNery
Esri Regular Contributor
I could not reproduce with the following SDK sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#DynamicMap.

I updated ArcGISDynamicMapServiceLayer.DisableClientCaching to True and added a button that will call layer.Refresh. I check on Fiddler that after layer.Refresh() a new export request is made.
0 Kudos