chore: fix url

This commit is contained in:
2026-03-06 17:00:54 +01:00
parent e4462a1d69
commit 40633d437d
2 changed files with 5 additions and 9 deletions
+3 -8
View File
@@ -13,7 +13,7 @@ export interface RouteInfo {
duration: string; // e.g. "8 min"
distanceMeters: number;
durationSeconds: number;
coordinates: LatLng[]; // polyline points
coordinates: LatLng[];
}
export interface NavigationInstruction {
@@ -80,9 +80,7 @@ function formatDistance(meters: number): string {
}
// ---- Geocode address → coords ----
export async function geocodeAddress(
address: string,
): Promise<LatLng | null> {
export async function geocodeAddress(address: string): Promise<LatLng | null> {
try {
const url = `https://api.tomtom.com/search/2/geocode/${encodeURIComponent(address)}.json?key=${TOMTOM_API_KEY}&limit=1`;
const { data } = await axios.get(url);
@@ -189,10 +187,7 @@ export async function calculateRoute(
}
// ---- Bearing calculation ----
export function calculateBearing(
from: LatLng,
to: LatLng,
): number {
export function calculateBearing(from: LatLng, to: LatLng): number {
const φ1 = (from.latitude * Math.PI) / 180;
const φ2 = (to.latitude * Math.PI) / 180;
const Δλ = ((to.longitude - from.longitude) * Math.PI) / 180;