Skip to content

Commit 7027021

Browse files
kuzkokovchristopherdro
authored andcommitted
Add heading to the onUserLocationChange listener (#3045)
1 parent 094f864 commit 7027021

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ declare module "react-native-maps" {
125125
timestamp: number;
126126
accuracy: number;
127127
speed: number;
128+
heading: number;
128129
isFromMockProvider: boolean;
129130
};
130131
};

lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ public void onMyLocationChange(Location location){
230230
coordinate.putDouble("timestamp", location.getTime());
231231
coordinate.putDouble("accuracy", location.getAccuracy());
232232
coordinate.putDouble("speed", location.getSpeed());
233+
coordinate.putDouble("heading", location.getBearing());
233234
if(android.os.Build.VERSION.SDK_INT >= 18){
234235
coordinate.putBoolean("isFromMockProvider", location.isFromMockProvider());
235236
}

lib/ios/AirGoogleMaps/AIRGoogleMap.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath
789789
@"accuracy": @(location.horizontalAccuracy),
790790
@"altitudeAccuracy": @(location.verticalAccuracy),
791791
@"speed": @(location.speed),
792+
@"heading": @(location.course),
792793
}
793794
};
794795

0 commit comments

Comments
 (0)