11. Geolocation

The Cordova Geolocation API allows an application to leverage the GPS capabilities of a mobile device and determine the device’s location on the surface of the Earth. Using this API, an application can either manually check the device’s current position or create a location watch that will cause the application to be periodically notified of the device’s physical location.

The Geolocation API is implemented in the same manner as the Accelerometer (Chapter 2) and Compass (Chapter 5) APIs. All three APIs expose a way to query the particular metric individually or by defining a watch and measuring the metric repeatedly over time. The differences between the implementations of the different APIs are in what options are available to ...

Get Apache Cordova API Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.