Hi,
We're using the Silverlight api 2.1 (SL4). We're trying to figure out how to detect and then recover from problems where an ArcGISTiledMapServiceLayer has trouble talking to its REST web service. We're seeing problems with two distinct but related scenarios:
1) layer working correctly, talking to service and showing imagery; if you then disable the network adapter, then zoom in or out: layer just becomes blank, and we get no notification of errors (layer.InitializationFailed is not called in this case.) Is there any way to programatically detect this case, and then recover from it?
2) If, after case #1, we change the URL of the layer (say, because the user wants to see a street map instead of imagery, or maybe because they are confused by the now blank layer), the layer.InitializationFailed then fires if the network link is still down, and so we can now show the user a msg. After that, once the network is restored, how do we recover (that is, get the layer updating/showing tiles again)? We've tried calling layer.Initialize() as well as layer.Refresh(), and neither seemed to do anything. We tried setting the URL to the same URL as it was, and that does nothing. We then tried changing the URL from one valid address (say, for imagery) to another (say, for street maps) and then back again to the original. This seems to do something, but not to succeed either; instead, layer.InitializationFailed fires again. After a few times retrying this recovery method, we get a NullReferenceException in the layer and that's the end of things.
It is reasonable to expect that the connection between a tile layer and its service will become unavailable sometimes, so there seems there would be a straightforward way to detect when problems start occuring (so we can report them) and a way to cleanly recover from the problems once the connection becomes available again. What is the recommended way to do this?
Thanks!