Cordova 科尔多瓦表位速度
我开发了一个应用程序,它使用watchposition来提高速度 但是当我在车上使用我的应用程序时,速度永远不会回到0Cordova 科尔多瓦表位速度,cordova,gps,Cordova,Gps,我开发了一个应用程序,它使用watchposition来提高速度 但是当我在车上使用我的应用程序时,速度永远不会回到0 onDeviceReady: function() { initPushwoosh(); id = navigator.geolocation.watchPosition(successCallback, errorCallback, {enableHighAccuracy:true, maximumAge:0, timeout:250}); 有什么解决办法吗
onDeviceReady: function() {
initPushwoosh();
id = navigator.geolocation.watchPosition(successCallback, errorCallback, {enableHighAccuracy:true, maximumAge:0, timeout:250});
有什么解决办法吗
谢谢我用以下源代码检查速度:
var speed_convert = position.coords.speed || null;
if(isNaN(parseFloat(speed_convert)) || speed_convert <= 0 || speed_convert == null)
speed_convert = 0;
else {
speed_convert = speed_convert * 3.6;
speed_convert = Math.round(speed_convert);
}
var-speed|u convert=position.coords.speed|null;
如果(isNaN(parseFloat(speed_convert))| | speed_convert是否正确应用了权限?启动应用程序时GPS是否打开?是的,它可以工作。我有当前速度,但当我的车停下来时,速度为12,5…但从未恢复到0公里,我从onDeviceReady调用了此函数