From 8ecf3e6373e2a5fd9b1fb1ec07a17c60e71ccfe6 Mon Sep 17 00:00:00 2001 From: Joonas Kerttula Date: Thu, 6 Jun 2024 20:07:37 +0300 Subject: [PATCH 1/3] fix: improve location interface --- components/shared/types.ts | 51 ++++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/components/shared/types.ts b/components/shared/types.ts index 306382a..0ff202c 100644 --- a/components/shared/types.ts +++ b/components/shared/types.ts @@ -28,17 +28,52 @@ export interface LatLng { * An immutable class representing the device location in Navigation SDK. */ export interface Location { - /** Value representing the latitude of the location in degrees. */ + /** + * Value representing the latitude of the location in degrees. + */ lat: number; - /** Value representing the longitude of the location in degrees. */ + + /** + * Value representing the longitude of the location in degrees. + */ lng: number; - /** Number in meters that represents the altitude of the location. */ - altitude: number; + + /** + * Number in meters that represents the altitude of the location. + */ + altitude?: number; + + /** + * The bearing at the time of this location in degrees. + * Bearing is the horizontal direction of travel of this device and is + * unrelated to the device orientation. + */ + bearing?: number; + + /** + * The speed at the time of this location in meters per second + */ speed: number; - /** Number in meters that represents the horizontal accuracy of the location. */ + + /** + * Number in meters that represents the horizontal accuracy + * of the location. + */ accuracy: number; - /** Number in meters that represents the vertical accuracy of the location. */ - verticalAccuracy: number; - /** Time when the location was sourced represented as ellapse milliseconds since Unix Epoch. */ + + /** + * Number in meters that represents the vertical accuracy of the location. + */ + verticalAccuracy?: number; + + /** + * The name of the provider associated with this location. Android only. + */ + provider?: string; + + /** + * Time when the location was sourced represented as + * ellapse milliseconds since Unix Epoch. + */ time: number; } From a2ab1329307a7c06c3d8180e689878fe450fa57f Mon Sep 17 00:00:00 2001 From: Joonas Kerttula Date: Thu, 6 Jun 2024 20:08:19 +0300 Subject: [PATCH 2/3] fix: use proper longitude value for location on iOS --- ios/react-native-navigation-sdk/ObjectTranslationUtil.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/react-native-navigation-sdk/ObjectTranslationUtil.m b/ios/react-native-navigation-sdk/ObjectTranslationUtil.m index 318a8c9..15f9280 100644 --- a/ios/react-native-navigation-sdk/ObjectTranslationUtil.m +++ b/ios/react-native-navigation-sdk/ObjectTranslationUtil.m @@ -51,7 +51,7 @@ + (NSDictionary *)transformCLLocationToDictionary:(CLLocation *)location { return @{ @"lat" : @(location.coordinate.latitude), - @"lng" : @(location.coordinate.latitude), + @"lng" : @(location.coordinate.longitude), @"time" : @(time), @"accuracy" : @(location.horizontalAccuracy), @"altitude" : @(location.altitude), From 33524adca21d31167b16cf42400b0f8559062b8c Mon Sep 17 00:00:00 2001 From: Joonas Kerttula Date: Thu, 6 Jun 2024 20:09:12 +0300 Subject: [PATCH 3/3] chore: update version number --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4301bba..0d3552c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "react-native-navigation-sdk", - "version": "0.3.2-beta", + "version": "0.3.3-beta", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "react-native-navigation-sdk", - "version": "0.3.2-beta", + "version": "0.3.3-beta", "license": "UNLICENSED", "devDependencies": { "@types/jest": "^29.5.3", diff --git a/package.json b/package.json index 89242ab..7dca858 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-navigation-sdk", - "version": "0.3.2-beta", + "version": "0.3.3-beta", "author": "Google", "description": "A react-native library for Google's Navigation SDK", "private": false,