Are there any wxWidgets based application/widiget to show maps and GPS tracks
Are there any wxWidgets based application/widiget to show maps and GPS tracks
Hi, I have a USB GPS receiver, which I can receive the GPS information from the "virtual serial port".
Now, I would like to show the GPS position in a map(such as a street in the city), when searching on the internet, I see there is a page: https://wiki.openstreetmap.org/wiki/Software/Desktop
Which contains a lot of applications, but a lot of the applications are out-dated.
One similar application is: OpenCPN/OpenCPN: A concise ChartPlotter/Navigator. https://github.com/OpenCPN/OpenCPN, but this is generally for sea navigations, so my question is there is any one library/application which
1, can show GPS tracks in wxWidgets
2, can show a local(offline) maps
Thanks.
Now, I would like to show the GPS position in a map(such as a street in the city), when searching on the internet, I see there is a page: https://wiki.openstreetmap.org/wiki/Software/Desktop
Which contains a lot of applications, but a lot of the applications are out-dated.
One similar application is: OpenCPN/OpenCPN: A concise ChartPlotter/Navigator. https://github.com/OpenCPN/OpenCPN, but this is generally for sea navigations, so my question is there is any one library/application which
1, can show GPS tracks in wxWidgets
2, can show a local(offline) maps
Thanks.
Re: Are there any wxWidgets based application/widiget to show maps and GPS tracks
As we finally have a proper wxWebView on all platforms (since the arrival of wxWEBVIEW_BACKEND_EDGE for Windows), i'd try to find a browser based solution.
Use the source, Luke!
Re: Are there any wxWidgets based application/widiget to show maps and GPS tracks
Hi, thanks for the reply.
I just search the internet, there are not much pages or tutorials about using wxWebView, for me, I don't have much experience about javascript and the web/html programming, so is it hard for me to do that? I think I need some start up resources.
- evstevemd
- Part Of The Furniture
- Posts: 2409
- Joined: Wed Jan 28, 2009 11:57 am
- Location: United Republic of Tanzania
Re: Are there any wxWidgets based application/widiget to show maps and GPS tracks
Hi,
If all you want to do is load coordinates on OSM you can do
For more on wxWebview, take a look at the sample
What do you want to do with the co-ordinates exactly? That will help us propose anything we can.ollydbg23 wrote: ↑Thu Apr 29, 2021 6:30 amHi, thanks for the reply.
I just search the internet, there are not much pages or tutorials about using wxWebView, for me, I don't have much experience about javascript and the web/html programming, so is it hard for me to do that? I think I need some start up resources.
If all you want to do is load coordinates on OSM you can do
Code: Select all
wxString lat = "-6.1744";
wxString lng = "35.7475";
wxString zoom = "16"; //Street view, adjust to your taste
wxString url = wxString::Format("https://www.openstreetmap.org/search?whereami=1&query=%s,%s#map=%s/%s/%", lat, lng, zoom, lat, lng);
wxWebView* browser = = wxWebView::New();
browser-> LoadURL(url);
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
Re: Are there any wxWidgets based application/widiget to show maps and GPS tracks
Hi, many thanks.
I want to draw the path of the GPS receiver on the osm map.
The co-ordinates are the locations of the GPS receiver.
The path could be drawn as a poly line on the map.
I will try it. Thanks.If all you want to do is load coordinates on OSM you can do
For more on wxWebview, take a look at the sampleCode: Select all
wxString lat = "-6.1744"; wxString lng = "35.7475"; wxString zoom = "16"; //Street view, adjust to your taste wxString url = wxString::Format("https://www.openstreetmap.org/search?whereami=1&query=%s,%s#map=%s/%s/%", lat, lng, zoom, lat, lng); wxWebView* browser = = wxWebView::New(); browser-> LoadURL(url);
Re: Are there any wxWidgets based application/widiget to show maps and GPS tracks
Here is my test:
I'm using msys2, and I use the wx library prebuild in msys2, and it is wx 3.0.5.
I see that the webview's backend is IE.
Any way, I can create the https://github.com/wxWidgets/wxWidgets/ ... es/webview
And the application can run correctly, and I can open the https://www.openstreetmap.org/
So, the only thing I need is to call some web API(maybe javascript API), and I can add the points/track in the map. The track is dynamic, I mean I will add more points when the GPS receiver moves.
I'm using msys2, and I use the wx library prebuild in msys2, and it is wx 3.0.5.
I see that the webview's backend is IE.
Any way, I can create the https://github.com/wxWidgets/wxWidgets/ ... es/webview
And the application can run correctly, and I can open the https://www.openstreetmap.org/
So, the only thing I need is to call some web API(maybe javascript API), and I can add the points/track in the map. The track is dynamic, I mean I will add more points when the GPS receiver moves.
Re: Are there any wxWidgets based application/widiget to show maps and GPS tracks
The IE-based wxWebView backend is seriously outdated.
wxWidgets 3.1.5 offers the new Edge-based one (where new MS Edge is based on Chromium).
If you are stuck with wxWidgets 3.0, at least make sure you set the emulation level to the maximum, see e.g. here viewtopic.php?f=20&t=44405&p=182852#p182852
wxWidgets 3.1.5 offers the new Edge-based one (where new MS Edge is based on Chromium).
If you are stuck with wxWidgets 3.0, at least make sure you set the emulation level to the maximum, see e.g. here viewtopic.php?f=20&t=44405&p=182852#p182852
Re: Are there any wxWidgets based application/widiget to show maps and GPS tracks
You can communicate with the webpage using wxWebView::RunScript
https://docs.wxwidgets.org/trunk/classw ... 0d463ffb98
Search the "webview" sample (of a current wxWidgets version) for occurences of "RunScript".
And, like PB said, you definitely want the ChromiumEdge backend. I doubt any modern web component will be compatible or fully functional under IE.
Use the source, Luke!
Re: Are there any wxWidgets based application/widiget to show maps and GPS tracks
Hi, PB, thanks, I don't have MS Edge in my Windows 7 system, I use FirefoxPB wrote: ↑Thu Apr 29, 2021 11:09 am The IE-based wxWebView backend is seriously outdated.
wxWidgets 3.1.5 offers the new Edge-based one (where new MS Edge is based on Chromium).
If you are stuck with wxWidgets 3.0, at least make sure you set the emulation level to the maximum, see e.g. here viewtopic.php?f=20&t=44405&p=182852#p182852
I will try your code soon.
Re: Are there any wxWidgets based application/widiget to show maps and GPS tracks
I understand this, thanks, I will first try IE based, because it looks like https://www.openstreetmap.org/ showns correctly in the webview page. I'm not sure if has some script to allow me to add customized paths.doublemax wrote: ↑Thu Apr 29, 2021 11:47 amYou can communicate with the webpage using wxWebView::RunScript
https://docs.wxwidgets.org/trunk/classw ... 0d463ffb98
Search the "webview" sample (of a current wxWidgets version) for occurences of "RunScript".
And, like PB said, you definitely want the ChromiumEdge backend. I doubt any modern web component will be compatible or fully functional under IE.
Re: Are there any wxWidgets based application/widiget to show maps and GPS tracks
Some information about the C++ code to show the osm map file, I have take some time to tweak this project: https://github.com/Paulxia/osmbrowser
Though this project is 10 years old, but it is wx and cairo and expat library. Those libraries can be easily installed by the msys2's pacman command.
I'd tweak some code, and finally it works, see the screen shot in attachment. (I will supply the patches to my own github forks)
When the mouse hovers near a "Node" in the osm map, it will show the information of that node in the right panel.
But I'm still not quite sure how to add tracks in its canvas, so still need some time to understand its code.
Though this project is 10 years old, but it is wx and cairo and expat library. Those libraries can be easily installed by the msys2's pacman command.
I'd tweak some code, and finally it works, see the screen shot in attachment. (I will supply the patches to my own github forks)
When the mouse hovers near a "Node" in the osm map, it will show the information of that node in the right panel.
But I'm still not quite sure how to add tracks in its canvas, so still need some time to understand its code.
Re: Are there any wxWidgets based application/widiget to show maps and GPS tracks
Hi,
Probably with wxOverlay?
Thank you.
Probably with wxOverlay?
Thank you.
- evstevemd
- Part Of The Furniture
- Posts: 2409
- Joined: Wed Jan 28, 2009 11:57 am
- Location: United Republic of Tanzania
Re: Are there any wxWidgets based application/widiget to show maps and GPS tracks
That require JS Library. There is openlayers and leaflet. Choose one and try playing around with WebView RunScript.
Here is a question on how to do that in Leaflet.
HTH
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?