What its all about:
Google Earth can be controlled through javascripting the API on a webpage. Linking a Google Maps implementation with Google Earth and exchanging data between the two, from ONE and the same webpage, is possible.
The point is to include the Google Earth activeX object
Code:
<object classid="clsid:AFD07A5E-3E20-4D77-825C-2F6D1A50BE5B" id="googleEarth"></object> or
scripted conrol var googleEarth = new ActiveXObject("Keyhole.KHInterface.1");
on the same page as the Google Maps Script control.
On ActiveX security settings: In order to get the ActiveX working, one should change the setting "Initialize and perform scripting activities for NOT marked as safe ActiveX Objects" to 'Ask' instead of 'disabled'. This way each time the page loads the question 'Allow the (possibly unsafe) ActiveX to work' will be asked. This is true for the default settings in all the Zones (Internet, Loca network and trusted sites) as all will have this setting set to disabled by default. This way Google Earth can be
controlled from the (Google Maps) webpage using GE API functions, methods and properties.
Using IE's HTML+TIME behavior it is also easy to
animate Google Earths interface from that same webpage (To fly to a new destination(Lat and Lon seperate), to animate the View altitude, the tilt and the azimuth(heading)).
Google Earth can also be
closed by script from the webpage and will re-launch when the webpage loads.
It is possible to
open files KML/KMZ/GPX from local PC. SO far I didnot succeed to open them from the Web.
Update Dec 1st: I succeeded in loading a KML file as a string from the webpage into Google Earth. That should make it very easy to do an XSLT transformation through scripting on the page an send the string result to GE using the LoadKML(string) function.
I will test that today Dec 1st.
One can
take a Black and White Screen dump JPG image and save it to disc. (On the demo page, I show it in a popup and save it to C:/ with a sequential number).
One can
retrieve from Google Earth the Lat/Lon, Range, Titlt and Azimuth of the current viewpoint. This data can then be used for Google Maps display. I will try to write a script which retrieves Google Earth track points and combine them to a Google Maps VML vector polyline to be displayed instantly on the Google Maps map.
Succeeded in cliking the google map and having goole Earth to fly to that point.
My demo page which can change by the minute as I work on it as we speak, is at:
Bridging GMaps and GEarth by script - a demo page by Cybarber or can be reached through the link on attached KML.
Happy Flying,
William A Slabbekoorn aka Cybarber