Is It Possible to Disable Caching in an AGSTiledLayer Subclass?

599
3
06-21-2012 04:09 PM
JamesRichards1
Occasional Contributor
Hi,

I have a subclass of AGSTiledLayer. When retrieveImageAsyncForTile is called, I create a subclass of AGSTiledLayerOperation and fire of a request to retrieve the tile from a remote URL (not ArcGIS Server because it needs to be cached on a CDN). This all works great.

But the remote tiles are regenerated every few minutes. The problem I have is that once the tiles are regenerated my AGSTiledLayer subclass never asks for the tiles it has already retrieved. Is there a way I can tell my subclass "Hey, don't cache these tiles, just ask me for them every time and I'll implement my own caching"

Thanks is advance,

James
0 Kudos
3 Replies
JamesRichards1
Occasional Contributor
BTW, the only workaround I've found so far it to reset the map and reload all the layers again every few minutes. Once the map is reloaded and my AGSTiledLayer subclass is added again it asks for all of the tiles again. Of course this has the side effect of filckering the map every time it reloads.

Note that simply removing the layer and adding another new instance of the layer back to the map does not have the same effect.
0 Kudos
JonDowney
New Contributor
Hey JRR,

Are you having any trouble with your custom Tiled Layer? I've implemented a layer and for some reason after an indeterminate amount of time my map just goes blank. I'm trying to figure out if I'm doing something wrong or if there is some sort of bug in the SDK. Any advice????

Jon
0 Kudos
NimeshJarecha
Esri Regular Contributor
James,

Before requesting a tile from a remote URL, could you please add following line of code?

//remove all url cache
[[NSURLCache sharedURLCache] removeAllCachedResponses];

Does this help?

Regards,
Nimesh
0 Kudos