Android phonegap中的Gps精度

Android phonegap中的Gps精度,android,cordova,Android,Cordova,在android native中,我们可以识别使用 locationProvider.getAccuracy() 参考: phonegap中是否有类似的方法来识别通过geolocation.watchPosition和geolocation.getCurrentPosition方法获得的GPS定位精度。您可以使用watchPosition而不是getCurrentPosition。那你的 onSuccess函数将在每次更改时触发 更精确的位置。在此函数中,您可以检查 然后使用clearWatc

在android native中,我们可以识别使用

locationProvider.getAccuracy()
参考:


phonegap中是否有类似的方法来识别通过geolocation.watchPosition和geolocation.getCurrentPosition方法获得的GPS定位精度。

您可以使用watchPosition而不是getCurrentPosition。那你的 onSuccess函数将在每次更改时触发 更精确的位置。在此函数中,您可以检查 然后使用clearWatch停止gps传感器


礼貌

您可以使用watchPosition而不是getCurrentPosition。那你的 onSuccess函数将在每次更改时触发 更精确的位置。在此函数中,您可以检查 然后使用clearWatch停止gps传感器


礼貌

返回的位置对象保持准确性:

var onSuccess = function(position) {
alert('Latitude: '          + position.coords.latitude          + '\n' +
      'Longitude: '         + position.coords.longitude         + '\n' +
      'Altitude: '          + position.coords.altitude          + '\n' +
      'Accuracy: '          + position.coords.accuracy          + '\n' +
      'Altitude Accuracy: ' + position.coords.altitudeAccuracy  + '\n' +
      'Heading: '           + position.coords.heading           + '\n' +
      'Speed: '             + position.coords.speed             + '\n' +
      'Timestamp: '         + new Date(position.timestamp)      + '\n');

})

返回的位置对象保持精度:

var onSuccess = function(position) {
alert('Latitude: '          + position.coords.latitude          + '\n' +
      'Longitude: '         + position.coords.longitude         + '\n' +
      'Altitude: '          + position.coords.altitude          + '\n' +
      'Accuracy: '          + position.coords.accuracy          + '\n' +
      'Altitude Accuracy: ' + position.coords.altitudeAccuracy  + '\n' +
      'Heading: '           + position.coords.heading           + '\n' +
      'Speed: '             + position.coords.speed             + '\n' +
      'Timestamp: '         + new Date(position.timestamp)      + '\n');
})