Skip to content

Commit 909499f

Browse files
committed
fix: onLocationChanged event structure on Android
1 parent 728e8a0 commit 909499f

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

android/src/main/java/com/google/android/react/navsdk/NavModule.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -756,20 +756,14 @@ private void registerLocationListener() {
756756
@Override
757757
public void onLocationChanged(final Location location) {
758758
if (mIsListeningRoadSnappedLocation) {
759-
WritableNativeArray params = new WritableNativeArray();
760-
params.pushMap(ObjectTranslationUtil.getMapFromLocation(location));
761-
762-
sendCommandToReactNative("onLocationChanged", params);
759+
sendCommandToReactNative("onLocationChanged", ObjectTranslationUtil.getMapFromLocation(location));
763760
}
764761
}
765762

766763
@Override
767764
public void onRawLocationUpdate(final Location location) {
768765
if (mIsListeningRoadSnappedLocation) {
769-
WritableNativeArray params = new WritableNativeArray();
770-
params.pushMap(ObjectTranslationUtil.getMapFromLocation(location));
771-
772-
sendCommandToReactNative("onRawLocationChanged", params);
766+
sendCommandToReactNative("onRawLocationChanged", ObjectTranslationUtil.getMapFromLocation(location));
773767
}
774768
}
775769
};

0 commit comments

Comments
 (0)