diff options
| author | Ariel Costas Guerrero <ariel@costas.dev> | 2026-03-13 10:09:30 +0100 |
|---|---|---|
| committer | Ariel Costas Guerrero <ariel@costas.dev> | 2026-03-13 10:09:30 +0100 |
| commit | 56c2e739d95dd7b64a7332e2320579925c1751a9 (patch) | |
| tree | 256127c61846be48b579a2f3e461d3d89feb4adc /src/frontend/app/components | |
| parent | b3f5bfad9c2d1ac92debb389fd7a774a6cdb5109 (diff) | |
Refactor geolocation settings across components; improve accuracy and timeout configurations
Diffstat (limited to 'src/frontend/app/components')
| -rw-r--r-- | src/frontend/app/components/layout/NavBar.tsx | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/frontend/app/components/layout/NavBar.tsx b/src/frontend/app/components/layout/NavBar.tsx index 57e2f9d..5822ce7 100644 --- a/src/frontend/app/components/layout/NavBar.tsx +++ b/src/frontend/app/components/layout/NavBar.tsx @@ -6,21 +6,6 @@ import { usePlanner } from "~/hooks/usePlanner"; import { useApp } from "../../AppContext"; import styles from "./NavBar.module.css"; -// Helper: check if coordinates are within Vigo bounds -function isWithinVigo(lngLat: LngLatLike): boolean { - let lng: number, lat: number; - if (Array.isArray(lngLat)) { - [lng, lat] = lngLat; - } else if ("lng" in lngLat && "lat" in lngLat) { - lng = lngLat.lng; - lat = lngLat.lat; - } else { - return false; - } - // Rough bounding box for Vigo - return lat >= 42.18 && lat <= 42.3 && lng >= -8.78 && lng <= -8.65; -} - interface NavBarProps { orientation?: "horizontal" | "vertical"; } @@ -56,9 +41,7 @@ export default function NavBar({ orientation = "horizontal" }: NavBarProps) { (position) => { const { latitude, longitude } = position.coords; const coords: LngLatLike = [latitude, longitude]; - if (isWithinVigo(coords)) { - updateMapState(coords, 16); - } + updateMapState(coords, 16, "gps"); }, () => {}, { |
