var networkLink = gePreview.createNetworkLink("");
networkLink.setFlyToView(true);
var link = gePreview.createLink("");
link.setHref(kmzlink);
networkLink.setLink(link);
gePreview.getFeatures().replaceChild(networkLink);
In my script I need to remove this KML file before I load a new file.
How can I remove a KML file already added?
var networkLink = ge.createNetworkLink("");
networkLink.setFlyToView(true);
var link = ge.createLink("");
link.setHref('doc.kml');
networkLink.setLink(link);
I was able to make this work but it appears that the KML layers do not
completely remove. For example it appears that parts of the KML
remain referenced in memory by the globe. This happens when I remove
the KML and add a new KML. Have you seen this? Is this a bug? Is
there a way to clear all KML globally? Thanks again.
can you provide some demo code? What browser and version do you use?
If you remove the feature and set the reference to null it will be
removed on the next call of the garbage collector. But this should
have no effect to the GE Plug, if you remove it, it should be removed.
All methods for the feature container are described here:
> I was able to make this work but it appears that the KML layers do not
> completely remove. For example it appears that parts of the KML
> remain referenced in memory by the globe. This happens when I remove
> the KML and add a new KML. Have you seen this? Is this a bug? Is
> there a way to clear all KML globally? Thanks again.
> Cheers,
> Blair
> On Jun 4, 11:04 pm, marquies wrote:
> > Hi Bjorn,
> > check this code:
> > var networkLink = ge.createNetworkLink("");
> > networkLink.setFlyToView(true);
> > var link = ge.createLink("");
> > link.setHref('doc.kml');
> > networkLink.setLink(link);
You will notice the placemarks look like they have been removed when
the link is clicked.
And the new data is loaded (same placemarks in different folders)
However if you check by clicking a placemark you see in fact a
duplicate has been made.
In fact a duplicate is added every time the links are clicked...
I noticed people having the same issue with networklinks although I
happen to be using google.earth.fetchKml.
> can you provide some demo code? What browser and version do you use?
> If youremovethe feature and set the reference to null it will be
> removed on the next call of the garbage collector. But this should
> have no effect to the GE Plug, if youremoveit, it should be removed.
> All methods for the feature container are described here:
> > I was able to make this work but it appears that the KML layers do not
> > completelyremove. For example it appears that parts of the KML
> > remain referenced in memory by the globe. This happens when Iremove
> > the KML and add a new KML. Have you seen this? Is this a bug? Is
> > there a way to clear all KML globally? Thanks again.
> > Cheers,
> > Blair
> > On Jun 4, 11:04 pm, marquies wrote:
> > > Hi Bjorn,
> > > check this code:
> > > var networkLink = ge.createNetworkLink("");
> > > networkLink.setFlyToView(true);
> > > var link = ge.createLink("");
> > > link.setHref('doc.kml');
> > > networkLink.setLink(link);
> You will notice the placemarks look like they have been removed when
> the link is clicked.
> And the new data is loaded (same placemarks in different folders)
> However if you check by clicking a placemark you see in fact a
> duplicate has been made.
> In fact a duplicate is added every time the links are clicked...
> I noticed people having the same issue with networklinks although I
> happen to be using google.earth.fetchKml.
> Is this a bug or somthing?
> Regards,
> Fraser.
> On Jun 7, 12:47 pm, marquies wrote:
> > Hi Blair,
> > can you provide some demo code? What browser and version do you use?
> > If youremovethe feature and set the reference to null it will be
> > removed on the next call of the garbage collector. But this should
> > have no effect to the GE Plug, if youremoveit, it should be removed.
> > All methods for the feature container are described here:
> > > I was able to make this work but it appears that the KML layers do not
> > > completelyremove. For example it appears that parts of the KML
> > > remain referenced in memory by the globe. This happens when Iremove
> > > the KML and add a new KML. Have you seen this? Is this a bug? Is
> > > there a way to clear all KML globally? Thanks again.
> > You will notice the placemarks look like they have been removed when
> > the link is clicked.
> > And the new data is loaded (same placemarks in different folders)
> > However if you check by clicking a placemark you see in fact a
> > duplicate has been made.
> > In fact a duplicate is added every time the links are clicked...
> > I noticed people having the same issue with networklinks although I
> > happen to be using google.earth.fetchKml.
> > Is this a bug or somthing?
> > Regards,
> > Fraser.
> > On Jun 7, 12:47 pm, marquies wrote:
> > > Hi Blair,
> > > can you provide some demo code? What browser and version do you use?
> > > If youremovethe feature and set the reference to null it will be
> > > removed on the next call of the garbage collector. But this should
> > > have no effect to the GE Plug, if youremoveit, it should be removed.
> > > All methods for the feature container are described here:
> > > > I was able to make this work but it appears that the KML layers do not
> > > > completelyremove. For example it appears that parts of the KML
> > > > remain referenced in memory by the globe. This happens when Iremove
> > > > the KML and add a new KML. Have you seen this? Is this a bug? Is
> > > > there a way to clear all KML globally? Thanks again.