You are reading a single comment by @stweedo and its replies. Click here to read the full conversation.
  • I've been testing this out and there's a pretty big issue with how maps is sending the distance values when using imperial units.

    It will send the distance value to bangle.js in meters, which it's supposed to, until it gets to 0.1 miles at which point maps decides to send the distance value directly in feet instead.

    Now when the locale file on the bangle.js sees this new value in feet it still thinks it's working with meters and the distance becomes inaccurate as a result.

    I've tried getting the log data from gadgetbridge while using navigation, but it only showed one single nav message at the beginning of my drive with a distance of 0 and that's it. The navigation ran the whole trip on my phone and the watch so I don't know why there weren't more.

    I was also testing some formatting changes in the locale file to make it use one decimal place at less than 10 miles and convert to feet when less than 0.1 miles (this is about ~500ft or 152.4 meters which is when maps changes from miles to feet). This works great and makes the distances match exactly what is shown on the phone (except the bug with the units switching), but I'm thinking this may not be the right place for this code. Perhaps it would be better placed in the messagegui app and could be made compatible with all locales?

    distance: (n) => {
        var miles = n / 1609.34;
        var dp = miles < 10 ? 1 : 0;
        return n < 152.4 ? Math.round(n * 3.28084) + "ft" : (miles < 10 ? miles.toFixed(1) : Math.round(miles)) + "mi";
      },
    
About

Avatar for stweedo @stweedo started