The following code always return `null` in simulator despite location being set up (Settings / Set Weather). How to access location from simulator?
var pos = Weather.getCurrentConditions().observationLocationPosition; System.println(pos);
The following code always return `null` in simulator despite location being set up (Settings / Set Weather). How to access location from simulator?
var pos = Weather.getCurrentConditions().observationLocationPosition; System.println(pos);
https://developer.garmin.com/connect-iq/api-docs/Toybox/Weather/CurrentConditions.html#observationLocationPosition-var
Did you set the position permission in the manifest.xml?
Worked fine for me. Got a Position.Location object back and when I used "toDegrees()" on it I got the Position.Location as latitude/longitude set in "Settings/Weather" back.
After you set the location in Settings > Set Position, you also need to go to Simulation > Activity Data and hit the play button in the bottom-left.
That depends. I wrote a test app back when Weather came about where I'd use a MapView to show the observationLocationPosition on a map in the sim. If I recall, at the time it showed where the weather station was located which is different than the phones location.