AGSTiledLayer for cached and dynamic data

511
2
07-02-2013 12:16 PM
PatrickHartling
New Contributor III
I understand that instances of AGSTiledLayer are designed for cached imagery, but is it possible to use them for a combination of cached and dynamic data? For example, our application receives geographic sample data when communicating with a sampling source attached to a vehicle. The majority of the data is historical and gets pulled from a persistent store. That could be rendered as cached tiles. With the vehicle in motion and new samples coming in, there could be 1 to 4 tiles that contain new data to display at fairly regular intervals.

Having a way to refresh only those updated tiles is basically what we have been implementing in a subclass of AGSDynamicLayer. If we could leverage the built-in tiling afforded by AGSTiledLayer, our code may very well end up being a lot simpler and a lot faster. I will work on writing some code to test the possibility of using AGSTiledLayer instead of AGSDynamicLayer, but it would help to know if this is at all practical in the current architecture of the ArcGIS Runtime SDK for iOS.
0 Kudos
2 Replies
PatrickHartling
New Contributor III
I have made some progress on this effort, although the results thus far are not promising. The best way that I can think of to describe it is to say that the tile data produced by my AGSTiledLayer subclass flashes in and out. I had hoped that previously received tile data for a given key would remain visible until it was replaced by a later call to -setTileData:forKey: or the tile was no longer of interest. Instead, there is a very definite period of time where the tile data generated by my layer is removed from the map view.

Is it possible that I am misusing -setTileData:forKey:? For example, does it need to be invoked from a specific thread?
0 Kudos
PatrickHartling
New Contributor III
I tracked down the cause of the behavior that I described in the previous reply. I was sending -refresh to the AGSTiledLayer object as the data associated with the layer changed. For my use case, this happens about once per second, if not more frequently. Sending -refresh results in two things happening:


  1. The removal of the previously rendered tiles

  2. A fresh round of tile data requests

In between those two steps, there is a noticeable period in which nothing from my custom layer is being displayed.

I have not seen a way to tell the SDK that the tile for a specific tile key should be redrawn--only the whole layer. Is there any way to do that? Sending the AGSTiledLayer object -requestDataForKey: directly does not seem to do the trick. Given that AGSTiledLayer is meant for static, cached data, I can certainly see how that capability would not exist.
0 Kudos