Notices


Reply
Thread Tools
Posts: 304 | Thanked: 1,348 times | Joined on Aug 2016 @ Estonia
#61
MartinK: I guess we'll get back to your post when the elementary support for adding objects is there
 

The Following User Says Thank You to rinigus For This Useful Post:
Posts: 1,387 | Thanked: 6,343 times | Joined on Apr 2010 @ Czech Republic
#62
Originally Posted by rinigus View Post
MartinK: I guess we'll get back to your post when the elementary support for adding objects is there
Sounds good!
__________________
modRana: a flexible GPS navigation system
Mieru: a flexible manga and comic book reader

Thanks to everyone who voted for modRana & Mieru in the Maemo.org coding competition !
 
Posts: 304 | Thanked: 1,348 times | Joined on Aug 2016 @ Estonia
#63
@Zeta: the first version with the support for updating the map with the sources, layers, ... is out in github repo. You are very welcome to test it, I haven't had a chance to do it myself. Current interface is at qquickitemmapboxgl.h - I will continue adding missing methods and then would be able to test as well.
 

The Following 3 Users Say Thank You to rinigus For This Useful Post:
Posts: 218 | Thanked: 564 times | Joined on Jun 2010 @ USA
#64
Watching this thread intently, and will lend aid/test wherever needed.

Very exciting stuff!
__________________
Sony Xperia X SFOS 2.1.2.3, Nokia N810
 

The Following 2 Users Say Thank You to deprecated For This Useful Post:
Posts: 226 | Thanked: 937 times | Joined on Oct 2013 @ France
#65
Originally Posted by rinigus View Post
@Zeta: the first version with the support for updating the map with the sources, layers, ... is out in github repo. You are very welcome to test it, I haven't had a chance to do it myself. Current interface is at qquickitemmapboxgl.h - I will continue adding missing methods and then would be able to test as well.
Looking good!
I can see some polyline drawn over helsinki, in a white dash-dot pattern, if that was what you expected.

I tried some changes, and I succeeded in generating this polyline data from C++ (as a QVariantMap with the geojson data), then adding it on the map layer on the QML side.

I will try to do it with a real route, as would be generated by OSRM or another routing engine, to have something more complex than what I have done by hand and see if it breaks at some level. And then make the connections so that changes on the route are updated on the map.
 

The Following 3 Users Say Thank You to Zeta For This Useful Post:
Posts: 304 | Thanked: 1,348 times | Joined on Aug 2016 @ Estonia
#66
Originally Posted by Zeta View Post
Looking good!
I can see some polyline drawn over helsinki, in a white dash-dot pattern, if that was what you expected.

I tried some changes, and I succeeded in generating this polyline data from C++ (as a QVariantMap with the geojson data), then adding it on the map layer on the QML side.

I will try to do it with a real route, as would be generated by OSRM or another routing engine, to have something more complex than what I have done by hand and see if it breaks at some level. And then make the connections so that changes on the route are updated on the map.
Zeta, just updated demo program for desktop. I'll add some simper API for adding and altering points as well as look on how to get integration between other widgets and the map (have some ideas already)
 

The Following 2 Users Say Thank You to rinigus For This Useful Post:
Posts: 226 | Thanked: 937 times | Joined on Oct 2013 @ France
#67
Originally Posted by rinigus View Post
Zeta, just updated demo program for desktop. I'll add some simper API for adding and altering points as well as look on how to get integration between other widgets and the map (have some ideas already)
Really good so far !

So far, I had only be playing with your demo app, making some changes here and there to so see what it could do, but I have now started to work on a real use case of the qml map. I will push it later on Github.

So, some quick comments:
I have easily taken OSRM route output (as GeoJson) and added it as a new layer on the fly.
Adding a geoJson route of 1800 points (corresponding to the "full" output option of OSRM for a route of a bit more than 100 km), doesn't introduce visible slowdown on PC. I am downloading the full France PBF to make tests with longer routes (a thousand km is possible through France).

Behaviors on zoom and pitch properties are working great !
Adding those lines allows to switch from a route overview to a car-like navigation view seemlessly:
Code:
Behavior on zoomLevel { NumberAnimation { duration: 1000 } }
Behavior on pitch { NumberAnimation { duration: 1000 }  }
While testing the map dynamic behavior, In the timer that update the location source, I added:
Code:
map.center = QtPositioning.coordinate(60.16 +  0.01*Math.sin(angle), 24.94 + 0.01*Math.cos(angle))
That way the map follows the location point, but I noticed that at high zoom levels, we can see the location point being updated before the map is centered on it, which then put back the location circle in the center. I am not sure how that glitch could/should be avoided, but maybe something to block map redraw while updating a bunch of properties and enabling it later would be the correct way ? There maybe already something in place ?

My next step is to allow OSRM to update the route it added previously, which shouldn't be too hard.
 

The Following 2 Users Say Thank You to Zeta For This Useful Post:
Posts: 304 | Thanked: 1,348 times | Joined on Aug 2016 @ Estonia
#68
Originally Posted by Zeta View Post
Really good so far !

So, some quick comments:
I have easily taken OSRM route output (as GeoJson) and added it as a new layer on the fly.
Adding a geoJson route of 1800 points (corresponding to the "full" output option of OSRM for a route of a bit more than 100 km), doesn't introduce visible slowdown on PC. I am downloading the full France PBF to make tests with longer routes (a thousand km is possible through France).

Behaviors on zoom and pitch properties are working great !
Adding those lines allows to switch from a route overview to a car-like navigation view seemlessly:
Code:
Behavior on zoomLevel { NumberAnimation { duration: 1000 } }
Behavior on pitch { NumberAnimation { duration: 1000 }  }
While testing the map dynamic behavior, In the timer that update the location source, I added:
Code:
map.center = QtPositioning.coordinate(60.16 +  0.01*Math.sin(angle), 24.94 + 0.01*Math.cos(angle))
That way the map follows the location point, but I noticed that at high zoom levels, we can see the location point being updated before the map is centered on it, which then put back the location circle in the center. I am not sure how that glitch could/should be avoided, but maybe something to block map redraw while updating a bunch of properties and enabling it later would be the correct way ? There maybe already something in place ?

My next step is to allow OSRM to update the route it added previously, which shouldn't be too hard.
Great to know that real roads are not an issue . Same with animations.

I have seen the same flickering when I moved the center in accordance with the dot. Same flickering is visible when you drive around and set gps location to be on the center (but it seem that the gps coordinates are updated not that frequently).

I did some testing and couldn't see improvements when I set the center and position of the dot at the same time. However, I might have done something wrong during it, would have to recheck.

I have started to use issues as some crude todo list. Added this flickering to it as well.
 

The Following 2 Users Say Thank You to rinigus For This Useful Post:
Posts: 304 | Thanked: 1,348 times | Joined on Aug 2016 @ Estonia
#69
I think that large chunk of API is ready. Its not stress-tested, but can be used as a solid starting point for it.

The missing piece is an API that would allow to add interactive elements on top of the map. I have an idea on how to make it and will probably implement in the next couple of evenings.

Present API follows the logic of map drawing by Mapbox GL and is somewhat different from what we used so far (before we couldn't draw within the map, just on top). So, few terms and what's supported:

* you can rotate, pan, zoom, and tilt

* you can set the "center" of map into any position of the widget. For example, get the center in the middle (when just looking where you are) or in the lower bit of the screen (when you drive). This is supported via margins

* To add anything to the map (and here the magic comes), you need to add source and layer. Multiple layers can use the same source.

* Sources supported by QMapboxGL are GeoJSON and probably few others, but this has to be researched if needed. I think you could add tiles as well, but I haven't looked into it.

* Sources in GeoJSON can be fed as QString (https://github.com/rinigus/mapbox-gl...l/main.qml#L82), QVariantMap (https://github.com/rinigus/mapbox-gl.../main.qml#L140), and using simpler API for point(s) https://github.com/rinigus/mapbox-gl...apboxgl.h#L166 and lines
https://github.com/rinigus/mapbox-gl...apboxgl.h#L172 . Note that adding and updating is the same for QMapboxGL.

* Layers are responsible for rendering sources and can be added/removed. See https://www.mapbox.com/mapbox-gl-js/style-spec/#layers for available properties. As you could see, layers customization is rather extensive and I am not planning to write any crippled API for it. It seems to be simple API already and allows the required flexibility. Let's use it as it is.

* Examples for route rendering at https://github.com/rinigus/mapbox-gl.../main.qml#L122 ; current location at https://github.com/rinigus/mapbox-gl.../main.qml#L138 ; points at https://github.com/rinigus/mapbox-gl.../main.qml#L175

* More examples on how to use image-based markers are at https://github.com/mapbox/mapbox-gl-...indow.cpp#L135

* Via queries, you could ask current scale, whether source exists, and which location does the widget point corresponds to. How to ask is shown at https://github.com/rinigus/mapbox-gl...l/main.qml#L63 with the response at https://github.com/rinigus/mapbox-gl.../main.qml#L218 .

* API header at https://github.com/rinigus/mapbox-gl...itemmapboxgl.h

With the exception of interactive widgets (to be added), it should cover what was suggested by MartinK. Generation of IDs for sources and layers are responsibility of the caller, but that should be OK.

As soon as the support for interacting widgets will be ready, I'll start proper testing of the widget by porting Poor Maps over it (the source I am a bit familiar with). This and the tests by others should show us what is missing and if/what should be changed.
 

The Following 3 Users Say Thank You to rinigus For This Useful Post:
otsaloma's Avatar
Posts: 92 | Thanked: 1,143 times | Joined on May 2011 @ Finland
#70
Originally Posted by rinigus View Post
I think that large chunk of API is ready.
Things move such fast, that I can't quite keep up. Could you explain in high-level terms, how this API relates to QtLocation 5.2/5.6 or the Mapbox GL plugin API in QtLocation 5.9? I'm wondering if people writing map apps for SFOS will along with this new component have three different APIs for routes, POIs, position icons, etc.? And not just functions, but also data structures (QtPositioning coordinates, MapQuickItems, JSON etc.) given as arguments?

Originally Posted by rinigus View Post
As soon as the support for interacting widgets will be ready, I'll start proper testing of the widget by porting Poor Maps over it (the source I am a bit familiar with).
Please file an issue about that and suggest a high-level outline for discussion, assuming it's likely to end up being more than just testing.
 

The Following 2 Users Say Thank You to otsaloma For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 22:56.