thientung / winforms-geplugin-control-library

Automatically exported from code.google.com/p/winforms-geplugin-control-library
GNU General Public License v3.0
0 stars 0 forks source link

Can't create placemark after erased #52

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Perhaps I am missing a method called, but I'm expecting to create a placemark 
with the same ID / name after it has been erased. I'm working with 
Test_Application6 as an example / starting point.

What steps will reproduce the problem?
1. Create a placemark and add it to the tree, e.g.: 
            var bobPlacemark = GEHelpers.CreatePlacemark(ge, 33.11, 45.22, id: "Bob", name: "Bob placemark 1");
            this.kmlTreeView1.ParseKmlObject(bobPlacemark);
2. Clear all nodes, e..g:
            GEHelpers.RemoveAllFeatures(ge);
            kmlTreeView1.Nodes.Clear();
3. Recreate element as in Step 1

What is the expected output? What do you see instead?
I expect the node to be recreated and added again. Instead, I get a 
COMException : Error HRESULT E_FAIL has been returned from a call to a COM 
component.

What version of the product are you using? On what operating system?

Win XP SP3, dll version 4.0.30319

Thanks in advance.

Please provide any additional information below.

Original issue reported on code.google.com by mark.fre...@gmail.com on 14 Sep 2011 at 6:00

GoogleCodeExporter commented 9 years ago
Hi,
just a quick answer.
IDs need to be unique, so when you recreate the pm in step 3 you'll get an 
error. 
I typically use a counter when creating and deleting placemarks.

Original comment by tho...@gmail.com on 18 Sep 2011 at 2:17

GoogleCodeExporter commented 9 years ago
Yes, the internal garbage collection has to complete before you reuse an ID.

However you can just call release on the placemark - i.e. - 
bobPlacemark.release() to force this.

Original comment by fraser.c...@gmail.com on 18 Sep 2011 at 4:31

GoogleCodeExporter commented 9 years ago
JTN this is an issue with the Google Earth Plugin Api - not this control 
library as such, see 
http://code.google.com/p/earth-api-samples/issues/detail?id=253

Original comment by fraser.c...@gmail.com on 18 Sep 2011 at 4:32