![]() |
2017-09-25
, 20:57
|
|
Posts: 141 |
Thanked: 1,530 times |
Joined on May 2011
@ Finland
|
#72
|
![]() |
2017-09-25
, 22:39
|
Posts: 339 |
Thanked: 1,623 times |
Joined on Oct 2013
@ France
|
#73
|
connect(n, &QSGMapboxGLTextureNode::replyCoordinateForPixel, this, &QQuickItemMapboxGL::replyCoordinateForPixel, Qt::QueuedConnection); connect(this, &QQuickItemMapboxGL::queryCoordinateForPixel, n, &QSGMapboxGLTextureNode::queryCoordinateForPixel, Qt::QueuedConnection);
![]() |
2017-09-26
, 06:39
|
Posts: 1,414 |
Thanked: 7,547 times |
Joined on Aug 2016
@ Estonia
|
#74
|
All right. To clarify, my main concern is whether we can support both raster and vector maps in the same codebase. Considering the experimental nature of Mapbox GL and crashes on Jolla 1 and Jolla store rules, we might need to support raster tiles for quite a while still. That would favor a single codebase, but if it looks seriously complicated, then rather a fork, and new features only in the fork.
![]() |
2017-09-26
, 06:45
|
Posts: 1,414 |
Thanked: 7,547 times |
Joined on Aug 2016
@ Estonia
|
#75
|
Hello rinigus,
First of all, hats down for the work you did/are doing there !
I can confirm the demo app works really good on Desktop, and it is quite easy to build something around the Qml component in a custom application.
Updating a geojson source live seems to work without quirks. I got it working with OSRM when it computes a new route to the latest clicked point.
I will need a bit more time in the week to clean this a bit before I start pushing it on GitHub, if other can find inspiration in it.
Working with it, I have a couple of minor questions/remarks:
* margins have a setter, but are not a "real" property. Is this by design or was it a shortcut ? Having them as properties would allow adding them a "Behavior", to smooth switching from one view to another
* when trying to find the coordinates for a pixel on the screen, the answer can only be asynchronously obtained as it goes through internal signal/slots :It is not as easy to use as a simple function call as you need to keep some state of what you wanted to get this point coordinates, for when the answer comes back (like if you use right click for route start, and left click for route end, you need to store which click was the one that triggered the request. The more complex the interaction with the map, the more it will be visible).Code:connect(n, &QSGMapboxGLTextureNode::replyCoordinateForPixel, this, &QQuickItemMapboxGL::replyCoordinateForPixel, Qt::QueuedConnection); connect(this, &QQuickItemMapboxGL::queryCoordinateForPixel, n, &QSGMapboxGLTextureNode::queryCoordinateForPixel, Qt::QueuedConnection);
I imagine the reason behind this is that the 2 objects live in different threads ? If so, there is not much that could be done to change it.
Thanks again !
![]() |
2017-09-26
, 16:59
|
|
Posts: 141 |
Thanked: 1,530 times |
Joined on May 2011
@ Finland
|
#76
|
I suspect that raster tiles are supported, but haven't had time to test it. See https://www.mapbox.com/mapbox-gl-js/example/map-tiles/ .
![]() |
2017-09-26
, 18:43
|
Posts: 1,414 |
Thanked: 7,547 times |
Joined on Aug 2016
@ Estonia
|
#77
|
I have used Mapbox GL JS for web apps and at least that does support raster tiles. Tiles are blurry though, since there's a smoothing filter, which can't be turned off. If doing custom packages for SFOS, I expect the smoothing can be resolved too.
![]() |
2017-09-26
, 19:29
|
Posts: 1,414 |
Thanked: 7,547 times |
Joined on Aug 2016
@ Estonia
|
#78
|
![]() |
2017-09-27
, 17:30
|
Posts: 1,414 |
Thanked: 7,547 times |
Joined on Aug 2016
@ Estonia
|
#79
|
The Following User Says Thank You to rinigus For This Useful Post: | ||
![]() |
2017-09-27
, 19:45
|
Posts: 1,414 |
Thanked: 7,547 times |
Joined on Aug 2016
@ Estonia
|
#80
|
Main: https://github.com/rinigus/mapbox-gl...p/qml/main.qml
Widget that tracks position, hides when out of the screen, and destroys itself when tracking is removed: https://github.com/rinigus/mapbox-gl...l/location.qml
I think that its complete now in the sense that I can start testing it further by porting a proper map application over it and see if I hit some problems.
Replies to the questions below:
QtLocation 5.6 - assuming it will come to SFOS - has three main plugins - HERE, Mapbox, OpenStreetMap (http://doc.qt.io/qt-5.6/qtlocation-index.html). All these plugins use tiled maps.
QtLocation 5.9 - introduced the first "vector" plugin in the form of Mapbox GL. Mapbox GL Native (https://github.com/mapbox/mapbox-gl-native) has Qt interface (called platform in their project) that was further integrated into QtLocation by providing corresponding QtQuick components and interfaces with the other QtLocation classes.
This API: Based on the bits from QtLocation/Mapbox GL plugin (rendering of the map on QtQuick widget); interface to QMapboxGL that provides Mapbox GL functionality for Qt C++; and my understanding of what's needed from application perspective. This API compiles and runs against Qt 5.6 using QtLocation 5.2 (SFOS) and Qt 5.7 / QtLocation 5.7 (desktop), as far as I tested.
So, for people writing map apps, this API allows you to have probably one of the best renderings of the map available now, on any platform. In the background, it will communicate with the vector tile server and keep the cache with the minimal effort from the map application writer.
APIs for routes, POIs, and position icons are different. Data structures, for most part, are compatible with the QtPositioning coordinates used to provide points, routes (list of coordinates). For more complicated cases, we can see what's the reasonable approach.
Now, I don't know how much would take an effort to port an existing application to such API. In my understanding, it shouldn't be too difficult. However, it maybe that the devil is in the details and I underestimate the task. Hence my idea to port Poor Maps over and see how much time does it take in practice as well as whether we can cover all the cases as exposed by complete map application.
Edit: I hope I did reply to all questions / please ask again if I missed anything