In our application we have a panel containing a treeview that displays a hierarchy of the layers in an ArcGisRestLayer service. Users can click on checkboxes in the tree to turn available layers on and off, which is how it works with our other types of layers as well. Each time a checkbox is checked a RefreshAsync is triggered on the map to update the display. However, if the checkboxes are checked in rapid succession a RefreshAsync can be triggered before the previous one has finished. This only seems to be a problem with ArcGisServerRestAsyncLayers (so far). When this happens the following exception is thrown:
System.ArgumentNullException: The parameter you supplied may not be null.
Parameter name: image
at ThinkGeo.UI.WinForms.TileOverlay.d__93.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ThinkGeo.UI.WinForms.TileOverlay.d__94.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ThinkGeo.UI.WinForms.TileOverlay.d__88.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ThinkGeo.UI.WinForms.LayerOverlay.d__24.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ThinkGeo.UI.WinForms.Overlay.d__65.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at ThinkGeo.UI.WinForms.Overlay.vkU=(Exception e, String memberName)
at ThinkGeo.UI.WinForms.Overlay.d__65.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ThinkGeo.UI.WinForms.MapViewBase.d__356.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ThinkGeo.UI.WinForms.MapViewBase.d__350.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ThinkGeo.UI.WinForms.MapViewBase.d__285.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ThinkGeo.UI.WinForms.MapViewBase.d__284.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ThinkGeo.UI.WinForms.MapViewBase.d__271.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ThinkGeo.UI.WinForms.MapView.d__118.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ThinkGeo.UI.WinForms.MapView.d__117.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at ThinkGeo_14_Demo.Form1.VB$StateMachine_28_chkLayer1_CheckedChanged.MoveNext() in C:\Users\steller\source\repos\ThinkGeo_14_Demo\Form1.vb:line 113
I have tried cancelling the previous RefreshAsync before calling the new one, but that doesn’t help.
I have attached a sample project for you to try.
Thanks!
Steve
ThinkGeo_14_Demo.zip (798.6 KB)