Thread: [SailfishOS] Mapbox GL Native QML plugin
View Single Post
Posts: 1,414 | Thanked: 7,547 times | Joined on Aug 2016 @ Estonia
#65
Originally Posted by piggz View Post
@rinigus How can I add 'google encoded polyline' to the mapbox widget?
@piggz, you would have to decode it first. Usually, you want to do something with the polyline in addition to showing it. So, I would expect that you would have to decode it anyway and there is no need to add support for decoding into the widget. Unless you have a good use-case where there is no need for decoding and you think that the functionality should be provided by the widget.

So, as soon as it is decoded (there are codes around), add it to the widget as a source using addSourceLine (example commented out at https://github.com/rinigus/mapbox-gl.../main.qml#L260), add layer using addLayer and set its properties (see https://github.com/rinigus/mapbox-gl.../main.qml#L262 and below)
 

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