forked from Blendman974/faceclaw
Port navigate and weather
This commit is contained in:
1 parent
2b3e068a23
commit
9e18745e53
33 files changed
+630
-60
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import { type NavigationSensorEvent } from './navigation-sensors-messages'
|
||||
export { LocationTracker, type TrackedLocation } from '../../native/location-tracker'
|
||||
export { addCompassListener, setCompassEnabled, COMPASS_CHANGED, type CompassEvent } from '../../native/compass'
|
||||
import { magneticDeclinationDegrees as calculate } from '../../native/geomagnetic'
|
||||
let cached: { latitude: number; longitude: number; degrees: number | null } | null = null
|
||||
export function magneticDeclinationDegrees(latitude: number, longitude: number): number | null {
|
||||
if (!cached || Math.abs(latitude - cached.latitude) > 0.5 || Math.abs(longitude - cached.longitude) > 0.5)
|
||||
cached = { latitude, longitude, degrees: calculate(latitude, longitude) }
|
||||
return cached.degrees
|
||||
}
|
||||
|
||||
/** Android delivers native callbacks directly on the worker's Looper. */
|
||||
export function handleNavigationSensorEvent(_event: NavigationSensorEvent): void {}
|
||||
Reference in new issue
Block a user