capacitor-mapboxnav 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/android/build.gradle
CHANGED
|
@@ -62,7 +62,7 @@ repositories {
|
|
|
62
62
|
// This should always be `mapbox` (not your username).
|
|
63
63
|
username = "mapbox"
|
|
64
64
|
// Use the secret token you stored in gradle.properties as the password
|
|
65
|
-
password = project.
|
|
65
|
+
password = project.findProperty("MAPBOX_DOWNLOADS_TOKEN") ?: System.getenv("MAPBOX_DOWNLOADS_TOKEN") ?: ""
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
}
|
package/android/src/main/java/com/castelioit/capacitormapboxnav/capacitormapboxnavPlugin.java
CHANGED
|
@@ -27,8 +27,14 @@ public class capacitormapboxnavPlugin extends Plugin {
|
|
|
27
27
|
call.reject("AccessToken is required");
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
getActivity().runOnUiThread(() -> {
|
|
31
|
+
try {
|
|
32
|
+
implementation.initialize(getContext(), accessToken);
|
|
33
|
+
call.resolve();
|
|
34
|
+
} catch (Exception e) {
|
|
35
|
+
call.reject("Initialization failed: " + e.getMessage());
|
|
36
|
+
}
|
|
37
|
+
});
|
|
32
38
|
}
|
|
33
39
|
|
|
34
40
|
@PluginMethod
|
|
@@ -52,7 +58,13 @@ public class capacitormapboxnavPlugin extends Plugin {
|
|
|
52
58
|
return;
|
|
53
59
|
}
|
|
54
60
|
|
|
55
|
-
|
|
56
|
-
|
|
61
|
+
getActivity().runOnUiThread(() -> {
|
|
62
|
+
try {
|
|
63
|
+
implementation.startNavigation(getActivity(), originLat, originLng, destLat, destLng, simulateRoute);
|
|
64
|
+
call.resolve();
|
|
65
|
+
} catch (Exception e) {
|
|
66
|
+
call.reject("Failed to start navigation: " + e.getMessage());
|
|
67
|
+
}
|
|
68
|
+
});
|
|
57
69
|
}
|
|
58
70
|
}
|