Hi,
I noticed that if you use ThinkGeoCloudVectorMapsOverlay or ThinkGeoCloudRasterMapsOverlay as background map and configure DrawingExceptionMode to be DrawingExceptionMode.DrawException, even then it is possible that exceptions get thrown.
This can be easily tested with the Quick start example at https://gitlab.com/thinkgeo/public/thinkgeo-desktop-maps. I followed the instructions up to step 5 and then configured the DrawException mode:
private void mapView_Loaded(object sender, RoutedEventArgs e)
{
// Set the Map Unit.
mapView.MapUnit = GeographyUnit.Meter;
// Add a base map overlay.
var cloudVectorBaseMapOverlay = new ThinkGeoCloudVectorMapsOverlay("USlbIyO5uIMja2y0qoM21RRM6NBXUad4hjK3NBD6pD0~", "f6OJsvCDDzmccnevX55nL7nXpPDXXKANe5cN6czVjCH0s8jhpCH-2A~~", ThinkGeoCloudVectorMapsMapType.Light);
cloudVectorBaseMapOverlay.DrawingExceptionMode = DrawingExceptionMode.DrawException;
mapView.Overlays.Add(cloudVectorBaseMapOverlay);
mapView.CurrentExtent = new RectangleShape(-20000000, 20000000, 20000000, -20000000);
}
If this application is started without network connectivity, the following exception is thrown:
System.Net.WebException
HResult=0x80131509
Message=The remote name could not be resolved: 'cloud2.thinkgeo.com'
Source=System
StackTrace:
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at ThinkGeo.Core.CloudMapClient.CreateWebRequest(String apiPath, String method, String parameters, String body, Int32 timeoutInSeconds, IWebProxy webProxy, Boolean isNeedToken)
at ThinkGeo.Core.CloudMapClient.xTY=()
at ThinkGeo.Core.CloudMapClient.Open()
at ThinkGeo.Core.ThinkGeoCloudVectorMapsLayer.OpenCore()
at ThinkGeo.Core.Layer.Open()
at ThinkGeo.Core.ThinkGeoCloudVectorMapsOverlay.DrawCore(RectangleShape targetExtent, OverlayRefreshType overlayRefreshType)
at ThinkGeo.Core.Overlay.Draw(RectangleShape targetExtent, OverlayRefreshType refreshType)
at ThinkGeo.Core.MapViewBase.b0o=(Overlay overlay, RectangleShape targetExtent, OverlayRefreshType refreshType)
at ThinkGeo.Core.MapViewBase.aUo=(IEnumerable`1 overlays, RectangleShape targetExtent, OverlayRefreshType refreshType)
at ThinkGeo.Core.MapViewBase.DrawCore(RectangleShape targetExtent, OverlayRefreshType overlayRefreshType)
at ThinkGeo.Core.MapViewBase.Y0o=(Object sender, EventArgs e)
at System.Windows.Threading.DispatcherTimer.FireTick(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at ThinkGeoWpfApp.App.Main()
Is this intended to work like this? I would have assumed that exception is thrown only if DrawingExceptionMode.ThrowException mode is used.
BR, Rasmus