Ver Mensaje Individual
  #3 (permalink)  
Antiguo 27/01/2011, 14:02
Avatar de mveraa
mveraa
 
Fecha de Ingreso: diciembre-2002
Ubicación: santiago-chilito
Mensajes: 1.931
Antigüedad: 21 años, 4 meses
Puntos: 2
Respuesta: problema con variable en explorer

<html>
<head>
<title></title>
<script src="http://www.google.com/jsapi?key=ABQIAAAA5XMAfghfghghfuknnnnnfghGFzF1xR6E RhFK9O5wiV4tdD4WW532VJ0zA"> </script>
<script src="http://earth-api-samples.googlecode.com/svn/trunk/lib/kmldomwalk.js" type="text/javascript"> </script>
<script type="text/javascript">

var ge;
var tour;


google.load("earth", "1");
// google.load("maps", "2.x");

function init() {
google.earth.createInstance('map3d', initCB, failureCB);





}

function initCB(instance) {
ge = instance;
ge.getWindow().setVisibility(true);
ge.getNavigationControl().setVisibility(ge.VISIBIL ITY_SHOW);
ge.getLayerRoot().enableLayerById(ge.LAYER_ROADS, true);
//ge.getOptions().setAtmosphereVisibility(true);

var href = 'http://www.ii.cl/t/oficial/ln.kml';
google.earth.fetchKml(ge, href, fetchCallback);


var streamingPercent = ge.getStreamingPercent();



function fetchCallback(fetchedKml) {
// Alert if no KML was found at the specified URL.
if (!fetchedKml) {
setTimeout(function() {
alert('Bad or null KML');
}, 0);
return;
}

// Add the fetched KML into this Earth instance.
ge.getFeatures().appendChild(fetchedKml);








// Walk through the KML to find the tour object; assign to variable 'tour.'
walkKmlDom(fetchedKml, function() {
if (this.getType() == 'KmlTour') {
tour = this;
return false;
}
});
}
}

function failureCB(errorCode) {
}

// Tour control functions
function enterTour() {
if (!tour) {
alert('No tour found!');
return;
}
ge.getTourPlayer().setTour(tour);
}
function playTour() {
ge.getTourPlayer().play();
}
function pauseTour() {
ge.getTourPlayer().pause();
}
function resetTour() {
ge.getTourPlayer().reset();
}
function exitTour() {
ge.getTourPlayer().setTour(null);
}







google.setOnLoadCallback(init);

function carga() {
var streamingPercent = ge.getStreamingPercent();
//alert(streamingPercent);

document.forma.load.value =streamingPercent;






}



setInterval("carga()",100);
</script>
</head>
<body >


</body>
</html>

<form name="forma">
Load:<input type="text" name="load" size="1" readonly="">%
</form>





<div id="map3d" style="height:550px; width: 700px;"></div>
<div id ="controls">
<input type="button" onClick="enterTour()" value="Ingrese al tour"/>
<input type="button" onClick="playTour()" value="Inicio Tour"/>
<input type="button" onClick="pauseTour()" value="Pausa Tour"/>
<input type="button" onClick="resetTour()" value="Reset Tour"/>
<input type="button" onClick="exitTour()" value="Salida Tour"/>
</div>

</body>
</html>
__________________
"Cuando se adelanta un oponente, enfréntalo y salúdalo; si intenta retroceder, déjalo seguir su camino"