Thread
: [SailfishOS]
Mapbox GL Native QML plugin
View Single Post
rinigus
2017-12-15 , 20:44
Posts: 1,414 | Thanked: 7,547 times | Joined on Aug 2016 @ Estonia
#
39
Originally Posted by
piggz
Does the widget have an api for drawing on the map, using, eg QGeoPath/QGeoShape etc ?
Sure. It doesn't use QtLocation-based approach, but keeps it close to the original Mapbox GL sources. So, you add objects using GeoJSON usually, but you could also add images and maybe even videos on the map.
If you take Poor Maps GL as an example, I can add POIs (dots with text), route as a line, and widgets that will follow geo-location of the point of interest.
I'll copy-and-paste description of it from OSM Scout Server thread:
Example codes:
Example at
https://talk.maemo.org/showpost.php?...84&postcount=1
More advanced showing how to add objects:
https://github.com/rinigus/mapbox-gl...p/qml/main.qml
Poor Maps port to this widget
https://github.com/rinigus/poor-maps/tree/gl
with map QML at
https://github.com/rinigus/poor-maps...gl/qml/Map.qml
Vector maps are different from raster in the interactivity with them, you can insert/remove/modify your objects. So, API has to be richer than before.
To learn, I would suggest to
Make an account at Mapbox, go to Mapbox Studio and try to edit one of their styles. Just play a little bit with it (10-15 min) to get the feeling of interaction between sources/layers/properties
Take a brief look into
https://www.mapbox.com/mapbox-gl-js/style-spec
(10-15 min); later you will need to read sections on the need basis
API for the widget is documented at
https://github.com/rinigus/mapbox-gl.../master/api.md
. Look through, you don't need every property/signal, just get a feeling
Start hacking on the basis of examples
Don't hesitate to ask for help.
How well does the learning process go, I don't know. I am pretty sure @jdrescher and maybe others can tell better from their experience. In particular, where do we have to document more or better.
Quote & Reply
|
The Following 3 Users Say Thank You to rinigus For This Useful Post:
juiceme
,
MartinK
,
olf
rinigus
View Public Profile
Send a private message to rinigus
Find all posts by rinigus