fix: skip guided zoom from schedules and fix offers slide-up animation

This commit is contained in:
2026-02-28 21:39:50 -05:00
parent ec1137b2c2
commit 147ea98cda
2 changed files with 21 additions and 9 deletions

View File

@ -28,7 +28,8 @@ export const useFlujoPrincipal = () => {
const procesarSeleccionDeRuta = async (
_ruta: { id: string },
paradas: BusStop[],
map: google.maps.Map | undefined
map: google.maps.Map | undefined,
skipGuidedZoom = false
) => {
if (!map) return
@ -67,7 +68,15 @@ export const useFlujoPrincipal = () => {
// ── PASO 3: Dibujar ruta completa (fondo, gris tenue) ─
await trazarRuta(paradasFormateadas, map, true);
// ── PASO 4: Calcular parada más cercana ───────────────
// ── PASO 4: Calcular parada más cercana (Omitir si skipGuidedZoom) ───────────────
if (skipGuidedZoom) {
// Si omitimos el zoom guiado, solo hacemos un zoom general a la ruta
const bounds = new google.maps.LatLngBounds()
paradasFormateadas.forEach(p => bounds.extend(new google.maps.LatLng(p.latitud, p.longitud)))
map.fitBounds(bounds, { top: 100, bottom: 100, left: 60, right: 60 })
return;
}
await encontrarParadaCercana(ubicacion, paradas, map)
const paradaCercanaFound = paradaCercana.value