06-09-2022 02:01 AM
Hi, please advise.
I have GPS coordinates, which I display in CVI in WebBrowser (Picture 1)
But I have two coordinates and I would like to see the distance between these points on the map as soon as I press the "Search" button. (picture 2)
Don't you know how I should program it in CVI?
(Note: I would also not like to see information on the map, legends, searches, etc. just a clear map).
Thank you very much for your help 🙂
Project Here:
06-10-2022 03:21 AM
That's clearly a Google Maps API problem. It has nothing to do with LabWindows/CVI but simply requires you to add the right parameter options to the WebURL (provided the Google Maps WebAPI supports such parameters). I have no idea if it does but this is something you need to take up with the Google Maps support forum or whoever provides support for this.
06-10-2022 03:29 AM
I understand LabWindows isn't completely built for that, but I wanted to give it a try. It would help me in working with the location and direction of the azimuth.
One specific point will appear to me, but two is already a problem. Radians are also used in WebURL, so I'm currently trying to see if it will work.
If it was only possible to add coordinates to a specific WebURL and the browser would add the rest itself, it could work.
Thank you for your willingness
06-10-2022 04:05 AM - edited 06-10-2022 04:06 AM
@MajklS wrote:
I understand LabWindows isn't completely built for that, but I wanted to give it a try. It would help me in working with the location and direction of the azimuth.
One specific point will appear to me, but two is already a problem. Radians are also used in WebURL, so I'm currently trying to see if it will work.
If it was only possible to add coordinates to a specific WebURL and the browser would add the rest itself, it could work.
It's not that LabWindows/CVI isn't built for that. No software package out there is out of the box. This is a feature that the Google Maps API would have to support and WebAPIs rely on the fact that parameters are usually passed to the WebAPI through the URL, either as path elements (an URL can encode parameters in the URL path itself sometimes) or as real URL Parameters (that are those pesky elements at the end of an URL that come after the ? (questionmark). Google Maps chose yet another option to add the coordinates with a @ (ampersand) sign as an extra path element.
If the API doesn't support a certain features that you would like to have you can spring high and low, and use .Net, Java, C, LabVIEW or whatever but it will simply not be possible to do. It's entirely independent of the used programming environment.
Maybe the Google Maps API supports adding two coordinate pairs after 2 parameter elements starting with an @ sign? I don't know and chances are not so great but it could be possible. It is what the Google developer implemented on their Maps server infrastructure that determines what you can do with it. And it should be documented in the Google Maps WebAPI documentation if and what can be done. This forum is definitely not the best place to ask as you are just hoping for the very unlikely chance that there is a LabWindows/CVI developer who has used WebAPI for Google Maps already (not so unlikely) and wanted to do the same thing you want to do (very unlikely). A dedicated Google Maps support forum has a much higher chance to give you an answer IF it can be done at all. They are of course very unlikely to know what LabWindows/CVI is, but once someone can point out an example in C# or Java or whatever that can do it, it is fairly easy to apply that to your LabWindows/CVI program.
06-10-2022 04:12 AM
I would suggest you to use Maps Static API from Google that should permit you to place two markers on the map by preparing an appropriate URL, but it's not for free: as you can see in the overview you must enable a plan for maps usage. Be prepared for this before starting to consider using these APIs.
06-10-2022 04:16 AM
Thanks for the clarification, I was just wondering if anyone had tried to apply it or encountered the same problem.
06-10-2022 04:17 AM
Thank you, I've come across this before, I'll try to read something about it.
06-28-2022 03:01 AM
Not sure how to prepare a suitable URL?
I won't do it in WebBroswer, but I'll open the browser via a button, but I have to enter the exact URL with points A and B.