Gribo Posted November 12, 2013 Report Share Posted November 12, 2013 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 1 Quote Link to comment
jcarmody Posted November 12, 2013 Report Share Posted November 12, 2013 I'm missing the example VI from the project. Quote Link to comment
Gribo Posted November 12, 2013 Author Report Share Posted November 12, 2013 Added an API test file. It draws a circle, animates it and creates a marker. Quote Link to comment
Gribo Posted November 25, 2013 Author Report Share Posted November 25, 2013 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;} Quote Link to comment
Gribo Posted November 25, 2013 Author Report Share Posted November 25, 2013 This is a dead end code. Websockets are the future. I will post the last update next week. Quote Link to comment
Gribo Posted December 3, 2013 Author Report Share Posted December 3, 2013 The 0.7 update was posted. This tool is useful for a proof of concept only, to show geo spatial information generated from LV. The Javascript side of the project needs some more work (Paths, better JSON support). Quote Link to comment
Ton Plomp Posted December 20, 2013 Report Share Posted December 20, 2013 I get an error stating that ther is an error on the script, and a message from Google that there is no API key. Otherwise it looks promising. Especially if you move it into an XControl with methods to add data! Ton Quote Link to comment
Gribo Posted December 27, 2013 Author Report Share Posted December 27, 2013 (edited) You need to get your own Google maps API key, it is free. You are not supposed to share it with others. Also, this http://lavag.org/topic/17870-lv-google-maps-via-web-sockets/ The API key string is located in the HTML document. Edited December 27, 2013 by Gribo Quote Link to comment
Tushar Kant Roy Posted January 15, 2014 Report Share Posted January 15, 2014 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. Quote Link to comment
Gribo Posted January 15, 2014 Author Report Share Posted January 15, 2014 Hello, I have stopped supporting this code, please use the web socket one, for better functionality. I have only tested the .NET VIs under windows XP 32 bit with LV2011, and didnt manage to recreate this error. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.