This commit is contained in:
Vincent van der Wal
2026-08-01 17:58:03 +02:00
parent b2c8108c8c
commit 01cc6225aa
430 changed files with 3150 additions and 441 deletions
+8 -1
View File
@@ -13,7 +13,14 @@ export const geoLocationNameToRoute = (name: string) => {
// selections navigate here directly, no geocoding id involved
const COORD_ROUTE = /^(-?\d+(?:\.\d+)?)N(-?\d+(?:\.\d+)?)E$/i;
export function buildLocationRoute(location: GeoLocation): string {
/** Only the fields the route is built from, so callers holding a partial record
* (the nearby-cities list, for one) don't have to fake a whole GeoLocation. */
export type RoutableLocation = Pick<
GeoLocation,
'id' | 'name' | 'latitude' | 'longitude' | 'feature_code' | 'population'
>;
export function buildLocationRoute(location: RoutableLocation): string {
// coordinate-only locations (GPS) have no real geocoding id
if (location.feature_code === 'COORD' || !location.id) {
return `${location.latitude.toFixed(4)}N${location.longitude.toFixed(4)}E`;