[WPF] "Point is empty" exception on MapControl.Info event
See original GitHub issueWindows 10 Pro Visual Studio Community 2019 16.11.5 .NET Core 3.1 Mapsui.Wpf 3.0.1
Test project: MapsuiTest.zip Steps to reproduce:
- Set breakpoint in
MapControlOnInfomethod - Run in debug mode
- Left mouse click on map
- Continue running (F5)
- Press
LeftCtrlkey while moving the mouse - Exception:

System.Exception
HResult=0x80131500
Message = Point is empty
Source = Mapsui.Geometries
StackTrace:
at Mapsui.Geometries.Point.get_X()
at Mapsui.UI.Wpf.MapControl.DrawBbox(Point newPos)
at Mapsui.UI.Wpf.MapControl.MapControlMouseMove(Object sender, MouseEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(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.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run()
at MapsuiTest.App.Main()
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Mapsui Error: How to fix PresentationSource is null?
I received this error in a WPF view hosting a usercontrol containing the Mapsui mapcontrol in WPF MVVM application. System.Exception HResult= ...
Read more >Map for WPF - ArgumentOutOfRangeException is thrown ...
Hello,. To Note: This is not specific to the MapEditor and Adorners, it can happen on any Map item with a bound property....
Read more >WPF MapControl - Info event NumTaps is always 1 #1677
Describe the bug. When the Info event is triggered in the WPF Map Control, the NumTaps property is always set to 1. To...
Read more >Map crash while disposing in UI for WPF
We've seen a crash in our application when the RadMap control is disposed. We've only seen the crash once but have been unable...
Read more >Binding the map control in MVVM?
I had a double mouseclick event on my map which got the position and returned the mapPoint to a text box which worked...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I pushed a fix to develop/3.0. Since this only affects developers I will hold out a patch release until other bug come up.
@pauldendulk Thanks for developing Mapsui! I’m happy to be helpful