Documentation
¶
Overview ¶
Package location tells where the device is, on phones and tablets: Core Location on iOS, and LocationManager on Android, without Google's services. Importing it adds the permissions it needs to the app, with a usage description on iOS that ios.infoPlist in the app's configuration replaces:
"NSLocationWhenInUseUsageDescription": "Shows nearby stores."
Elsewhere its functions report errors.ErrUnsupported.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequestPermission ¶
RequestPermission asks the user to let the app know where the device is, the first time, and reports whether it may. Call it off the main goroutine, as it waits for the user.
Types ¶
type Fix ¶
type Fix struct {
// Latitude and Longitude are in degrees.
Latitude, Longitude float64
// Altitude is in meters above sea level, Speed in meters a second, and
// Heading in degrees clockwise from north; negative where not known.
Altitude, Speed, Heading float64
// Accuracy is how far off it may be, in meters.
Accuracy float64
// Time is when it was measured.
Time time.Time
}
Fix is a place the device was at.