Skip to content

Commit 467f0c2

Browse files
authored
Merge pull request #169 from googlemaps/fix/issues-with-location-data
Fixes issues with location interface and data
2 parents a8ce097 + 33524ad commit 467f0c2

File tree

4 files changed

+47
-12
lines changed

4 files changed

+47
-12
lines changed

components/shared/types.ts

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,52 @@ export interface LatLng {
2828
* An immutable class representing the device location in Navigation SDK.
2929
*/
3030
export interface Location {
31-
/** Value representing the latitude of the location in degrees. */
31+
/**
32+
* Value representing the latitude of the location in degrees.
33+
*/
3234
lat: number;
33-
/** Value representing the longitude of the location in degrees. */
35+
36+
/**
37+
* Value representing the longitude of the location in degrees.
38+
*/
3439
lng: number;
35-
/** Number in meters that represents the altitude of the location. */
36-
altitude: number;
40+
41+
/**
42+
* Number in meters that represents the altitude of the location.
43+
*/
44+
altitude?: number;
45+
46+
/**
47+
* The bearing at the time of this location in degrees.
48+
* Bearing is the horizontal direction of travel of this device and is
49+
* unrelated to the device orientation.
50+
*/
51+
bearing?: number;
52+
53+
/**
54+
* The speed at the time of this location in meters per second
55+
*/
3756
speed: number;
38-
/** Number in meters that represents the horizontal accuracy of the location. */
57+
58+
/**
59+
* Number in meters that represents the horizontal accuracy
60+
* of the location.
61+
*/
3962
accuracy: number;
40-
/** Number in meters that represents the vertical accuracy of the location. */
41-
verticalAccuracy: number;
42-
/** Time when the location was sourced represented as ellapse milliseconds since Unix Epoch. */
63+
64+
/**
65+
* Number in meters that represents the vertical accuracy of the location.
66+
*/
67+
verticalAccuracy?: number;
68+
69+
/**
70+
* The name of the provider associated with this location. Android only.
71+
*/
72+
provider?: string;
73+
74+
/**
75+
* Time when the location was sourced represented as
76+
* ellapse milliseconds since Unix Epoch.
77+
*/
4378
time: number;
4479
}

ios/react-native-navigation-sdk/ObjectTranslationUtil.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ + (NSDictionary *)transformCLLocationToDictionary:(CLLocation *)location {
5151

5252
return @{
5353
@"lat" : @(location.coordinate.latitude),
54-
@"lng" : @(location.coordinate.latitude),
54+
@"lng" : @(location.coordinate.longitude),
5555
@"time" : @(time),
5656
@"accuracy" : @(location.horizontalAccuracy),
5757
@"altitude" : @(location.altitude),

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-navigation-sdk",
3-
"version": "0.3.2-beta",
3+
"version": "0.3.3-beta",
44
"author": "Google",
55
"description": "A react-native library for Google's Navigation SDK",
66
"private": false,

0 commit comments

Comments
 (0)