Skip to content

Latest commit

 

History

History
38 lines (35 loc) · 2.05 KB

LocationManager.md

File metadata and controls

38 lines (35 loc) · 2.05 KB

Class: "location".LocationManager

Provides methods for querying geolocation (in case available) on the target platform.

Static Functions
  • isEnabled() Boolean
    Checks whether the location services are switched ON for this device (on Android) or application (iOS).
    • return - Boolean
  • distance( loc1 Location, loc2 Location ) Number
    Measures the distance in meters between two locations.
    • loc1 - Location
      The first location.
    • loc2 - Location
      The second location.
    • return - Number
Instance Properties
  • desiredAccuracy - Number.
    The desired accuracy in meters. Defaults to DesiredAccuracy.HIGH
  • updateDistance - Number.
    The update distance filter in meters. Specifies how often to update. Default on iOS is no filter, on Android it is 0 meters.
  • minimumUpdateTime - Number.
    The minimum time interval between subsequent location updates, in milliseconds (ignored on iOS).
  • isStarted - Boolean.
    True if the location listener is already started. In this case all other start requests will be ignored.
  • lastKnownLocation - Location.
    Returns last known location from device's location services or null of no known last location.
Instance Functions
  • startLocationMonitoring( onLocation Function..., onError? Function..., options? Options )
    Starts location monitoring.
    • onLocation - Function(location Location) Object
      A function that will be called upon every location update received.
    • onError - (optional) - Function(error Error) Object
      An optional error callback.
    • options - (optional) - Options
      An optional object specifying location update settings.
  • stopLocationMonitoring()
    Stops location monitoring.