Hi,
I'm using MapSuite WPF Desktop Edition version 5.0 and I'm seeing a DivideByZeroException that seems to be caused by clicking on the map. It doesn't occur with every click but seems to happen randomly.
Here is the stack trace from the exception:
at ThinkGeo.MapSuite.WpfDesktopEdition.TileOverlay.uxQ=(Object vBQ=, EventArgs vRQ=) at ThinkGeo.MapSuite.WpfDesktopEdition.Tile.OnOpened(EventArgs args) at ThinkGeo.MapSuite.WpfDesktopEdition.Tile.set_IsOpened(Boolean value) at ThinkGeo.MapSuite.WpfDesktopEdition.Tile.CommitDrawingCore(GeoCanvas geoCanvas, Object imageSource) at ThinkGeo.MapSuite.WpfDesktopEdition.Tile.CommitDrawing(GeoCanvas geoCanvas, Object nativeImage) at ThinkGeo.MapSuite.WpfDesktopEdition.Tile.tBM=(Object tRM=, RunWorkerCompletedEventArgs thM=) at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e) at System.ComponentModel.BackgroundWorker.AsyncOperationCompleted(Object arg) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext 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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.InvokeImpl(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.Threading.Dispatcher.Run() 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 MapTest.App.Main() in V:\MapTest\MapTest\obj\x86\Release\App.g.cs:line 0 at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
My map setup is pretty simple, I have 7 overlays that I'm using:
- OpenStreetMapOverlay to display OpenStreetMap data
- A LayerOverlay
- 4 SimpleMarkerOverlays used to display Markers of different types
- PopupOverlay used to display Popups on top of Markers
I think the problem might be related to the LayerOverlay because when I comment out the addition of that overlay I can't seem to reproduce the issue. I've only done limited testing with this though so I can't say for sure.
We plan to use the LayerOverlay to load a InMemoryFeatureLayer that can be used to display KML files on the map. I have removed all of that code (InMemoryFeatureLayer, KML processing, etc) so the layer is essentially empty right now. We just add it to the maps overlay list and then don't do anything with it.
Any help with this would be much appreciated. Hopefully this is a common or known issue.
Thanks.
Ben