Esto de volar hacia una capa ya lo tengo resuelto de otra manera pero por el otro no puedo hacer que desaparezca la capa cuando desmarco el checkbox, no se si me puedas recomendar algo en este sentido. El siguiente código es el que tengo en otra página.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>GIS de Agua de México S.A. de C.V.</title>
<script src="http://www.google.com/jsapi?key=ABQIAAAAvVdETXRVjvhZiycw4fgOORQLNchPlEBxB9hxIhD1AqzNtzRTFRS6ugXFI9alitYEClFh8UsS5TkbSw">
</script>
<script type="text/javascript">
var ge = null;
google.load("earth", "1");
function init() {
var content = document.getElementById('content');
google.earth.createInstance('content', initCB, failureCB);
}
function initCB(instance) {
ge = instance;
ge.getWindow().setVisibility(true);
// add a navigation control
ge.getNavigationControl().setVisibility(ge.VISIBILITY_AUTO);
// Vuela hasta el DF
var la = ge.createLookAt('');
la.set( 19.320699, -99.152816,
0, // altitude
ge.ALTITUDE_RELATIVE_TO_GROUND,
0, // heading
0, // straight-down tilt
10000000 // range (inverse of zoom)
);
// añadir capas de google
ge.getLayerRoot().enableLayerById(ge.LAYER_ROADS, true);
//ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, true);
//ge.getLayerRoot().enableLayerById(ge.LAYER_BULDINGS, true);
ge.getView().setAbstractView(la);
document.getElementById('installed-plugin-version').innerHTML = ge.getPluginVersion().toString();
}
function failureCB(errorCode) {
}
//////
//////
function createNetworkLink(file) {
var kmlCheckbox = document.getElementById('checkbox_' + file);
if (networkLink == null) {
var networkLink = ge.createNetworkLink("");
networkLink.setDescription("NetworkLink open to fetched content");
networkLink.setName("Open NetworkLink");
networkLink.setFlyToView(true);
// create a Link object
var link = ge.createLink("");
liga = "http://www.aguademexico.com.mx/padron/kmls/" + file + ".kmz" ;
cajita = 'checkbox_' + file ;
link.setHref(liga);
// attach the Link to the NetworkLink
networkLink.setLink(link);
// add the NetworkLink feature to Earth
}
if (kmlCheckbox.checked){
ge.getFeatures().appendChild(networkLink);
} else {
networklink.setVisibility(kmlChecbox.checked);
}
}
google.setOnLoadCallback(init);
function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
</script>
<style type="text/css">
<!--
.Chica {
font-family: Arial, Helvetica, sans-serif;
font-size: x-small;
}
.style1 {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
color:
#495678;
}
-->
</style>
</head>
<body style="font-family: Arial;font-size:13px;border: 0 none;">
<!-- Copiar dentro del tag BODY -->
<script language="JavaScript1.2">
<!--
// Maximizar Ventana por Nick Lowe (nicklowe@ukonline.co.uk)
window.moveTo(0,0);
if (document.all) {
top.window.resizeTo(screen.availWidth,screen.availHeight);
} else if (document.layers||document.getElementById) {
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
//-->
</script>
<link rel="stylesheet" type="text/css" href="checktree.css" />
<script type="text/javascript" src="checktree.js"></script>
<script type="text/javascript"><!--
// USAGE NOTES: Create a new CheckTree() object like so, and pass it its own name.
var checkmenu = new CheckTree('checkmenu');
// You can create several such tree objects, just give each a unique name.
// One optional property: whether to count all checkboxes beneath the current level,
// or just to count the checkboxes immediately beneath the current level (the default).
//checkmenu.countAllLevels = true;
//--></script>
<table width="1110" border="0" align="left">
<tr>
<td width="200" valign="top"><div align="center">
<p><img src="imagenes/LOGO CABECERA3.jpg" alt="" width="200" height="104" /></p>
<p class="style1">Sistema de Información Geográfica</p>
</div>
<form action="javascript:void(0)">
<ul id="tree-checkmenu" class="checktree">
<li id="show-explorer"><img src="imagenes/Network-Graphite-48x48.png" alt="Capas Básicas de Google" width="48" height="48" /><strong>DISTRITO FEDERAL
</strong>
<ul id="tree-explorer">
<li id="show-iemac">
<input type="checkbox" name="checkbox_limitedf" id="checkbox_limitedf" onclick="javascript:createNetworkLink('limitedf');"/>
Delegaciones
<ul id="tree-iemac">
<li>
<input type="checkbox" name="checkbox_delAO" id="checkbox_delAO" onclick="javascript:createNetworkLink('delAO');"/>
Alvaro Obregón </li>
<li class="last">
<input type="checkbox" />
Azcapotzalco </li>
<li>
<input type="checkbox" name="checkbox_delAO" id="checkbox_delAO" onclick="javascript:createNetworkLink('delAO');"/>
Benito Juárez </li>
<li>
<input type="checkbox" name="checkbox_delAO" id="checkbox_delAO" onclick="javascript:createNetworkLink('delAO');"/>
Coyoacán</li>
<li>
<input type="checkbox" name="checkbox_delAO" id="checkbox_delAO" onclick="javascript:createNetworkLink('delAO');"/>
Cuajimalpa</li>
<li>
<input type="checkbox" name="checkbox_delAO" id="checkbox_delAO" onclick="javascript:createNetworkLink('delAO');"/>
Cuauhtémoc</li>
<li>
<input type="checkbox" name="checkbox_delAO" id="checkbox_delAO" onclick="javascript:createNetworkLink('delAO');"/>
Gustavo A. Madero</li>
<li>
<input type="checkbox" name="checkbox_delAO" id="checkbox_delAO" onclick="javascript:createNetworkLink('delAO');"/>
Iztacalco</li>
<li>
<input type="checkbox" name="checkbox_delAO" id="checkbox_delAO" onclick="javascript:createNetworkLink('delAO');"/>
Iztapalapa</li>
<li>
<input type="checkbox" name="checkbox_delAO" id="checkbox_delAO" onclick="javascript:createNetworkLink('delAO');"/>
Magdalena Contreras</li>
<li>
<input type="checkbox" name="checkbox_delAO" id="checkbox_delAO" onclick="javascript:createNetworkLink('delAO');"/>
Miguel Hidalgo</li>
<li>
<input type="checkbox" name="checkbox_delAO" id="checkbox_delAO" onclick="javascript:createNetworkLink('delAO');"/>
Milpa Alta</li>
<li>
<input type="checkbox" name="checkbox_delAO" id="checkbox_delAO" onclick="javascript:createNetworkLink('delAO');"/>
Tlahuac</li>
<li>
<input type="checkbox" name="checkbox_delAO" id="checkbox_delAO" onclick="javascript:createNetworkLink('delAO');"/>
Tlalpan</li>
<li>
<input type="checkbox" name="checkbox_delAO" id="checkbox_delAO" onclick="javascript:createNetworkLink('delAO');"/>
Venustiano Carranza</li>
<li>
<input type="checkbox" name="checkbox_delAO" id="checkbox_delAO" onclick="javascript:createNetworkLink('delAO');"/>
Xochimilco</li>
</ul>
</li>
<li id="show-iewin" class="last">
Ciudad
<span id="count-iewin" class="count"></span>
<ul id="tree-iewin">
<li>
<input type="checkbox" name="checkbox_metro" id="checkbox_metro" onclick="javascript:createNetworkLink('metro');"/>
Metro </li>
<li>
<input type="checkbox" name="checkbox_sucursales_amsa" id="checkbox_sucursales_amsa" onclick="javascript:createNetworkLink('sucursales_amsa');"/>
OAP'S </li>
<li>
<input type="checkbox" name="checkbox_metro3" id="checkbox_metro3" onclick="javascript:createNetworkLink('metro');"/>
Tesorería </li>
</ul>
</li>
</ul>
</li>
<li id="show-netscape"><img src="imagenes/Network-48x48.png" alt="" width="48" height="48" />
<strong>3a. DIMENSIÓN</strong>
<ul id="tree-netscape">
<li>
<input type="checkbox" name="checkbox_3D-Legaria" id="checkbox_3D-Legaria" onclick="javascript:createNetworkLink('3D-Legaria');"/>
Legaria</li>
<li>
<input type="checkbox" name="checkbox_3D-Torre_Blanca" id="checkbox_3D-Torre_Blanca" onclick="javascript:createNetworkLink('3D-Torre_Blanca');"/>
Torre Blanca</li>
</ul>
</li>
<li id="show-opera"><img src="imagenes/talk-48x48.png" alt="Mapas Temáticos" width="48" height="48" /><strong>MAPAS TEMÁTICOS</strong>
<ul id="tree-opera">
<li>
<input type="checkbox" name="checkbox_Ctas_suspendidas" id="checkbox_Ctas_suspendidas" onclick="javascript:createNetworkLink('Ctas_suspendidas');"/>
Suspensiones</li>
<li>
<input type="checkbox" name="checkbox_con_D150" id="checkbox_con_D150" onclick="javascript:createNetworkLink('con_D150');"/>
Cons Dom.>150</li>
<li class="last">
<input type="checkbox" name="checkbox_con_ND240" id="checkbox_con_ND240" onclick="javascript:createNetworkLink('con_ND240');"/>
Cons NDom > 240</li>
<li class="last">
<input type="checkbox" />
Ctas Fabriquitas</li>
<li class="last">
<input type="checkbox" />
Dom. > 240</li>
<li class="last">
<input type="checkbox" />
Dom > 480</li>
<li class="last">
<input type="checkbox" />
Medidor Lectura igual</li>
<li class="last">
<input type="checkbox" name="checkbox_Sectores" id="checkbox_Sectores" onclick="javascript:createNetworkLink('Sectores');"/>
Sectores</li>
<li class="last">
<input type="checkbox" name="checkbox_pulmones_df" id="checkbox_pulmones_df" onclick="javascript:createNetworkLink('pulmones_df');"/>
Pulmones del DF</li>
</ul>
</li>
<li id="show-khtml"><img src="imagenes/Finder-Toolbar-Burn-48x48.png" alt="" width="48" height="48" />
<strong>BUSQUEDAS</strong>
<ul id="tree-khtml">
<li>
<label>
<input name="vcuenta" type="text" id="vcuenta" size="20" maxlength="16" />
</label>
Cuenta CADF </li>
<li class="last">
<input type="text" name="vcalle" id="vcalle" />
Calle</li>
<li class="last">
<label>
<select name="select" id="select">
<option selected="selected">Selecciona Colonia</option>
<option value="Legaria">Legaria</option>
<option value="Torre Blanca">Torre Blanca</option>
</select>
</label>
</li>
<li class="last">
<input name="vcp" type="text" id="vcp" size="10" maxlength="5" />
Codigo Postal
<label>
<input type="submit" name="button" id="button" value="Buscar" />
</label>
</li>
</ul>
</li>
<li id="show-netscape2"><img src="imagenes/Burn-48x48.png" alt="" width="48" height="48" />
<strong>PLANIMETRÍA</strong>
<ul id="tree-netscape2">
<li>
<input type="checkbox" name="checkbox_pru-mh" id="checkbox_pru-mh" onclick="javascript:createNetworkLink('pru-mh');"/>
Miguel Hidalgo</li>
</ul>
</li>
<li id="show-netscape3"><img src="imagenes/Application-icon.jpg" alt="" width="48" height="48" />
<strong>RED HIDRAULICA</strong>
<ul id="tree-netscape3">
<li>
<input type="checkbox" name="checkbox_Red_MH" id="checkbox_Red_MH" onclick="javascript:createNetworkLink('Red_MH');"/>
Miguel Hidalgo </li>
<li>
<input type="checkbox" name="checkbox_PT_Santa_Fe" id="checkbox_PT_Santa_Fe" onclick="javascript:createNetworkLink('PT_Santa_Fe');"/>
PT Santa Fé
</li>
</ul>
</li>
</ul>
</form>
<p> </p></td>
<td width="900"><script language="JavaScript">
document.writeln("<div id='content' style='border: 1px solid silver;height:" + (screen.height-100) + "px; width:" + (screen.width-200) +"px'></div>")
</script> </td>
</tr>
</table>
</body>
</html>
este ejemplo lo tengo en la liga:
www.aguademexico.com.mx/ ..._kml5.html
espero me puedas ayudar