Ticket Created
over 3 years ago

WERETECH-12160

Support for more position coordinate formats in toGeoString()

Currently only 4 Position.CoordinateFormat position formats are enumerated: https://developer.garmin.com/connect-iq/api-docs/Toybox/Position.html#CoordinateFormat-module

that can be used with the toGeoString() method: https://developer.garmin.com/connect-iq/api-docs/Toybox/Position/Location.html#toGeoString-instance_function

It would very useful if toGeoString() was able to return a position in the format the user had configured on the device.

Perhaps Position.CoordinateFormat could be expanded with more formats, and perhaps DeviceSettings https://developer.garmin.com/connect-iq/api-docs/Toybox/System/DeviceSettings.html could have an attribute that is of type Position.CoordinateFormat (in similar way that currently provides systemLanguage, elevationUnit, etc)?

This would allow user configured format to queried and then used with toGeoString() to display a position in their preferred format.

Or if expanding Position.CoordinateFormat with all format is not possible/desirable (I guess the format may vary by device), perhaps it could just be expanded with 'GEO_DEVICE' that just represents what ever device is currently configured with, allowing this to be passed to toGeoString() to have same effect of allowing the position be displayed in the users preferred format.

I guess the problem with all of the above is that Position.parse() also makes use of the type Position.CoordinateFormat and would need to be expanded parse string of these new formats...
I guess the these methods would have to become fallible, if parsing of particular format is not supported, or different types are used parsing() and toGeoString()... perhaps with some mapping between the types hmm....