From e2b39c3b62136a07c26aa671949c969c9aa1e3d1 Mon Sep 17 00:00:00 2001 From: Tony Franzese <149198124+tfranzese-woolpert@users.noreply.github.com> Date: Mon, 5 Aug 2024 13:29:38 -0400 Subject: [PATCH] fix: simulate location (#219) * fix: iOS simulate location * fix: Android simulate location --- .../google/android/react/navsdk/NavModule.java | 15 ++++++--------- ios/react-native-navigation-sdk/NavModule.m | 4 ++-- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/android/src/main/java/com/google/android/react/navsdk/NavModule.java b/android/src/main/java/com/google/android/react/navsdk/NavModule.java index b0814c3..f3c6dfa 100644 --- a/android/src/main/java/com/google/android/react/navsdk/NavModule.java +++ b/android/src/main/java/com/google/android/react/navsdk/NavModule.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 Google LLC + * Copyright 2024 Google LLC * *
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of the License at
@@ -610,15 +610,12 @@ private void sendCommandToReactNative(String functionName, String args) {
}
}
- public void simulateLocation(Map map) {
+ @ReactMethod
+ public void simulateLocation(ReadableMap location) {
if (mNavigator != null) {
- Double lat = null;
- Double lng = null;
- if (map.containsKey("location")) {
- Map latlng = (Map) map.get("location");
- if (latlng.get("lat") != null) lat = Double.parseDouble(latlng.get("lat").toString());
- if (latlng.get("lng") != null) lng = Double.parseDouble(latlng.get("lng").toString());
- }
+ HashMap