We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProcessing DevelopmentLibraries,  Tool Development › Google Earth API via jacob.dll
Page Index Toggle Pages: 1
Google Earth API via jacob.dll (Read 3999 times)
Google Earth API via jacob.dll
Mar 20th, 2008, 10:23am
 
hello

for developping my project
http://earth.1000lieues.net

I have found a method to call to the Google earth API
(alas under windows only)
to be able to get/set the camera position
loading kml data or other stuffs

you need the jacob.dll and jar
download here  http://danadler.com/jacob/

special usage :

- during the developpement
you have to put the both files
jacob.dll
jacob.jar
in a code folder of your sketch folder

- for building application
to avoid an error, move jacob.dll in the root sketch folder

after building, copy the dll at the same level of .exe


an exemple code :

////
//Flying over Gao
//by cdriko
void draw(){

 ///definition of values  
 float tilt =15;
 float heading = 0;
 float sec=(millis()/3000.);
 float longitude = 0.051*cos(sec);
 float latitude=16.22+(0.051*sin(sec));
 float altitude=10000;

 ///call to googleEarth
 Dispatch googleEarth = new Dispatch("GoogleEarth.ApplicationGE");

 Dispatch.call(googleEarth,"SetCameraParams",new Variant(latitude),new
   Variant(longitude),new Variant(altitude),new Variant(1),new
   Variant(100),new Variant(tilt),new Variant(heading),new Variant(5));

}
//////



you can found more infos about the fonctionality of api here:
http://groups.google.com/group/kml-support-com-api/topics?hl=en

and the api doc :
http://earth.google.com/comapi/interfaceIApplicationGE.html
Re: Google Earth API via jacob.dll
Reply #1 - Mar 20th, 2009, 3:09pm
 
Thank you for interesting information!!
I'm install jar and dll, but when I try run sketch that you share - I have this:
"Cannot find a class or type named 'Dispatch'"...
Where I'm wrong?

thanks!
Re: Google Earth API via jacob.dll
Reply #2 - Mar 28th, 2009, 12:26am
 
hello
verify if you have GoogleEarth opened before launching the sketch.
and try various positions for dll and jar (inside code folder, at the same level of sketch, and [with the last version of processing] in the library folder of your sketchbook)
It's since a long time that I don't used this dll, but, maybe try to explicit import, like another library :

Code:

import com.jacob.com.*;
import com.jacob.activeX.*;
Page Index Toggle Pages: 1