What could
cause a KeyNotFoundException for the following line of code in protected override void DrawCore(GeoCanvas
canvas):
EditShapesLayer.Draw(canvas, labelsInAllLayers);
?
What could
cause a KeyNotFoundException for the following line of code in protected override void DrawCore(GeoCanvas
canvas):
EditShapesLayer.Draw(canvas, labelsInAllLayers);
?
Hi F5K,
Thanks for your post, would you please provide us the stacktrace for a further test, for now the information is limited to locate the bug location.
Waiting for your further information.
Best Regards
Summer
Visual Studio Call Stack:
MyCode.dll!MyCode.CustomEditInteractiveOverlay.DrawCore(ThinkGeo.MapSuite.Core.GeoCanvas canvas) Line 688 C#
DesktopEdition.dll!ThinkGeo.MapSuite.DesktopEdition.Overlay.qhM=(ThinkGeo.MapSuite.Core.GeoCanvas qxM=) + 0x150 bytes
DesktopEdition.dll!ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(ThinkGeo.MapSuite.Core.GeoCanvas canvas) + 0x8b bytes
DesktopEdition.dll!ThinkGeo.MapSuite.DesktopEdition.WinformsMap.zBU=(ThinkGeo.MapSuite.Core.RectangleShape zRU=, ThinkGeo.MapSuite.DesktopEdition.Overlay zhU=, int zxU=, int 0BU=, ThinkGeo.MapSuite.Core.GeographyUnit 0RU=) + 0xde bytes
DesktopEdition.dll!ThinkGeo.MapSuite.DesktopEdition.WinformsMap.1RU=(System.Collections.Generic.IEnumerable<ThinkGeo.MapSuite.DesktopEdition.Overlay> 1hU=) + 0x253 bytes
DesktopEdition.dll!ThinkGeo.MapSuite.DesktopEdition.WinformsMap.vBU=(ThinkGeo.MapSuite.Core.RectangleShape vRU=) + 0x2b7 bytes
DesktopEdition.dll!ThinkGeo.MapSuite.DesktopEdition.WinformsMap.thU=(int txU=, ThinkGeo.MapSuite.Core.RectangleShape uBU=) + 0x45 bytes
DesktopEdition.dll!ThinkGeo.MapSuite.DesktopEdition.WinformsMap.Refresh(ThinkGeo.MapSuite.Core.RectangleShape extent, System.Collections.Generic.IEnumerable<ThinkGeo.MapSuite.DesktopEdition.Overlay> overlays) + 0x2e9 bytes
DesktopEdition.dll!ThinkGeo.MapSuite.DesktopEdition.WinformsMap.Refresh(ThinkGeo.MapSuite.Core.RectangleShape extent, ThinkGeo.MapSuite.DesktopEdition.Overlay overlay) + 0x9f bytes
(Method where clicked on feature is removed from TrackShapesLayer and added to EditShapesLayer) MyCode.dll!MyCode.EnterEditMode(ThinkGeo.MapSuite.Core.Feature featureSelected) Line 1633 + 0xb bytes C#
(Event where user’s click on a feature is caught) MyCode.dll!MyCode.Map_MapClick(object sender, ThinkGeo.MapSuite.DesktopEdition.MapClickWinformsMapEventArgs e) Line 1414 + 0xe bytes C#
It gives the exception in my override of DrawCore:
Collection<SimpleCandidate> labelsInAllLayers = new Collection<SimpleCandidate>();
EditShapesLayer.Open();
EditShapesLayer.Draw(canvas, labelsInAllLayers); //<== KeyNotFoundException
Additional info:
In my user interface, the user gets to click on features on the map and edit them using standard EditShapesLayer functionality. The exception has so far never occurred the first time the user clicks on one of the features to edit it, but it does usually happen within the second to fifth attempt. The exception can both occur when the user attempts to edit the same feature as edited before, or when he/she selects another feature. So far I’ve been unable to find a predictable pattern.
Hi F5K,
Thanks for your further information, I tried to recreate your problem with attached code, but it didn't show up, would you please check if there are any thing we missed in our test code?
Waiting for your further information.
Best Regards
Summer
Post11891Sample.txt (2.61 KB)
I couldn't
recreate the problem with your code either, so I've rewritten it to be more
like my own code, but much simpler. So far this has helped me to discover the
problem doesn't so much lie in the fact that I override DrawCore. I can get the
KeyNotFoundException by commenting out the override and simply refreshing the
map.
Please try
out the attached code and see if you can get the same error by doing the
following:
I'm still on 7.0.287.0, while waiting for 289
to become available.
SelectFeatures.txt (3.73 KB)
By the way, I have a feeling that somewhere along the DLL updates I lost a lot of performance. This example has a map with just one feature in it and yet it takes seconds to start up.
Hi F5K
Thanks for your further informaiton, the problem is recreated, would you please use
editOverlay.EditShapesLayer.BuildIndex();
winformsMap1.Refresh(editOverlay);
To Replace
winformsMap1.Refresh(editOverlay);
now it should work
Hope it helps
Summer
I’ve copied your code into my DrawCore override so that I don’t have to call it everywhere I want to refresh the EditsShapesLayer. So far it looks like it works! Thank you!
How about the performance issue? Did you also notice long loading times with the sample code I attached? If so, what is taking so long?
Hi F5K
First of all, great to hear it helped, about "performance issue" did you mean that you attached a sample in reply "03-27-2014 10:56 AM "? if yes, it seems that the upload was not successful,would you please send it to forumsupport@thinkgeo.com?
Waiting for your further information.
Best Regards
Summer
No I meant the one called SelectFeatures.txt posted in this thread at 03-27-2014 10:52 AM. I’ve reattached it.
SelectFeatures.txt (3.73 KB)
Hi F5k,
Thank you for your mentions, we have some diagnostics statements in our product. I’m working on cutting off these statements from desktop edition. As so far, when you press “F5”, the performance is slow, but “ctrl + F5”, it is faster. the latest version 7.0.295.0 can be downloaded.
Regards,
Casper
Hi Casper/Don,
Ok! Please let me know when there is a new dll with better performance.
Sure, once it’s corrected, I will update it in the thread. Sorry for the inconvenience.
Thanks,
Johnny
Hi,
We have fixed this issue, please download the latest version 7.0.308.0 or later. If you have any question, please let me know.
Regards,
Don
Huge improvement! Thanks!
Hi,
Any question please let us know.
Regards,
Don