LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

OpenStreetMap GPS track

Good Morning.

 

I am trying to plot or track a GPS coordinates in a open source map (in this case OpenStreetMap).

 

Everything goes fine but the map des not refresh to the latest position. Probably I am doing something wrong...

map1.jpg

 

map2.jpg

 

I found several interesting online maps like opensemap but when I try to insert it one error message appear

seamap.jpg

I think is because is a JavaScript map, do you know how I could integrate in a LabView???

 

Any help is wellcome!!

 

PD: I am very new with LabView and I have no idea about JavaScript!!!

 

Best!

0 Kudos
Message 1 of 10
(2,487 Views)

Hi Manu,

 


@ManuParedes wrote:

Everything goes fine but the map des not refresh to the latest position. Probably I am doing something wrong...


I guess that's because of heavy overuse of local variables: use wires instead of locals!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(2,480 Views)

I tried the dot net browser instead of the activx based iwebbrowser2 using the snippet from here

 

This will also result in a javascript related error - which is du to openstreetmaps.org

in some case, you can even navigate to the openastreetmaps javascript - that threw the error - and have a look on it, if you want to scare yourself e.g. 

https://opentopomap.org/leaflet/leaflet.elevation/d3.min.js

 

Bur surprise... the donet browser can render an interactive(!) googlemaps map ... 

 

dotnetbrowser_googlemaps.png

 

 

I am pretty sure you meant to acquire a licence to use google maps commercially ...

0 Kudos
Message 3 of 10
(2,464 Views)

Hi GerdW.

 

I trid to put direct cables and seems the same!

0 Kudos
Message 4 of 10
(2,459 Views)

@ManuParedes wrote:

Hi GerdW.

 

I trid to put direct cables and seems the same!


why don't you attach your .vi or post a real snippet?

 

so, I type in the url from your screenshot ... and it also works in the dotnet browser ... I am not going to use the deprecated active x browser

 

https://www.openstreetmap.org/?mlat=43.264721&mlon=-8.633333#map=16/43.264721/-8.633333

 

 

initialize the dotnet container before entering the while loop.

 

the initilized container will be responsive, also when the while loop is not executed.

 

the while loop is needed to refresh the container and to keep the .vi running ...

to refresh, you apply an event structure - e.g. linked to the url string control via "value changed?" -  inside the while loop.

 

 

 

 

 

0 Kudos
Message 5 of 10
(2,439 Views)

turns out - via trial and error -  to refresh the dot net browser control inside the while loop - in terms to render a new url via a labview control and the Navigate Methode - the ResetImeMode must be executed.

 

like this:

alexderjuengere_0-1647213393412.png

 

0 Kudos
Message 6 of 10
(2,388 Views)

....and it doesnt work anymore in 2023 - using the same .vi in labview 2020 64bit

 

 

 

I hate database driven web development

0 Kudos
Message 7 of 10
(1,356 Views)

@alexderjuengere wrote:

....and it doesnt work anymore in 2023 - using the same .vi in labview 2020 64bit


You likely will be happier by using WebView2 instead of WebBrowser! What's the difference you may ask?

 

Well, WebBrowser is the interface to the old Internet Explorer engine. Aside from being terribly insecure to browse our modern internet nowadays, you are also likely to run into all kind of Java Script and other errors rather sooner than later.

 

WebView2 interfaces to the the Edge engine, a modern and much safer method to go onto the internet.

 

Internet Explorer is as far as I know only a 32-bit application, so not very surprising that you can not interface to it from 64-bit LabVIEW.

Rolf Kalbermatter
My Blog
Message 8 of 10
(1,324 Views)

@rolfk wrote:


You likely will be happier by using WebView2 instead of WebBrowser!


An it turns out: no javascript errors, when navigating via webview2 to

 

https://www.openstreetmap.org/?mlat=43.264721&mlon=-8.633333#map=16/43.264721/-8.633333

 

alexderjuengere_0-1700739506344.png

 

source:

 

downloading the nuget file via download package and extracting the contents with 7zip before running the vi. posted in

https://forums.ni.com/t5/LabVIEW/How-to-use-WebView2-control-in-LabView/m-p/4262663#M1241417

 

 

this works for me in ms windows 11 pro 23H2, MS Edge WebView2 Runtime Version 114.0.1823.79 (Offizielles Build) (64-Bit),

alexderjuengere_1-1700739918124.png, and dot net 6.0:

alexderjuengere_2-1700740307594.png

 

Most of this stuff was already installed on that computer e.g. via windows updates.

--------------------

I also tested on a Windows 10 computer, but with no success which might be due to a different version of Edge, the EDGE WebView2 Runtime or the dot net sdk.

Others had similar issues to e.g. here

 

 

0 Kudos
Message 9 of 10
(1,269 Views)

@alexderjuengere wrote:

I also tested on a Windows 10 computer, but with no success which might be due to a different version of Edge, the EDGE WebView2 Runtime or the dot net sdk.

Others had similar issues to e.g. here

 

 


and it works with windows 10 22H2, .net sdk 6.0, 

alexderjuengere_1-1700761022390.png

 

 

alexderjuengere_0-1700760949177.png

 

0 Kudos
Message 10 of 10
(1,251 Views)