Thread: [SailfishOS] Mapbox GL Native QML plugin
View Single Post
Posts: 1,746 | Thanked: 1,832 times | Joined on Dec 2010
#32
Originally Posted by MartinK View Post
Looking on how modRana does it (warning: modRana does some extra stuff there so the code is ore complex than necessarily needed) & trying to remember how I programmed it:
  • the PositionSource element has a coordinate property, which holds the current coordinate
  • the coordinate has a isValid property, which is used by modRana to decide if the coordinate is valid and should be used
  • to differentiate between 2D and 3D fix, modRana uses the altitudeValid property of the PositionSource instance

That seems to work reasonably well.

But it also depend how you define "has a fix" as by default the location backend on Sailfish OS first uses data from the mobile network and WiFi to get a rough position estimate while getting and actual GPS lock.

This is why you might see you position jump every 30 seconds for tens or hundreds of meters before it actually starts to track you position. It's the location backend sending data about local WiFi access points every 30 seconds to estimate your position while GPS is still acquiring the GPS lock.

The Info -> Location page in modRana displays detailed location data and you can nicely see the location converge from WiFi estimation to GPS fix there.
it works so and so tbh since am doing the same but i guess the user will just have to realise its nowhere near there location :P
 

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