Jump to content

[CR] Labview <-> Google maps VI


Recommended Posts

index.php?app=downloads&module=display&section=screenshot&id=234

Name: Labview <-> Google maps VI

Submitter: Gribo

Submitted: 12 Nov 2013

Category: *Uncertified*

LabVIEW Version: 2011

License Type: BSD (Most common)

Connects to google maps javascript V3 api using the web browser .NET object (it exposes the HTML DOM model, where as the ActiveX control does not). This is an improvement over the examples from NI, as it allows dynamic adjustments to all of the map objects. Currently, only circle and marker are implemented.

Click here to download this file

  • Like 1
Link to comment
  • 2 weeks later...

I am stuck. Trying to get the next function (Polylines) to work is quite complex. I need to pass an array of coordinates (Latitude, Longitude) to the browser, but cannot get it to understand JSON objects. Does anyone have an advise regarding this? Taking it one step at a time, I am trying to pass a single coordinate cluster. Below is the Javascript code:

 

 

function addmarkerJSON (Pmap, latlng, Title){//var Platlng = eval ('('+latlng+')');var Platlng = JSON.parse (latlng,function (key, value) {    var type;    if (value && typeof value === 'object') {        type = value.type;        if (typeof type === 'string' && typeof window[type] === 'function') {            return new (window[type])(value);        }    }    return value;});var options = {position: new google.maps.LatLng(Platlng.lat,Platlng.lng),map: Pmap,title: Title};alert(Platlng.lat);PMarker = new google.maps.Marker (options);return latlng.lat;}

 

 

post-46572-0-21362000-1385383945_thumb.p

Link to comment
  • 3 weeks later...
  • 3 weeks later...

hi

 i was trying out your code. I have added a while with a time delay of 2 secs in the man VI. It works brilliantly the first time but as it starts for the second time it shows an error message in the error indicator. The error message is given below:

Invoke Node Error calling method System.Windows.Forms.WebBrowser.Navigate, (System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
Inner Exception: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'WebBrowser'.) <append><b>System.ObjectDisposedException</b> in NET browser init.vi->google maps API test.vi
An error is propagated by the browser init.vi. When the sub vi is run independently it runs fantastically without any error. This error only comes when the main vi is run. Please help.
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.