fix: lỗi áp dụng recipe lên live view của camera
This commit is contained in:
@@ -50,6 +50,18 @@ export async function getCurrentGPS(): Promise<GPSInfo | null> {
|
||||
}
|
||||
}
|
||||
|
||||
export async function reverseGeocode(latitude: number, longitude: number): Promise<string | null> {
|
||||
try {
|
||||
const geo = await Location.reverseGeocodeAsync({ latitude, longitude });
|
||||
if (geo && geo.length > 0) {
|
||||
return (geo[0].subregion || geo[0].city || geo[0].region || '').toUpperCase() || null;
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('Reverse geocode failed:', e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
export function formatCoordinate(val: number, type: 'lat' | 'lon'): string {
|
||||
const absolute = Math.abs(val);
|
||||
const degrees = Math.floor(absolute);
|
||||
|
||||
Reference in New Issue
Block a user