Location
Fetches your location.
Uses GPS, WiFi and cellular hardware to determine your location. The first time you use the API, the application will prompt you to authorize access to your location. If you do not authorize access, the application cannot fetch your location. You can change this later from the system settings.
Methods
Section titled “Methods”current()
Section titled “current()”Fetches your location.
static current(): Promise<{string: number}>Your location is fetched using GPS, WiFi and cellular hardware. The object carried by the promise includes the latitude, longitude and altitude as well as the horizontal and vertical accuracy measured in meters.
Return value
Section titled “Return value”Promise<{string: number}>
Promise providing an object containing information about your location.
reverseGeocode(latitude, longitude, locale)
Section titled “reverseGeocode(latitude, longitude, locale)”Performs reverse-geocoding for a location.
static reverseGeocode(latitude: number, longitude: number, locale: string): [{string: any}]A reverse-geocoding request fetches information about the current location. The data is delivered by Apple’s geocoding service.
Parameters
Section titled “Parameters”latitude number
Latitude of coordinate to fetch information about.
longitude number
Longitude of coordinate to fetch information about.
locale string
Optional. Preferred locale to fetch information in. Uses the default locale of the device if null.
Return value
Section titled “Return value”[{string: any}]
Promise that carries all available information about the address when resolved.
setAccuracyToBest()
Section titled “setAccuracyToBest()”Uses best accuracy. This is default.
static setAccuracyToBest()Set this when you want to achieve the best possible accuracy when retrieving your location. This is the default accuracy.
setAccuracyToHundredMeters()
Section titled “setAccuracyToHundredMeters()”Sets accuracy to within hundred meters.
static setAccuracyToHundredMeters()setAccuracyToKilometer()
Section titled “setAccuracyToKilometer()”Sets accuracy to within one kilometer.
static setAccuracyToKilometer()setAccuracyToTenMeters()
Section titled “setAccuracyToTenMeters()”Sets accuracy to within ten meters.
static setAccuracyToTenMeters()setAccuracyToThreeKilometers()
Section titled “setAccuracyToThreeKilometers()”Sets accuracy to within three kilometers.
static setAccuracyToThreeKilometers()