offCourseDistance broken

This just doesn't work. I've tested a bunch of possible use cases. It generally is NULL.

var offCourseDistance as Lang.Float or Null

The distance to the nearest point on the current course in meters (m).

  • If you "Navigate to the Start", then it works. Garmin creates a temporary route to the start and this metric actually does what it is supposed to do in this one limited case. Until you actually get to the start of your route, afterwhich it stays NULL.
  • If you ride to the start but don't use Navigation to get there, it just stays NULL. Even once you get to the start, you see the "Course Found" pop up, and you are on route. While riding to the Start, for example, Garmin knows where the loaded route is and knows your current location, so it should present a value of how far you are from the route.

What I've found is a work around, to at least inform your code that you are OFF ROUTE, is to detect when you are progressing in distance, but the Distance2Destination is static. That means you are off route. Once D2D starts changing again, then you are back on route.

Too bad "offCourseDistance" is so broken - that could have been a useful data bit.

  • What I've found is a work around, to at least inform your code that you are OFF ROUTE, is to detect when you are progressing in distance, but the Distance2Destination is static. That means you are off route.

    It seems, the behaviour on that topic is different on different devices:
    what you describe is happening on Edge 1030 series devices. It is different on xx40 Edges: once you are off course, Distance2Desti will be 0 (or null - can‘t remember). When course is found again, the value becomes valid again.

    (Never tested offCourseDistance…)