judero01col / GMap.NET

GMap.NET Windows Forms & Presentation is an excellent open source, powerful, free and cross-platform .NET control. Allows the use of routing, geocoding, directions and maps from Google, Yahoo!, Bing, OpenStreetMap, ArcGIS, Pergo, SigPac, Yendux, Mapy.cz, Maps.lt, iKarte.lv, NearMap, HereMap, CloudMade, WikiMapia, MapQuest and many more.
Other
440 stars 197 forks source link

DrawMap throws InvalidCastException when switching between WinForms and WPF Control #187

Open davqq opened 10 months ago

davqq commented 10 months ago

Hello,

when using both WinForms and WPF control in one application, GMapControl.DrawMap throws an InvalidCastException because it expects an GMapImage of the namespace GMap.NET.WindowsPresentation but gets one from GMap.NET.WinForms. This happens (probably) because when drawing the control the overlay property inside the tile objects hasn't been updated yet. As of my understanding this happens not synced with the drawing thread. When stepping through the code it is possible that the exception does not happen.

I was using the nugget package in version 2.1.7.