Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cordova 科尔多瓦表位速度_Cordova_Gps - Fatal编程技术网

Cordova 科尔多瓦表位速度

Cordova 科尔多瓦表位速度,cordova,gps,Cordova,Gps,我开发了一个应用程序,它使用watchposition来提高速度 但是当我在车上使用我的应用程序时,速度永远不会回到0 onDeviceReady: function() { initPushwoosh(); id = navigator.geolocation.watchPosition(successCallback, errorCallback, {enableHighAccuracy:true, maximumAge:0, timeout:250}); 有什么解决办法吗

我开发了一个应用程序,它使用watchposition来提高速度

但是当我在车上使用我的应用程序时,速度永远不会回到0

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调用了此函数