I have set
yourLayerOverlay.DrawingExceptionMode = DrawingExceptionMode.ThrowException;
per recommendations in one of the threads.
Where is the exception thrown? How can I catch it and examine it?
I have set
yourLayerOverlay.DrawingExceptionMode = DrawingExceptionMode.ThrowException;
per recommendations in one of the threads.
Where is the exception thrown? How can I catch it and examine it?
Scott, exception should be thrown when you call LayerOverlay.Refresh(). You can wrap LayerOverlay.Refresh() in a try-catch and see what happens in there.
Also try setting DrawingExceptionMode to DrawingExceptionMode.DrawException and see what is written on the map. Either way, one of these options should give you an insight as to what is causing the problem. You will also want to double check my code to see what could be causing this problem, as I am suspecting there is some bug lurking in your code somewhere, instead of relying solely on the GIS framework to report them.
Nothing is caught by thisOverlay.Refresh() or wpfMap.Refresh(). I wouldn’t expect anything to be because I was under the impression that Refresh was async so any exception thrown would likely be done after the Refresh() call had returned. I would expect to have to register an exception handler instead but I don’t see anywhere to do that.
Nothing is written on the map when I set it to DrawException. I get a pink tile with a red X in the center but no text.
Scott, you are correct in that an exception will be thrown in the async operation and, therefore, will not be caught in the call to Overlay.Refresh() when Overlay.TileType is set to MultipleTile. A pink background with a red X definitely means there is an exception thrown while creating the tile. I think this is one area where the API needs some clarification as DrawingExceptionMode.ThrowException does not propagate to exception to your code, even though the documentation for ThrowException somewhat indicates so.
You may want to strip things down and see what is causing this. Just a thought: Are you using FileBitmapTileCache? Are you possibly reloading bad tiles? Also, if FileBitmapTileCache was constructed with an invalid file path, you get a pink background with a red X. See this thread.
gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/39/aft/8297/afv/topic/Default.aspx#24412
Are you running into this exception only at a specific zoom level?
Klaus,
Thank you for your sharing on Scott’s issue.
Scott,
We’ll keep an eye on your feedback. Hope everything goes well.
Regards,
Ivan