PDA

View Full Version : Using COM interfaces to drive Google Earth



gmenhorn
07-02-2005, 02:54 PM
Simple manipulation of the view. Could be driven by a GPS for example. The range parameter, I believe, is either meters or feet above ground. The other parameters are obvious.



#import "C:\program files\Google\Google Earth Pro\GoogleEarth.exe" no_namespace, named_guids


int main(int argc, char* argv[])
{
CoInitialize(NULL);

IKHInterfacePtr smpGoogleEarth(__uuidof(KHInterface));

IKHViewInfoPtr smpKHViewInfo = smpGoogleEarth->currentView;

smpKHViewInfo->latitude = 34.0;
smpKHViewInfo->longitude = -84.0;
smpKHViewInfo->range = 20000;
smpKHViewInfo->tilt = 70;

smpGoogleEarth->setView(smpKHViewInfo, 10);

return 0;
}
[/code]

luca1974
07-11-2005, 12:16 PM
Hi,
I'm a newbye to this forum, and to googleearth too.
I'm trying to "embed" googleearth in an Access application; can you explain me how to change view settings using VBA (or VB) ?

Jamalex
08-17-2005, 04:12 AM
Hi,

Gmenhorn's code can easily be adapted to VB code. Try something like this:



Dim KH As Object
Dim View As Object
Set KH = CreateObject("Keyhole.KHInterface")
Set View = KH.currentView
View.latitude = View.latitude + 0.1
View.longitude = View.longitude - 0.1
View.azimuth = View.azimuth - 1
View.range = View.range + 1
View.tilt = View.tilt - 1
' (or do whatever else you want with the view in here)
KH.setView View, 10 ' (or another speed)

Cheers,
Jamie.

Captain Chickenpants
08-17-2005, 01:48 PM
Hmm, that looks interesting.
Any idea what other functionality is available through the com interface?

Captain Chickenpants
08-17-2005, 03:35 PM
Hmm, just found these two. Could make things very interesting.

http://simonchapman.blogspot.com/2005_07_01_simonchapman_archive.html
http://stevemargetts.blogspot.com/2005/07/controling-google-earth-from-jscript.html


Paul.

edraven
08-29-2005, 10:25 PM
I'd love to have an app that continually reads the NMEA from my GPS, and updates the location on google earth. Bonus points to get tilt in the direction you're moving.

joey_442
09-28-2005, 05:03 PM
Any figured out how to get SaveScreenShot to work? I've tried and it seems to have a problem with the "quality" parameter?

maft00
11-11-2005, 12:17 PM
Could anybody describe, how the Script on this site works?

http://stevemargetts.blogspot.com/2005/07/controling-google-earth-from-jscript.html

On my PC, GE will be opened, but I can't tranfer the coordinates to GE.
There is an error-message: "Object doesn't support this property or method".

Hopefully

Maft00