Push location config to client
We'll let the default stay the default.
This commit is contained in:
parent
28cf7683a7
commit
da90401b2d
2 changed files with 13 additions and 4 deletions
|
|
@ -174,8 +174,13 @@ function updateModel(
|
||||||
emit("update:modelValue", newLocator);
|
emit("update:modelValue", newLocator);
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
const geo_config = {
|
||||||
|
enableHighAccuracy: true,
|
||||||
|
maximumAge: Infinity,
|
||||||
|
timeout: 10000,
|
||||||
|
};
|
||||||
storeLocation
|
storeLocation
|
||||||
.get()
|
.get(geo_config)
|
||||||
.then((loc: GeolocationPosition) => {
|
.then((loc: GeolocationPosition) => {
|
||||||
console.log("user geolocation", loc);
|
console.log("user geolocation", loc);
|
||||||
const coords = loc.coords;
|
const coords = loc.coords;
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,14 @@ export const useStoreLocation = defineStore("location", () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default options if none provided
|
// Default options if none provided
|
||||||
const geolocationOptions = options || {
|
const geolocationOptions =
|
||||||
|
options ||
|
||||||
|
{
|
||||||
|
/*
|
||||||
enableHighAccuracy: true,
|
enableHighAccuracy: true,
|
||||||
timeout: 5000,
|
timeout: 60000,
|
||||||
maximumAge: 0,
|
maximumAge: 0,
|
||||||
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
// Call the geolocation API
|
// Call the geolocation API
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue