問題:detectLocationtimersset()ロジックが機能していないようです。私はサブルーチンが実行されることを知っていますが、elseが間違っている場合は倍数だと思いますか?
detectLocationtimersset()の理由は、複数のタイマーが設定されないようにするためのロジックがあるためです。
最初にデータ時間に基づいてタイマーを設定するために最初のif/elseを作成し、次にセンスチェックを行うために2番目のif/elseを作成しました。
detectLocation()はテスト済みであり、それ自体で機能します。
var detectLocationtimerset = 0;
var datatime = 1;
function detectLocationtimersset() {
// Setup timer to check for new data start
// check and see if set
if (detectLocationtimerset = 0 ) {
detectLocationtimerset = 1;
if (datatime == null) {
datatime = 9;
milliseconds = (datatime * 60000)
setInterval(function () {
detectLocation();
console.log("detectLocation() timer set");
}, milliseconds);
} else {
detectLocationtimerset = 1;
milliseconds = (datatime * 60000)
setInterval(function () {
detectLocation();
console.log("detectLocation() timer set");
}, milliseconds);
}
}
};