Skip to content

Commit

Permalink
Merge pull request #169 from googlemaps/fix/issues-with-location-data
Browse files Browse the repository at this point in the history
Fixes issues with location interface and data
  • Loading branch information
caio1985 authored Jun 6, 2024
2 parents a8ce097 + 33524ad commit 467f0c2
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 12 deletions.
51 changes: 43 additions & 8 deletions components/shared/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion ios/react-native-navigation-sdk/ObjectTranslationUtil.m
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down

0 comments on commit 467f0c2

Please sign in to comment.