Fix checkin page Android location issue
This commit is contained in:
@@ -938,18 +938,34 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
locationCaptureActive = true;
|
locationCaptureActive = true;
|
||||||
console.log("📍 Requesting enhanced location data...");
|
console.log("📍 Requesting enhanced location data (high accuracy)...");
|
||||||
|
|
||||||
const options = {
|
const highAccuracyOptions = {
|
||||||
enableHighAccuracy: true,
|
enableHighAccuracy: true,
|
||||||
timeout: 10000,
|
timeout: 15000, // 15 sec for GPS attempt
|
||||||
maximumAge: 300000,
|
maximumAge: 300000
|
||||||
};
|
};
|
||||||
|
|
||||||
navigator.geolocation.getCurrentPosition(
|
navigator.geolocation.getCurrentPosition(
|
||||||
handleEnhancedLocationSuccess,
|
handleEnhancedLocationSuccess,
|
||||||
handleEnhancedLocationError,
|
function(error) {
|
||||||
options
|
console.warn("⚠️ High accuracy failed:", error.message);
|
||||||
|
|
||||||
|
// Fallback to low accuracy
|
||||||
|
const lowAccuracyOptions = {
|
||||||
|
enableHighAccuracy: false,
|
||||||
|
timeout: 10000,
|
||||||
|
maximumAge: 600000
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log("📍 Retrying with low accuracy...");
|
||||||
|
navigator.geolocation.getCurrentPosition(
|
||||||
|
handleEnhancedLocationSuccess,
|
||||||
|
handleEnhancedLocationError,
|
||||||
|
lowAccuracyOptions
|
||||||
|
);
|
||||||
|
},
|
||||||
|
highAccuracyOptions
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user