fix: can't determine location
This commit is contained in:
parent
0d7524edec
commit
d7809d80ab
|
@ -58,7 +58,7 @@ const LocationButton = ({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
() => null,
|
() => null,
|
||||||
{ enableHighAccuracy: true, timeout: 5000, maximumAge: 0 }
|
{ enableHighAccuracy: true, timeout: 27000, maximumAge: 10000 }
|
||||||
)
|
)
|
||||||
|
|
||||||
setWatchId(id)
|
setWatchId(id)
|
||||||
|
|
|
@ -6,6 +6,7 @@ let watchId = -1;
|
||||||
function startWatchingLocation() {
|
function startWatchingLocation() {
|
||||||
watchId = navigator.geolocation.watchPosition(
|
watchId = navigator.geolocation.watchPosition(
|
||||||
(position) => {
|
(position) => {
|
||||||
|
console.log('watching')
|
||||||
const pos = {
|
const pos = {
|
||||||
lat: position.coords.latitude,
|
lat: position.coords.latitude,
|
||||||
lng: position.coords.longitude
|
lng: position.coords.longitude
|
||||||
|
@ -19,8 +20,10 @@ function startWatchingLocation() {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
() => null,
|
() => 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);
|
var map = L.map('map').setView(TARGET_LOCATION, 13);
|
||||||
|
@ -73,6 +76,7 @@ L.Control.GoToCurrentLocation = L.Control.extend({
|
||||||
startWatchingLocation()
|
startWatchingLocation()
|
||||||
locationButton.textContent = 'Konumuma Git';
|
locationButton.textContent = 'Konumuma Git';
|
||||||
} else {
|
} else {
|
||||||
|
console.log(currentLocationMarker)
|
||||||
map.setView(currentLocationMarker.getLatLng(), 12);
|
map.setView(currentLocationMarker.getLatLng(), 12);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -39,7 +39,7 @@ function startWatchingLocation() {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
() => null,
|
() => null,
|
||||||
{ enableHighAccuracy: true, timeout: 5000, maximumAge: 0 }
|
{ enableHighAccuracy: true, timeout: 27000, maximumAge: 10000 }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user