In https://developer.garmin.com/connect-iq/api-docs/Toybox/Position.html#enableLocationEvents-instance_function there are typos:
if (Position has :CONFIGURATION_GPS_GLONASS_GALILEO_BEIDOU_L1_L5) && (Position.hasConfigurationSupport(Position.CONFIGURATION_GPS_GLONASS_GALILEO_BEIDOU_L1_L5)) { options[:configuration] = Position.CONFIGURATION_GPS_GLONASS_GALILEO_BEIDOU_L1_L5; } else if (Position has :CONFIGURATION_GPS_GLONASS_GALILEO_BEIDOU_L1) && (Position.hasConfigurationSupport(Position.CONFIGURATION_GPS_GLONASS_GALILEO_BEIDOU_L1)) { options[:configuration] = Position.CONFIGURATION_GPS_GLONASS_GALILEO_BEIDOU_L1; } else if (Position has :CONFIGURATION_GPS) && (Position.hasConfigurationSupport(Position.CONFIGURATION_GPS)) { options[:configuration] = Position.CONFIGURATION_GPS; }
all 3 if have an "extra" zombie parentheses around the &&:
) &&
(
instead of just:
&&
update: and BTW the example code (with typecheck: 3, but I guess it doesn't matter in this case) gives warnings:
options[:constellations] = [ Position.CONSTELLATION_GPS, Position.CONSTELLATION_GLONASS ];
enduro3: '$.Toybox.Position.CONSTELLATION_GPS' is deprecated.
enduro3: '$.Toybox.Position.CONSTELLATION_GLONASS' is deprecated.