WIP show POI list on click, save to RS

This commit is contained in:
2026-01-16 10:47:05 +07:00
parent 46079e96e3
commit 5f6a13386b
9 changed files with 525 additions and 22 deletions

14
app/utils/geo.js Normal file
View File

@@ -0,0 +1,14 @@
export function getDistance(lat1, lon1, lat2, lon2) {
const R = 6371e3; // metres
const φ1 = (lat1 * Math.PI) / 180; // φ, λ in radians
const φ2 = (lat2 * Math.PI) / 180;
const Δφ = ((lat2 - lat1) * Math.PI) / 180;
const Δλ = ((lon2 - lon1) * Math.PI) / 180;
const a =
Math.sin(Δφ / 2) * Math.sin(Δφ / 2) +
Math.cos(φ1) * Math.cos(φ2) * Math.sin(Δλ / 2) * Math.sin(Δλ / 2);
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
return R * c; // in metres
}