@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
- private void reverseGeocode(double latitude, double longitude, PluginCall call) {
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
- private void forwardGeocode(String addressString, PluginCall call) {
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
- String addressString = call.getString("addressString");
22
- if (addressString == null) {
23
- call.reject("Missing addressString");
24
- return;
25
- }
26
- implementation.reverseGeocode(addressString, call);
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
- Number latitude = call.getDouble("latitude");
31
- Number longitude = call.getDouble("longitude");
32
- if (latitude == null || longitude == null) {
33
- call.reject("Missing latitude or longitude");
34
- return;
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/nativegeocoder",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Capacitor plugin for native forward and reverse geocoding",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",