07-18-2010 04:05 PM - edited 07-18-2010 04:09 PM
Sorry, I forgot...
In both cases, what is needed to install in order to be able to use their classes with methods and properties in LabView?
When I select "Select Class" in a property node or invoke node, and then ActiveX, I get two different groups of classes: those whose names begin with "EarthLib" and those with "GEPlugin". Are these classes, with their methods and properties, the same related in the documentation for both APIs? I'm sorry these questions are too basic, but I don't have yet clear the topics about APIs, classes, ActiveX, etc. in LabView.
Thanks,
Francisco
07-18-2010 09:52 PM
Yes, you've got the major differences right.
This thread is all about controlling the Google Earth application:
http://forums.ni.com/t5/LabVIEW/Google-Earth-With-LabVIEW-8-0/m-p/456696
Unless you can find a way to put Google Earth into an ActiveX container and control it like "tbd" did above, you may just have to settle for launching Google Earth externally. You don't have to launch both separately since you can programatically open and close the GE application with the methods shown in the above thread.
02-03-2011 07:30 PM
Hmm, this is all very interesting.
I have experimented using the COM api, but I couldn't make it do everything I wanted it to, mainly update the location of a placemark.
tbd seems to have hit the nail on the head using the new API, it appears to be a different activeX class to the comAPI.
I'm yet to figure out how to open GE with it.
The start_ method used in tbd's VI doesn't appear to be described in the google doco. It requires 2 inputs, the MainDatabaseURL and the Language.
I've tried using 'kh.google.com' and 'en' (quotes included seems to reduce errors) as the input strings.
If anyone can figure out how to link get a window happening please post!
03-09-2011 05:24 AM
I just can't seem to get this working. The sticking point still seems to be the start_() function.
I am using Labview 10.0, Google Earth 6.0.0.1735, with the plugin version 1.007. The default indicator values are what I get when I run it.
With the attached VI, the getApiVersion method works.
The setDiv_ method appears to work when the WebBrowser is passed and auto-converted to a variant, as the getDiv_ returns a variant with sensible data when converted back to a WebBrowser reference.
The getJavascriptInitCode_ method returns an almighty mess of javascript code, there may be some clues in that for those who 'know'
The getPluginVersion method returns the 6.0.0.1735 string, which is to be expected. The getEarthVersion method returns 'uninitialized'.
This what the API reference
states:
| string GEPlugin.getEarthVersion | ( | ) |
Used for debugging purposes; if this value is not equal to the value returned by getPluginVersion then there is a misconfiguration on the end user's system. This check is automatically done during plugin instantiation.
Now the start_() function appears to be related to the google.earth.createInstance function, which has optional parameters for database and language. When you select the start_ function in a Labview activeX invoke node it automatically puts up the database and language inputs. Wiring empty strings does not work for me, and of course wiring nothing to either of them gives an error. For some reason it seems to work better with the quotes around 'en', that is, it just doesn't work rather than throwing an error. But really, I have no idea. The database string comes from this page:
http://code.google.com/apis/earth/documentation/sky_mars_moon.html
If someone can get this working, we would all be well on our way to developing standalone applications like Monster Milktruck (google it - it is really cool. And pretty much what I want to do - driving around the earth, but with a custom USB device controlling rather than the keyboard. And the javascript source code is available (right click, show page source) , which may help get it working in Labview. I have successfully copied all the source code over to my PC and have the javascript running locally with a bit of tweaking). All the methods and properties of this activeX class are documented on the google website. I'm sure we are close.
http://code.google.com/apis/earth/documentation/reference/google_earth_namespace.html
03-10-2011 03:17 PM
Hi Mr. Dangar,
I am getting a similar error, I will take a look at whats going.
Regards,
Jig P
03-10-2011 03:59 PM
Thanks for looking into this. Please ask me if you need more details.
Mr Dangar.
03-11-2011 01:14 PM
Hello,
I have an example for you here: Google Earth and LabVIEW
Regards
Jig P
03-11-2011 02:36 PM
Thanks Jig,
That example is using the old COM API that is no longer supported. What I am trying to get working is the plugin API. This is built around Javascript, but has methods as shown in the VI I posted. It has much more functionality than the COM API. Also, the COM API has a reputation for running slow for no particular reason. The rest of this thread describes it pretty well.
Daniel.
03-15-2011 10:55 AM - edited 03-15-2011 10:55 AM
Hi Mr Danger,
I'm going to assume you've already seen this, but just in case: http://forums.ni.com/t5/LabVIEW/Control-Google-Earth-Plugin-API-in-Labview/td-p/802199 deals with the plugin, but I believe an older version of GE. It might be possible to adjust this to fit your needs.
06-01-2011 06:48 AM
Woohoo! I've finally found the answer.
One must call the setNoPairing_ method before calling start.
Example startup subvi attached.
To use it, put a web browser control on the front panel of your VI, right click it, add activeX object, class GEPluginCoClass.
Voila!