From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Viewing google earth maps in labview

Hello

 

I am currently doing a project where we I need to be able to control and view google earth from labview.

I have already seen and played with the "google earth - lv" - LLB file posted on the forum, which gives me the capacity to input GPS data etc to google earth; but I also need to be able to import the real-time image back from google earth - back to labview.

 

The image will form a "moving map" as part of an reconfigurable aircraft cockpit simulator I am creating.

 

Is this possible through Active X, embedded objects etc?

I am fairly new to labview and its full capabilities so any help would be much appreciated.

 

Cheers

 

Adam

0 Kudos
Message 1 of 29
(9,820 Views)

Hi Adam,

 

Just to let you know I am looking into this for you.  I think I am getting close but it is proving tricky.  There is a way to get the OLE reference for the window and then embed it into programs.  I have found an example to do this in C# and trying to convert this to LabVIEW.  I think I am quite close just struggling to get the last bit working.  Basically there is a type called stdole.Picture which I believe should accept the handle that GetMainHwnd and then we end up with a reference to put into an activeX image but I am struggling to get past a couple of errors at the moment but will let you know when I make any progress.

 

Regards,

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
Message 2 of 29
(9,769 Views)

Hi James

 

Thanks for your efforts and I look forward to hearing something from you in the near future.

 

Regards

Adam

0 Kudos
Message 3 of 29
(9,729 Views)

Hi Adam,

 

I've done it!  After quite a while tinkering I have managed to get the render window to embed although it is a slight work around.  Normal LabVIEW controls don't have proper Window's window handles but ActiveX controls do.  By putting down an internet browser control I could then use the Windows API to access the window handle for this control through a couple of dll calls and then embed the GE render window in this  This effectively just moves the display from Google Earth to LabVIEW and you will notice that it has dissappeared from the Google Earth window.  This means that you simply manipulate it in the same way with the libraries you have found.  The code is a bit messy and wont handle resizing and I intend to sort this out tomorrow but for the time being here it is!

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
Message 4 of 29
(9,690 Views)
What you have described would be very usefull for me to use in a current project. Please continue while I badger my management for an upgrade to 8.6. Meanwhile, can this be done in 8.5?
0 Kudos
Message 5 of 29
(9,669 Views)

Hi,

 

I have commented the code and saved it back to 8.5 for you.  It should be back compatible as the clever stuff is done by the Windows API rather than in LabVIEW.  The reason this was tricky is that we needed a Window's window to place the render window in.  Normal LV controls do not have their own window however initialised ActiveX windows do.  So I have simply placed a web browser control that creates a window whos handle we can get and place the render window inside.  It may be possible to create one from scratch in code but this would require much more work.

 

I tried to add code so that resizing the control would resize the view but could not get this working however resizing the Google Earth window also resizes the render view.

 

Hope this helps.  In the near future I may try and pick this up again and improve on this e.g. add mouse functions and resizing but unfortunately do not have time now.  However if you do make any improvements yourself please post it here as it seems there is a lot of interest in this.


Regards,

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
Message 6 of 29
(9,642 Views)

James

 

Thanks again for the VI code. I am finally trying to integrate my cockpit together but I am having difficulty running the labview 8.5 VI.

I get the following errors:

1. Invoke Node: Invalid Method

The method selected in the invoke node is invalid or no method has been selected.  Right-click the invoke node and select a method.

2. Wire: Class Conflict

u have connected a refnum of one type to a refnum of another type and both types are members of some class hierarchy, but there is neither a simple up cast nor type cast between the two classes.

 

3. Front panel terminal "web browser": unwired front panel teminal

 

Appreciate any pointers on what i need to change.

 

Thanks

 

Adam

0 Kudos
Message 7 of 29
(9,492 Views)

Hi Adam,

 

1 and possibly 2 sounds like you need to reselect the ActiveX class.  To do this right click on the GE refnum and go to select ActiveX class >> browse.  Then find the reference for GE Application.  On my system I need to select Earth 1.0 from the top dropdown box and then you will need to select the ApplicationGE object that appears under this.  This requires that Google Earth is already installed on the machine.

Number 3 is just a warning and will not prevent the program running.

 

I hope this solves the issue but let me know if not.


Regards,

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
Message 8 of 29
(9,462 Views)

Hi James

 

It seems the ActiveX was set incorrectly but I still get the same error even when I reset it.

I think that it maybe the invoke node but i dont fully understand what what its doing.

 

I have attached a screen shot to try and make it a bit easier to understand what is going off.

 

Thanks again

 

Adam

0 Kudos
Message 9 of 29
(9,446 Views)

Hi,

 

It appears you have a slightler different version of the GE initialise VI than I do as it is giving an incorrect reference type out.  Please try replacing this with the one attached.


Regards,

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
Message 10 of 29
(9,439 Views)