View Single Post
Posts: 339 | Thanked: 1,623 times | Joined on Oct 2013 @ France
#73
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 :
Code:
connect(n, &QSGMapboxGLTextureNode::replyCoordinateForPixel, this, &QQuickItemMapboxGL::replyCoordinateForPixel, Qt::QueuedConnection);
connect(this, &QQuickItemMapboxGL::queryCoordinateForPixel, n, &QSGMapboxGLTextureNode::queryCoordinateForPixel, Qt::QueuedConnection);
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).
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 !
 

The Following 3 Users Say Thank You to Zeta For This Useful Post: