Position.parse bug

Parsing a position string that can be set in settings works fine on the emulator, but fails on a fenix 3 (maybe other devices do not work aswell).

This is the code I use:

var lat = self.getProperty("latitude_prop").length() > 0 ? self.getProperty("latitude_prop") : "0 0.0'";
var lon = self.getProperty("longitude_prop").length() > 0 ? self.getProperty("longitude_prop") : "0 0.0'";
System.println(lat);
System.println(lon);
var location = Position.parse(lat + ", " + lon, Position.GEO_DM);
System.println(location.toGeoString(Position.GEO_DM));

When setting the latitude_prop to "51 30.236" and the longitude_prop to "7 4.576" I get the following output in the emulator:

51 30.236
7 4.576
N 51î‚°30.2360'E  7î‚° 4.5760'

However, when I run this on my fenix I get this output:

51 30.236
7 4.576
N 00°00.0000'O 180°00.0000'

I guess it is a firmware bug, so does someone know a workaround?

Thanks in advance Slight smile

  • This is likely do to the characters in the fonts used.  Instead of Sys.println, try displaying it on the device screen. Not all characters are in all fonts there either, so look at the UX Guide, Appendix B.

  • I think I didn't  really explain what the error is. The problem occurs on the device where it parses the coordinates to N 00° and E 00°, even though I set the vars lat and lon to something different.

    The problems with the characters in my eclipse console have likely something to do with my computer or my system language (german) but the output is correct there anyways .