chore: fix url
This commit is contained in:
@@ -13,7 +13,7 @@ export interface RouteInfo {
|
|||||||
duration: string; // e.g. "8 min"
|
duration: string; // e.g. "8 min"
|
||||||
distanceMeters: number;
|
distanceMeters: number;
|
||||||
durationSeconds: number;
|
durationSeconds: number;
|
||||||
coordinates: LatLng[]; // polyline points
|
coordinates: LatLng[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface NavigationInstruction {
|
export interface NavigationInstruction {
|
||||||
@@ -80,9 +80,7 @@ function formatDistance(meters: number): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ---- Geocode address → coords ----
|
// ---- Geocode address → coords ----
|
||||||
export async function geocodeAddress(
|
export async function geocodeAddress(address: string): Promise<LatLng | null> {
|
||||||
address: string,
|
|
||||||
): Promise<LatLng | null> {
|
|
||||||
try {
|
try {
|
||||||
const url = `https://api.tomtom.com/search/2/geocode/${encodeURIComponent(address)}.json?key=${TOMTOM_API_KEY}&limit=1`;
|
const url = `https://api.tomtom.com/search/2/geocode/${encodeURIComponent(address)}.json?key=${TOMTOM_API_KEY}&limit=1`;
|
||||||
const { data } = await axios.get(url);
|
const { data } = await axios.get(url);
|
||||||
@@ -189,10 +187,7 @@ export async function calculateRoute(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ---- Bearing calculation ----
|
// ---- Bearing calculation ----
|
||||||
export function calculateBearing(
|
export function calculateBearing(from: LatLng, to: LatLng): number {
|
||||||
from: LatLng,
|
|
||||||
to: LatLng,
|
|
||||||
): number {
|
|
||||||
const φ1 = (from.latitude * Math.PI) / 180;
|
const φ1 = (from.latitude * Math.PI) / 180;
|
||||||
const φ2 = (to.latitude * Math.PI) / 180;
|
const φ2 = (to.latitude * Math.PI) / 180;
|
||||||
const Δλ = ((to.longitude - from.longitude) * Math.PI) / 180;
|
const Δλ = ((to.longitude - from.longitude) * Math.PI) / 180;
|
||||||
|
|||||||
+2
-1
@@ -27,7 +27,8 @@
|
|||||||
"versionCode": 1,
|
"versionCode": 1,
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"android.permission.VIBRATE"
|
"android.permission.VIBRATE"
|
||||||
]
|
],
|
||||||
|
"usesCleartextTraffic": true
|
||||||
},
|
},
|
||||||
"web": {
|
"web": {
|
||||||
"favicon": "./assets/icon.png"
|
"favicon": "./assets/icon.png"
|
||||||
|
|||||||
Reference in New Issue
Block a user