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