Thread: [SailfishOS] Mapbox GL Native QML plugin
View Single Post
Posts: 1,746 | Thanked: 1,832 times | Joined on Dec 2010
#74
Originally Posted by rinigus View Post
Sorry, I misunderstood. I assume that you write an app and want to know API, right?

To get coordinate of any pixel, you call method

Code:
queryCoordinateForPixel(const QPointF p, const QVariant &tag = QVariant())
This method will return immediately and the reply you will get somewhat later (has to go through to other thread and so on) via signal

Code:
replyCoordinateForPixel(const QPointF pixel, QGeoCoordinate geocoordinate, qreal degLatPerPixel, qreal degLonPerPixel, const QVariant &tag)

The signal will carry correct geocoordinate as well as its derivative per pixel (if you wish to apply some sensitivity analysis to the result).

See query example at https://github.com/rinigus/mapbox-gl...es-and-signals

So, in your case, find pixel coordinates of the pin and ask for its geolocation using queryCoordinateForPixel
ahhh okay thanks and yeahh making an app here


https://github.com/ghosalmartin/harbour-uber
 

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