Data source for elapsedDistance

Former Member
Former Member

I was unable to find out where the data for Activity Info's elapsed distance comes from. Is it gps or pedometer based? If pedometer, is there a function to track distance by gps (aside from trying to use Position's Locations to manually calculate distance)?

  • In general, in an activity with GPS on, GPS is used.  If there's no GPS, then step/stride length based.  I think some devices may have an option to use steps/stride with GPS on.

  • Former Member
    Former Member over 5 years ago in reply to jim_m_58

    Sorry to respond to an older forum post.

    My app uses elapsedDistance to, well, check the distance. It works fine when running or walking, but doesn’t pick up anything when in the car. The app is for runners so the activity is set to running. My guess the reason that it doesn’t track any distance in the car is that it’s using the pedometer instead of gps, but I would like to use gps if possible.

  • Do you enable GPS?

    Position.enableLocationEvents(Position.LOCATION_CONTINUOUS, method(:onPosition));

    without it, you also won't see your track in Garmin Connect.

    I also check accuracy in onPosition and don't allow recording to start until it's good enough. 

    I've done some testing while driving with my hiking apps and GPS works fine, so maybe it's your vehicle blocking the GPS signal too much.

  • Former Member
    Former Member over 5 years ago in reply to jim_m_58

    Thank you! I didn't realize GPS needed to be enabled from the Position module. Everything works perfectly now!