Actualizar calendario.html
This commit is contained in:
@@ -516,7 +516,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// CÁLCULO DE GPS CORREGIDO CON FALLBACK Y MANEJO DE ERRORES
|
// CÁLCULO DE GPS ULTRARRÁPIDO CON FALLBACK Y TIMEOUT
|
||||||
async function calculateDistance(dest) {
|
async function calculateDistance(dest) {
|
||||||
const loading = document.getElementById('gpsLoading');
|
const loading = document.getElementById('gpsLoading');
|
||||||
const result = document.getElementById('gpsResult');
|
const result = document.getElementById('gpsResult');
|
||||||
@@ -532,6 +532,13 @@
|
|||||||
result.classList.add('hidden');
|
result.classList.add('hidden');
|
||||||
lucide.createIcons();
|
lucide.createIcons();
|
||||||
|
|
||||||
|
// OPCIONES MÁGICAS PARA QUE SEA INSTANTÁNEO
|
||||||
|
const gpsOptions = {
|
||||||
|
enableHighAccuracy: false, // Usa antenas/wifi en vez de buscar satélites (tarda milisegundos en vez de minutos)
|
||||||
|
timeout: 8000, // Máximo 8 segundos de espera, si no, cancela
|
||||||
|
maximumAge: 300000 // Permite usar la ubicación de hace 5 minutos si ya la sabe
|
||||||
|
};
|
||||||
|
|
||||||
navigator.geolocation.getCurrentPosition(async (pos) => {
|
navigator.geolocation.getCurrentPosition(async (pos) => {
|
||||||
const lat = pos.coords.latitude;
|
const lat = pos.coords.latitude;
|
||||||
const lon = pos.coords.longitude;
|
const lon = pos.coords.longitude;
|
||||||
@@ -564,8 +571,8 @@
|
|||||||
loading.innerHTML = '<span class="text-[9px]">Error de red</span>';
|
loading.innerHTML = '<span class="text-[9px]">Error de red</span>';
|
||||||
}
|
}
|
||||||
}, (err) => {
|
}, (err) => {
|
||||||
loading.innerHTML = '<span class="text-[9px]">Permiso GPS denegado</span>';
|
loading.innerHTML = '<span class="text-[9px]">GPS Lento/Denegado</span>';
|
||||||
});
|
}, gpsOptions); // <- AQUÍ PASAMOS LAS OPCIONES DE VELOCIDAD
|
||||||
}
|
}
|
||||||
|
|
||||||
async function quickUpdate(action) {
|
async function quickUpdate(action) {
|
||||||
|
|||||||
Reference in New Issue
Block a user