diff --git a/map/game/game.js b/map/game/game.js index 1c7dfa9..0477796 100644 --- a/map/game/game.js +++ b/map/game/game.js @@ -27,11 +27,10 @@ info.innerHTML = '距離: '+Math.round(totalDist*100)/100+'m'; } - function stopGPS() { + function stopGPS() { // watchが動いていたら止めてnullにする console.log("watchId="+watchId); - if (watchId != null) { + if (watchId != null) { // nullかどうかで比較しないとだめ(初期値0) navigator.geolocation.clearWatch(watchId); - document.getElementById("title").textContent = "stop"; gpsmarker.setPopupContent("停めました"); } watchId = null; @@ -41,7 +40,6 @@ watchId = navigator.geolocation.watchPosition( onSuccess, onError,{ maximumAge: 0, timeout: 3000, enableHighAccuracy: true}); - document.getElementById("title").textContent = "START"; } function onSuccess(pos) { var latlng = L.latLng([pos.coords.latitude, pos.coords.longitude]);