Clearing the muddy waters on this subject, here's how to load and
control KML, whether a NetworkLink, or anything else in the KML:
var myKMLObject;
function finishedSectors(object) {
if (!object) {
alert('bad or NULL kml');
return;
}
myKMLObject = object;
ge.getFeatures().appendChild(object);
}
function loadMyKML() {
var url = "
http://localhost/foo/sectors4.kmz";
google.earth.fetchKml(ge, url, finishedSectors);
}
function hideMyKMLObject() {
if (myKMLObject) {
myKMLObject.setVisibility( false );
}
}
function removeMyKMLObject() {
if (myKMLObject) {
ge.getGlobe().getFeatures().removeChild(myKMLObject);
}
}