Results 1 to 8 of 8

Thread: Using COM interfaces to drive Google Earth

  1. #1
    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]

  2. #2
    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) ?

  3. #3
    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.

  4. #4

    Default

    Hmm, that looks interesting.
    Any idea what other functionality is available through the com interface?

  5. #5

  6. #6
    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.

  7. #7
    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?

  8. #8
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •