Google Earth Hacks Forums  

Go Back   Google Earth Hacks Forums > Google Earth > Using Google Earth

Using Google Earth Questions about how to use it, strange quirks you've found, etc.

Reply
 
Thread Tools Display Modes
Old 07-02-2005, 03:54 PM   #1
gmenhorn
Junior Member
 
Join Date: Jul 2005
Location: Atlanta, GA
Posts: 1
Default Using COM interfaces to drive Google Earth

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.

Code:
#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]
gmenhorn is offline   Reply With Quote
Old 07-11-2005, 01:16 PM   #2
luca1974
Junior Member
 
Join Date: Jul 2005
Posts: 1
Default

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) ?
luca1974 is offline   Reply With Quote
Old 08-17-2005, 05:12 AM   #3
Jamalex
Junior Member
 
Join Date: Aug 2005
Posts: 1
Default Using VB

Hi,

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

Code:
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.
Jamalex is offline   Reply With Quote
Old 08-17-2005, 02:48 PM   #4
Captain Chickenpants
Junior Member
 
Join Date: Jul 2005
Posts: 13
Default

Hmm, that looks interesting.
Any idea what other functionality is available through the com interface?
Captain Chickenpants is offline   Reply With Quote
Old 08-17-2005, 04:35 PM   #5
Captain Chickenpants
Junior Member
 
Join Date: Jul 2005
Posts: 13
Default

Hmm, just found these two. Could make things very interesting.

http://simonchapman.blogspot.com/200...n_archive.html
http://stevemargetts.blogspot.com/20...m-jscript.html


Paul.
Captain Chickenpants is offline   Reply With Quote
Old 08-29-2005, 11:25 PM   #6
edraven
Junior Member
 
Join Date: Aug 2005
Posts: 1
Default Gps?

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.
edraven is offline   Reply With Quote
Old 09-28-2005, 06:03 PM   #7
joey_442
Junior Member
 
Join Date: Sep 2005
Posts: 1
Default Calling SaveScreenShot?

Any figured out how to get SaveScreenShot to work? I've tried and it seems to have a problem with the "quality" parameter?
joey_442 is offline   Reply With Quote
Old 11-11-2005, 12:17 PM   #8
maft00
Junior Member
 
Join Date: Nov 2005
Posts: 1
Default GE controlled by JScript?

Could anybody describe, how the Script on this site works?

http://stevemargetts.blogspot.com/20...m-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
maft00 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:57 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.