From e691b6c9a2182ede263dd355d0d31f0f65c62380 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 13 Mar 2026 11:15:36 +0000 Subject: 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> --- src/frontend/app/hooks/useGeolocation.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/frontend/app/hooks') 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) { -- cgit v1.3