diff --git a/src/components/LockedContent.tsx b/src/components/LockedContent.tsx index 7d158ff..f16cc40 100644 --- a/src/components/LockedContent.tsx +++ b/src/components/LockedContent.tsx @@ -58,7 +58,7 @@ const LocationButton = ({ } }, () => null, - { enableHighAccuracy: true, timeout: 5000, maximumAge: 0 } + { enableHighAccuracy: true, timeout: 27000, maximumAge: 10000 } ) setWatchId(id) diff --git a/src/scripts/initMap.js b/src/scripts/initMap.js index 001fcf1..ab408e7 100644 --- a/src/scripts/initMap.js +++ b/src/scripts/initMap.js @@ -6,6 +6,7 @@ let watchId = -1; function startWatchingLocation() { watchId = navigator.geolocation.watchPosition( (position) => { + console.log('watching') const pos = { lat: position.coords.latitude, lng: position.coords.longitude @@ -19,8 +20,10 @@ function startWatchingLocation() { } }, () => null, - { enableHighAccuracy: true, timeout: 5000, maximumAge: 0 } + { enableHighAccuracy: true, timeout: 27000, maximumAge: 10000 } ) + + console.log('trying', watchId) } var map = L.map('map').setView(TARGET_LOCATION, 13); @@ -73,6 +76,7 @@ L.Control.GoToCurrentLocation = L.Control.extend({ startWatchingLocation() locationButton.textContent = 'Konumuma Git'; } else { + console.log(currentLocationMarker) map.setView(currentLocationMarker.getLatLng(), 12); } }); diff --git a/src/scripts/initSelectionMap.js b/src/scripts/initSelectionMap.js index f811953..4f7a03c 100644 --- a/src/scripts/initSelectionMap.js +++ b/src/scripts/initSelectionMap.js @@ -39,7 +39,7 @@ function startWatchingLocation() { } }, () => null, - { enableHighAccuracy: true, timeout: 5000, maximumAge: 0 } + { enableHighAccuracy: true, timeout: 27000, maximumAge: 10000 } ) }