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