Common sources of location information include Global Positioning System (GPS) and location inferred from network signals such as IP address, RFID, WiFi and Bluetooth MAC addresses, and GSM/CDMA cell IDs.

This API is based on the W3C Geolocation API Specification.

The Coordinates object is created and populated by Cordova, and attached to the Position object. The Position object is then returned to the user through a callback function.

The Positon object contains Position coordinates and timestamp, created by the geolocation API.

A PositionError object is returned to the geolocationError callback when an error occurs.Error code:{{{ PositionError.PERMISSION_DENIED PositionError.POSITION_UNAVAILABLE PositionError.TIMEOUT }}}

enableHighAccuracy: Provides a hint that the application would like to receive the best possible results. By default, the device will attempt to retrieve a Position using network-based methods. Setting this property to true tells the framework to use more accurate methods, such as satellite positioning.


Domain Whitelist Guide



Android平台的实现:The whitelisting rules are found in res/xml/cordova.xml and declared with the element <access origin="..." />.

This is called a single origin policy―you can read further about single origin policies at . The same is not true for a PhoneGap applicat ion. A PhoneGap app lication bundles the required HTML, JavaScript, and CSS files, and PhoneGap applications do not have domains like “” This allows PhoneGap to be a platform for the easy development of mashups, whi ch can freely make Ajax calls to various other sites. Think about your PhoneGap app lication integrating Facebook, Twitter, and Flickr all into one mashup, with just a few lines of JavaScript code. This makes PhoneGap an ideal platform for creating mobile applications for the web services listed on