Thanks for your reporting! I think the reason for this is that we changed some logic as well as some APIs in the MapControl.
So please try to remove the code related with MapControl in InitializeComponent and re-drag a new updated MapControl(3.0.392) to your application, hopefully it works.
now I have the following exception when I add the WorldKit Overlay (again, was working with 3.0.362 and I did not changed my code):
System.NullReferenceException à ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.DrawCore(GeoCanvas canvas) à ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas canvas) à ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x27d0591c2adda8d9(RectangleShape xb35a33b423b17f65, Overlay x99251f66cdabc2ad, Int32 xa209325f5c895f7e, Int32 x7454a0d1965919b1, GeographyUnit xbb704b4400ce6f76) à ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x568a187128faa92b(IEnumerable`1 xa6f0db4f183189f1) à ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x9ac8c50f434f4b39(Int32 xb565f4681f05557a) à ThinkGeo.MapSuite.DesktopEdition.WinformsMap.Refresh()
So you mean this exception will ONLY happen when the WorldMapKit layers are loaded? And this exception will always happen or just happen at random time?
at this stage, MS3 crashes randomly for different reasons. I mean with WMK the crash is systematic.
Here is my code:
DecorsOverlay.Lock.EnterWriteLock(); try { RenderMap renderMaps = new RenderMap(WorldKitUtil.FullDataPath); renderMaps.LoadLayers(DecorsOverlay.Layers, DecorsOverlay.Layers); // I’ve done no change on the provided method that I get from you in february
foreach (FeatureLayer l in DecorsOverlay.Layers) l.FeatureSource.Projection = ProjectionHelper.GetProjection(ProjectionEnum.WGS84, ActiveProjection);
m_MainMap.MaximumScale = 5000000; m_MainMap.MinimumScale = 10; m_MainMap.ThreadingMode = MapThreadingMode.SingleThreaded; // still not stable in multithread
I did a test sample according to your codes while I removed the WorldMapKitRenderers.cs file for its privacy, we did not find any exception for a long time test in version 3.0.362 & 3.0.392.
If possible, can you try this sample to see if any difference with your application.
Thanks for your code! Just make sure with your code, it will take a long time to render a wrong map? I think the reason is without projection, the wrong MapUnit as well as wrong CurrentExtent are set.
Any more questions please feel free to let me know.
the wrong mapunit & current extend are a bad cut/paste. the test has been done with mapunit in meter with the projection and mapunit in degre without the projection.