Hi,
It seems that with ThinkGeoCloudRasterMapsOverlay DrawingExceptionMode is not working correctly. Used ThinkGeo version is 14.1.1.
With following example code:
private async void mapView_Loaded(object sender, RoutedEventArgs e)
{
var mapView = sender as MapView;
// Set the Map's Unit to Meter.
mapView.MapUnit = GeographyUnit.Meter;
// Set the Current Extent to the Max Extent of ThinkGeo Map.
mapView.CurrentExtent = MaxExtents.ThinkGeoMaps;
// Add a base map overlay.
var baseOverlay = new ThinkGeoCloudRasterMapsOverlay("AOf22-EmFgIEeK4qkdx5HhwbkBjiRCmIDbIYuP8jWbc~",
"xK0pbuywjaZx4sqauaga8DMlzZprz0qQSjLTow90EhBx5D8gFd2krw~~", ThinkGeoCloudRasterMapsMapType.Light_V1_X1);
// Set up the tile cache for the base overlay, passing in the location and an ID to distinguish the cache.
baseOverlay.TileCache = new FileRasterTileCache(@".\cache", "basemap");
**baseOverlay.DrawingExceptionMode = DrawingExceptionMode.DrawException;**
// Add the newly created overlay to mapView.
mapView.Overlays.Add(baseOverlay);
// Refresh the Map
await mapView.RefreshAsync();
}
If you start application without network connection it throws following exception:
{System.Net.Http.HttpRequestException}
Message:
No such host is known. (cloud3.thinkgeo.com:443)
StackTrace:
at System.Net.Http.HttpConnectionPool.d__104.MoveNext()
at System.Threading.Tasks.ValueTask1.get_Result() at System.Net.Http.HttpConnectionPool.<ConnectAsync>d__103.MoveNext() at System.Threading.Tasks.ValueTask
1.get_Result()
at System.Net.Http.HttpConnectionPool.d__105.MoveNext()
at System.Threading.Tasks.ValueTask1.get_Result() at System.Net.Http.HttpConnectionPool.<AddHttp11ConnectionAsync>d__79.MoveNext() at System.Threading.Tasks.TaskCompletionSourceWithCancellation
1.d__1.MoveNext()
at System.Threading.Tasks.ValueTask1.get_Result() at System.Net.Http.HttpConnectionPool.<SendWithVersionDetectionAndRetryAsync>d__89.MoveNext() at System.Threading.Tasks.ValueTask
1.get_Result()
at System.Net.Http.RedirectHandler.d__4.MoveNext()
at System.Net.Http.HttpClient.<g__Core|83_0>d.MoveNext()
at AT0=.AD0=.pkA=.MoveNext()
at ThinkGeo.Core.Async.ThinkGeoCloudRasterMapsLayer.40A=.MoveNext()
at System.Threading.Tasks.Task.<>c.b__128_0(Object state)
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 MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
— End of stack trace from previous location —
at System.Threading.ExecutionContext.RunInternal(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 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.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at ThinkGeoTest.App.Main()
I would assume that exception should not be thrown when DrawingExceptionMode.DrawException is set ? (DrawingExceptionMode seems to be working ok with ThinkGeoCloudVectorMapsOverlay)
BR, Simo