ThinkGeo.com    |     Documentation    |     Premium Support

ThinkGeoCloudRasterMapsOverlay DrawingExceptionMode not working

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.ValueTask1.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.TaskCompletionSourceWithCancellation1.d__1.MoveNext()
at System.Threading.Tasks.ValueTask1.get_Result() at System.Net.Http.HttpConnectionPool.<SendWithVersionDetectionAndRetryAsync>d__89.MoveNext() at System.Threading.Tasks.ValueTask1.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

Hi Simo,

This bug has been recreated and fixed in the latest beta (ThinkGeo.UI.Wpf(14.2.0 - beta048)). We are going to have a release with this fix in about 2 weeks. Thanks for letting us know!

Thanks,
Ben

Hi,

So it is already fixed on 14.2.0-beta048 or will be fixed on next release ?

BR, Simo

It is already fixed on 14.2.0-beta048 and will be fixed on next major release.

Hi,

I tried the example code with 14.2.0-beta048 but same exception is still thrown even DrawingExceptionMode is set to DrawException ? Does it work for you with that code ?

BR, Simo

Hi,

Sorry, the build process had some issues and it’s not in 048 as expected. Here is the sample with 049 and it works fine. Check it out. WpfTestbed.zip (3.8 KB)

Thanks,
Ben

Hi,

Thanks, seems to be working as expected with beta049.

-Simo

No problem, just let us know if you have any questions.