LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control Google Earth Plugin API in Labview

Solved!
Go to solution

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

0 Kudos
Message 11 of 28
(3,647 Views)

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.

 

 

0 Kudos
Message 12 of 28
(3,634 Views)

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!

0 Kudos
Message 13 of 28
(3,389 Views)

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

http://code.google.com/apis/earth/documentation/reference/interface_g_e_plugin.html#a101705622bec3df...

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

0 Kudos
Message 14 of 28
(3,296 Views)

Hi Mr. Dangar,

    I am getting a similar error, I will take a look at whats going.

Regards,

Jig P

Best Regards,
Jignesh Patel
Principal RF Software Engineer
0 Kudos
Message 15 of 28
(3,268 Views)

Thanks for looking into this.  Please ask me if you need more details.

 

Mr Dangar.

0 Kudos
Message 16 of 28
(3,265 Views)

Hello,

    I have an example for you here: Google Earth and LabVIEW

 

Regards

Jig P

Best Regards,
Jignesh Patel
Principal RF Software Engineer
0 Kudos
Message 17 of 28
(3,246 Views)

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.

0 Kudos
Message 18 of 28
(3,237 Views)

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. 

 

Regional Account Manager
NI
0 Kudos
Message 19 of 28
(3,206 Views)

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!

0 Kudos
Message 20 of 28
(3,037 Views)