LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Gmap.Net red big Cross(Gmap.Net System.InvalidOperationException: Collection was modified; enumeration operation may not execute.)

I am trying to make a route that follows the moving marker and marker. When the position of the marker changes, a new point has to be added to the route automatically, but after the program runs like this, a big red cross appears 5 minutes after the program works.
I searched Everywhere I looked at all the forums I couldn't find a solution I don't know if there is a Gmap.Net error or a problem with the way I adapt the code. I think anyone who has been in trouble with this issue before can offer a solution.

 

 

************** Exception Text **************
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
at System.Collections.Generic.List`1.Enumerator.MoveNext()
at GMap.NET.WindowsForms.GMapOverlay.OnRender(Graphics g)
at GMap.NET.WindowsForms.GMapControl.OnPaintOverlays(Graphics g)
at GMap.NET.WindowsForms.GMapControl.OnPaint(PaintEventArgs e)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.UserControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ActiveXImpl.System.Windows.Forms.IWindowTarget.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

 

0 Kudos
Message 1 of 2
(914 Views)

I have the same question...

the error like this below

集合已修改,列舉作業可能尚未執行.png

 

 

 

 

 

 

and detail information like: 

System.InvalidOperationException: 集合已修改; 列舉作業可能尚未執行。
於 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
於 System.Collections.Generic.List`1.Enumerator.MoveNextRare()
於 System.Collections.Generic.List`1.Enumerator.MoveNext()
於 GMap.NET.WindowsForms.GMapOverlay.OnRender(Graphics g)
於 GMap.NET.WindowsForms.GMapControl.OnPaintOverlays(Graphics g)
於 GMap.NET.WindowsForms.GMapControl.OnPaint(PaintEventArgs e)
於 System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
於 System.Windows.Forms.Control.WmPaint(Message& m)
於 System.Windows.Forms.Control.WndProc(Message& m)
於 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
於 System.Windows.Forms.ContainerControl.WndProc(Message& m)
於 System.Windows.Forms.UserControl.WndProc(Message& m)
於 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
於 System.Windows.Forms.Control.ActiveXImpl.System.Windows.Forms.IWindowTarget.OnMessage(Message& m)
於 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
於 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

 

I am writing a method to rotate the Icon on the GMap, and I call the related method of OnRender to rotate the Bitmap.
I think an error occurred when I called the OnRender method. The following is my block diagram.

 

0 Kudos
Message 2 of 2
(81 Views)