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 it can 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 for the different APIs is in what options are available ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.