我用 C# 构建了一个 winforms 应用程序,它嵌入了 Google Earth 作为查看器。像这样。我的应用程序定期接收数据,将其转换为 KML,并在 Google 地球中显示结果。每当我收到新的更新时,我都想删除旧的 KML,但在 GE API 中找不到方法。我发现的只是让旧东西不可见:
this.ge = new ApplicationGEClass();
// ....
string newKml = this.ConvertNewInputToKML();
this.ge.LoadKmlData(ref newKml);
FeatureGE oldFeature = this.ge.GetFeatureByName("myOldKmlFeature");
oldFeature.Visibility = 0;
我想知道从长远来看这是否会导致内存/性能问题。或者有没有办法从谷歌地球 KML 节点中删除?