chore: fix url
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user