Thread: [SailfishOS] Mapbox GL Native QML plugin
View Single Post
Posts: 1,414 | Thanked: 7,547 times | Joined on Aug 2016 @ Estonia
#39
Originally Posted by piggz View Post
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:

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.
 

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