Book Image

Mastering jQuery Mobile

Book Image

Mastering jQuery Mobile

Overview of this book

Table of Contents (17 chapters)
Mastering jQuery Mobile
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Geolocation


Geolocation is one the most important and a very popular feature of a smart phone device. You must have used several geolocation-based apps such as Google Maps Navigation, Foursquare, Facebook check-in, or Yelp. Geolocation is the basis of all these applications. Geolocation provides the information about the device's location such as its latitude and longitude. The location information is collected via the usual means such as the Global Positioning System (GPS) module available in the device and the location inferred from network signals such as IP addresses, RFID, Wi-Fi and Bluetooth MAC addresses, and GSM/CDMS cell IDs. There is no guarantee that the API returns the exact location of the device, but it depends on various factors.

The geolocation API has the following methods:

  • geolocation.getCurrentPosition

  • geolocation.watchPosition

  • geolocation.clearWatch

To access the geolocation feature, we need to add this plugin to our project using the following command on the Terminal...