diff options
| author | copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> | 2026-03-13 11:15:36 +0000 |
|---|---|---|
| committer | copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> | 2026-03-13 11:15:36 +0000 |
| commit | e691b6c9a2182ede263dd355d0d31f0f65c62380 (patch) | |
| tree | 953089fa34e46fd63cf92c487a62b4c175d0252c /src/frontend/app/hooks | |
| parent | 8b4252dc937d6c937bd718515f03dd48948a1519 (diff) | |
fix: address code review - clarify [lat,lng] convention, add effect deps, use ref for initial permission"
Co-authored-by: arielcostas <94913521+arielcostas@users.noreply.github.com>
Diffstat (limited to 'src/frontend/app/hooks')
| -rw-r--r-- | src/frontend/app/hooks/useGeolocation.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/frontend/app/hooks/useGeolocation.ts b/src/frontend/app/hooks/useGeolocation.ts index 572a40c..878420b 100644 --- a/src/frontend/app/hooks/useGeolocation.ts +++ b/src/frontend/app/hooks/useGeolocation.ts @@ -12,7 +12,10 @@ function lngLatToCoords( loc: LngLatLike ): { latitude: number; longitude: number } { if (Array.isArray(loc)) { - // Stored as [lat, lng] per codebase convention + // This codebase stores location as [latitude, longitude] (not the standard + // MapLibre [lng, lat] GeoJSON order). See MapContext.tsx where arrays are + // set as [position.coords.latitude, position.coords.longitude], and AppMap.tsx + // where getLatitude(center) returns center[0]. return { latitude: loc[0], longitude: loc[1] }; } if ("lat" in loc) { |
