Hi Niels and Kristof, You can just link QtPositioning, if you are using C++ you can use QGeoCoordinate::distanceTo(const QGeoCoordinate &), there is an equivalent for QML, check out: http://qt-project.org/doc/qt-5/qml-coordinate.html#distanceto
It's probably gonna be faster than whatever you can conjure in JS. ;) Regards Kris On 7 July 2014 18:52, Niels Christian Ørgaard <ncoth...@gmail.com> wrote: > Hi Timur, > > I was literally googling something similar earlier today (contemplating a > quick health-app), and came across this: > http://qt-project.org/forums/viewthread/19189 > > You should be able to just compare current and previous location, and > calculate distance between these; if you do this at regular intervals > (every few seconds?), and add up each short distance, you will get the > total travelled distance. > > There are various methods for calculating distance between 2 sets of > longitude and latitude, though for precision you may want to include > altitude as well. > Example: > http://www.ridgesolutions.ie/index.php/2013/11/14/algorithm-to-calculate-speed-from-two-gps-latitude-and-longitude-points-and-time-difference/ > > Cheers, > Nc. > > > 2014-07-07 20:13 GMT+02:00 Timur Kristóf <timur.kris...@gmail.com>: > >> Hi, >> >> I'd like to ask a simple question: what is the simplest way to make a >> Sailfish app that measures the distance the user has walked. Preferably >> using QML only, but I'm not afraid of writing QML code either. >> >> Thanks, >> Timur >> >> _______________________________________________ >> SailfishOS.org Devel mailing list >> To unsubscribe, please send a mail to >> devel-unsubscr...@lists.sailfishos.org >> > > > _______________________________________________ > SailfishOS.org Devel mailing list > To unsubscribe, please send a mail to > devel-unsubscr...@lists.sailfishos.org >
_______________________________________________ SailfishOS.org Devel mailing list To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org