ThinkGeo.com    |     Documentation    |     Premium Support

Urgent: Desktop build 3.0.382 issues

Hi,


I found a bug in PostgreSQL extention, see detailed information in this link:


gis.thinkgeo.com/Support/Dis...fault.aspx


So I installed the new Desktop build 3.0.382 DLL package. Before I installed it, my application works well except the problem I mentioned in above link.


But after I installed  3.0.382 DLL package, my application does not work as before, the MapClick event is not fired any more. When I set the TrackOverlay.TrackMode to TrackMode.Line, drag the mouse on the map, double click the mouse ,the TrackEnded event does not fire any more. Also I got a weird exception:


 


Why this happened? Urgent help please! I am supposed to release my product to my client tomorrow.


 


System.Collections.Generic.KeyNotFoundException was unhandled
  Message="The given key was not present in the dictionary."
  Source="mscorlib"
  StackTrace:
       at System.ThrowHelper.ThrowKeyNotFoundException()
       at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
       at ThinkGeo.MapSuite.Core.GeoCollection`1.get_Item(String key)
       at ThinkGeo.MapSuite.Core.InMemoryFeatureSource.GetFeaturesBasedOnCachedBoundingBoxes(RectangleShape extent, IEnumerable`1 returningColumnNames)
       at ThinkGeo.MapSuite.Core.InMemoryFeatureSource.GetFeaturesInsideBoundingBoxCore(RectangleShape boundingBox, IEnumerable`1 returningColumnNames)
       at ThinkGeo.MapSuite.Core.FeatureSource.GetFeaturesForDrawingCore(RectangleShape boundingBox, Double screenWidth, Double screenHeight, IEnumerable`1 returningColumnNames)
       at ThinkGeo.MapSuite.Core.FeatureSource.GetFeaturesForDrawing(RectangleShape boundingBox, Double screenWidth, Double screenHeight, IEnumerable`1 returningColumnNames)
       at ThinkGeo.MapSuite.Core.FeatureLayer.DrawCore(GeoCanvas canvas, Collection`1 labelsInAllLayers)
       at ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection`1 labelsInAllLayers)
       at ThinkGeo.MapSuite.DesktopEdition.TrackInteractiveOverlay.DrawCore(GeoCanvas canvas)
       at ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas canvas)
       at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x27d0591c2adda8d9(RectangleShape xb35a33b423b17f65, Overlay x99251f66cdabc2ad, Int32 xa209325f5c895f7e, Int32 x7454a0d1965919b1, GeographyUnit xbb704b4400ce6f76)
       at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x568a187128faa92b(IEnumerable`1 xa6f0db4f183189f1)
       at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x9ac8c50f434f4b39(Int32 xb565f4681f05557a)
       at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.Refresh()
       at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.xc3ce1ee297caf10d(InteractionArguments x195facd4ef5d753d)
       at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.xfeca3317d3c75bbb(Object xd9272088e65bd176, x6a8380ab1a7ebb4c xc2fd4c0ed406cdb7)
       at ThinkGeo.MapSuite.DesktopEdition.x5cd462d41be2f68a.OnMouseEvent(x6a8380ab1a7ebb4c e)
       at ThinkGeo.MapSuite.DesktopEdition.x5cd462d41be2f68a.AnalyseMouseMove(Double screenX, Double screenY, Double worldX, Double worldY)
       at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x7df2db1d74504263(Object xd9272088e65bd176, MouseEventArgs xc2fd4c0ed406cdb7)
       at System.Windows.Forms.MouseEventHandler.Invoke(Object sender, MouseEventArgs e)
       at System.Windows.Forms.Control.WmMouseMove(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at AISAnalyser.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:
 

Hi,


After copy the new MapSuiteFdoExtensionx86 directory into Windows\System32 directory and overwrite the old one, the MapClick and TrackEnded event got working.


Thanks


Rose



Rose,


The reason of this exception happens is we added an index to the InMemoryFeatureSource in the latest build (3.0.382). And if you use the InternalFeatures property which is obsolete you should call the BuildIndex function manually. I think you didn’t call the BuildIndex method in the right place based on the exception trace message. For example, you should also call the BuildIndex method after this line of code:
 

winformsMap1.TrackOverlay.TrackShapeLayer.InternalFeatures.Clear(); 


 
We have a plan to build index in the internal code for the TrackInteractiveOverlay and EditInteractiveOverlay, but we haven’t implement that so far.
 
Another solution for the bug in your last post is that you can still use the DLLs in 3.0.362, just use the new PostgreExtension.dll and Npgsql.dll in the folder “\Spatial Extensions\Postgre Extension\” of 3.0.382 to override the old one. I think this solution is much easier.
 
Sorry for the inconvenience!
 
Any more questions please let me know.
 
Thanks,
 
sun