Example Code

Get Dynamic Google Maps on the Front Panel of LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Description

If you need to interact with Google Maps API in your LabVIEW project in order to display the map and move it (zooming, shifting the map with the mouse, placing markers, so on), NI provides an already created project for interfacing the Google Maps API, but now Google makes the API keys paid. If you have a Google Maps API Key, you can download the GMaps API. In case if you don't have a Key, you can interface Google Maps through ActiveX control. Place an "ActiveX Web Browser" control on the front panel by Right-click >> .Net & ActiveX >>  Web Browser.


photo.jpg



On the Block Diagram, place an "ActiveX" Invoke Node by Right-click >> Connectivity >> ActiveX >> Invoke Node (ActiveX).


photo.jpg



Wire the "WebBrowser" Control to the Invoke Node (ActiveX), click on the Method, and select "Navigate"


photo.jpg


Add Google Maps URL to the "URL" input of an "Active X" Invoke Node 

In the end, place a "Close Reference" node by going Connectivity >> ActiveX >> Close Reference from the Block Diagram.


photo.jpg



Additionally, you can place a "while loop" before closing the reference so the Google Maps will be able to update continuously.

In the end, you should have a block diagram, similar to the following screenshot:

photo.jpg

 

Related Links

 

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.