First, PhoneGap geolocation object Introduction
1. Enable applications to access geo-location information. The Geolocation object provides access to the device's GPS sensor. Geolocation provides location information for the device, such as longitude and latitude.
2. Common sources of location information include the Global Positioning System (GPS), as well as inferences made through network signals such as IP addresses, RFID, WiFi and Bluetooth MAC addresses, and GSM/CDMA phone IDs.
3. There is no guarantee that the API will return the actual location information of the device. This API is implemented based on the Geo Location API specification.
4, some devices have provided the implementation of the specification, for these devices using built-in implementation instead of using PHONEGAP implementation.
5. PHONEGAP provides unified support for devices that do not have geo-location support.
6. Methods
Geolocation.getcurrentposition
Geolocation.watchposition
Geolocation.clearwatch
7. Parameters
Geolocationsuccess
Geolocationerror
Geolocationoptions
Second, geolocation.getcurrentposition
Returns the current position of the device, a location object.
PhoneGap geolocation get geolocation API