@capgo/nativegeocoder 0.1.9 → 0.1.10
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.
|
@@ -32,7 +32,7 @@ public class NativeGeocoder {
|
|
|
32
32
|
* @param longitude double
|
|
33
33
|
* @param call PluginCall
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
public void reverseGeocode(double latitude, double longitude, PluginCall call) {
|
|
36
36
|
|
|
37
37
|
if (latitude == 0 || longitude == 0) {
|
|
38
38
|
call.reject("Expected two non-empty double arguments.");
|
|
@@ -95,7 +95,7 @@ public class NativeGeocoder {
|
|
|
95
95
|
* @param addressString String
|
|
96
96
|
* @param call PluginCall
|
|
97
97
|
*/
|
|
98
|
-
|
|
98
|
+
public void forwardGeocode(String addressString, PluginCall call) {
|
|
99
99
|
if (addressString == null || addressString.length() == 0) {
|
|
100
100
|
call.reject("Expected a non-empty string argument.");
|
|
101
101
|
return;
|
|
@@ -18,21 +18,21 @@ public class NativeGeocoderPlugin extends Plugin {
|
|
|
18
18
|
|
|
19
19
|
@PluginMethod
|
|
20
20
|
public void reverseGeocode(PluginCall call) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
Double latitude = call.getDouble("latitude");
|
|
22
|
+
Double longitude = call.getDouble("longitude");
|
|
23
|
+
if (latitude == null || longitude == null) {
|
|
24
|
+
call.reject("Missing latitude or longitude");
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
implementation.reverseGeocode(latitude, longitude, call);
|
|
27
28
|
}
|
|
28
29
|
@PluginMethod
|
|
29
30
|
public void forwardGeocode(PluginCall call) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
implementation.forwardGeocode(latitude, longitude, call);
|
|
31
|
+
String addressString = call.getString("addressString");
|
|
32
|
+
if (addressString == null) {
|
|
33
|
+
call.reject("Missing addressString");
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
implementation.forwardGeocode(addressString, call);
|
|
37
37
|
}
|
|
38
38
|
}
|