how to setup google earth tour auto run after applying KML in google earth -
i have generated kml google earth tour,
every time need click "start tour" run tour.
i expect after loading kml file tour should run without user intervention , should repeated automatically.
could 1 help? 1 please
thanks & regards, pica
here enclosed 1 simple tour application. start automatically without human intervention. if want know more google earth api tour ,see link. https://developers.google.com/earth/documentation/touring
<html> <head> <title>sample tour in google earth plugin</title> <script src="https://www.google.com/jsapi"> </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"); function init() { google.earth.createinstance('map3d', initcb, failurecb); } function initcb(instance) { ge = instance; ge.getwindow().setvisibility(true); ge.getnavigationcontrol().setvisibility(ge.visibility_show); var href = 'http://developers.google.com/kml/documentation/kmlfiles/complete_tour_example.kml'; google.earth.fetchkml(ge, href, fetchcallback); function fetchcallback(fetchedkml) { // alert if no kml found @ specified url. if (!fetchedkml) { settimeout(function() { alert('bad or null kml'); }, 0); return; } // add fetched kml earth instance. ge.getfeatures().appendchild(fetchedkml); // walk through kml find tour object; assign variable 'tour.' walkkmldom(fetchedkml, function() { if (this.gettype() == 'kmltour') { tour = this; ge.gettourplayer().settour(tour); ge.gettourplayer().play(); return false; } }); } } function failurecb(errorcode) { } google.setonloadcallback(init); </script> </head> <body> <div id="map3d" style="height: 400px; width: 600px;"></div> </body> </html>
Comments
Post a Comment