View Single Post
Posts: 1,414 | Thanked: 7,547 times | Joined on Aug 2016 @ Estonia
#19
Originally Posted by Zeta View Post
That was what I was afraid. Too bad.

I don't see a use case for embedding videos, I was thinking more of the MapPolyline and other types to render geometry on top of the map, like the route to follow or points of interest (like gas station in car mode). Not sure how easy it is to do with an older Qt.
I took a look at the MapBox GL before, but it is a huge piece of software, and I didn't understand all the subtleties of what it can do, and how to integrate it correctly in an application. I'll take a look again.

Can you describe your linux setup to see if I can replicate it here and maybe help ?
I haven't tried yet, but it seems to be easy to add routes, POIs and other objects in MapBox GL. As far as I understood, you basically add new geo layers in JSON and tell it how to render it. From your link to the blog post I understand why they made rather complicated API for QML in Qt 5.9 - they want to have it compatible with all providers.
With interfacing Mapbox GL directly, we could make a thin layer around https://github.com/mapbox/mapbox-gl-.../qmapboxgl.hpp which seems to me significantly easier.

For start, you could read QtLocation Mapbox GL Plugin API. That should give background info. Then we can test with the demo app how it all works under Linux.

Linux (and SFOS) setup actually takes not the master branch of mapbox-gl-native, but qt-staging. This is a branch followed by QtLocation plugin and it has a sane Qt build system (no need for node.js!). So, Linux setup that should work (I have a bit different, but its probably for historical reasons):

clone https://github.com/rinigus/pkg-mapbox-gl-native (recursively)

use included mapbox-gl-native-lib.pro to build the library by moving it into mapbox-gl-native folder, making dir build, and running qmake5 against mapbox-gl-native-lib.pro. That should let you build library with make

If you wish, you could install library. Otherwise, use it from that build dir (its static lib, so all should be fine).

clone https://github.com/rinigus/mapbox-gl-qml and open the project under app subfolder

Correct the path for qmapboxgl include and library dir (or even better - make symlinks that would lead to the same paths as used in the project file).

Register as a developer at mapbox.com for getting access token.

Add access token either into environment, into main() as

Code:
qputenv("MAPBOX_ACCESS_TOKEN", "HERE GOES THE TOKEN");
before registration of qml type.

Compile and run it.

Let me know if there is any trouble. I'll continue meanwhile adding QML methods. Should be all there soon, I hope.
 

The Following 4 Users Say Thank You to rinigus For This Useful Post: