csdillardg2

Getting AGSDynamicMapServiceLayer to refresh programmatically

Discussion created by csdillardg2 on Dec 14, 2012
Latest reply on Dec 16, 2012 by njarecha-esristaff
I have an ArcGIS Server (10.1 SP1) REST map service whose underlying data (in ArcSDE) is changing constantly.  And I have an AGSDynamicMapServiceLayer that renders that map service in my app.  (It's running in iOS 6.)

I want to periodically (e.g. every 60 seconds) refresh the map to see the latest data.  However, I can't seem to do it without panning or zooming.

I've tried invoking dataChanged on the layer, i.e.:
AGSDynamicMapServiceLayer* layer = ...;
[layer dataChanged];

...but it has no effect.  I've tried invoking clear on the layer's view, i.e.:
AGSMapView* mapView = ...;
UIView<AGSLayerView>* layerView = [mapView.mapLayerViews objectForKey:layer.name];
[layerView clear];

...but that has no effect either (other than causing that layer to flash quickly, but reappear exactly as it was).

Is there some way to force a refresh from the server?

Is it perhaps a caching issue at the operating system level, since the URL of the exported image is the same?

Outcomes