Skip to content
BobDickinson edited this page Nov 12, 2014 · 4 revisions

Location

Attributes:

  • movementThreshold (in meters, to trigger location update, default is 100)

Bindings:

  • value
  • sync
  • onUpdate (command + params)

Examples:

{ control: "location", binding: "MyLocation", movementThreshold: 500 }

{ control: "location", binding: { value: "MyLocation", sync: "change" } }

{ control: "location", binding: { value: "MyLocation", onUpdate: { command: "doUpdate", coordinate: "{MyLocation.coordinate}" } } }

Bound value output

Location Data

{
    available: true,
    status: "Active",
    coordinate:
    {
        latitude: 47.1234567,
        longitude: -122.123456
    },
    accuracy: 5,       // in meters
    heading: 45.1234,  // in degrees
    speed: 1.23        // in meters/second
}

status:

  • DeterminingAvailabily - The system is determining the availability of location services
  • Available - Location services are available and a location update will be provided when available
  • NotAvailable - Location services are not available, and no user action can make them available
  • PendingApproval - Location service availability is pending response from the user for approval
  • NotApproved - Access to location service has not been approved by the user for this application
  • Active - A location has been provided, and future updates my occur based on movementThreshold
  • Failed - Location support is available, but the more recent attempt to determine location failed

available:

This value will be set to true if location services are available and approved, and your application should expect location updates. Typically this will mean that the status is one of Available, Active, or Failed. This member is provided as a convenience to avoid having to do more sophisticated analysis of status.