@capgo/nativegeocoder 0.0.1 → 0.1.3
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/README.md
CHANGED
|
@@ -9,6 +9,26 @@ npm install @capgo/nativegeocoder
|
|
|
9
9
|
npx cap sync
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
+
## iOS
|
|
13
|
+
|
|
14
|
+
Apple requires privacy descriptions to be specified in `Info.plist` for location information:
|
|
15
|
+
|
|
16
|
+
- `NSLocationAlwaysUsageDescription` (`Privacy - Location Always Usage Description`)
|
|
17
|
+
- `NSLocationWhenInUseUsageDescription` (`Privacy - Location When In Use Usage Description`)
|
|
18
|
+
|
|
19
|
+
Read about [Configuring `Info.plist`](https://capacitorjs.com/docs/ios/configuration#configuring-infoplist) in the [iOS Guide](https://capacitorjs.com/docs/ios) for more information on setting iOS permissions in Xcode
|
|
20
|
+
|
|
21
|
+
## Android
|
|
22
|
+
|
|
23
|
+
This API requires the following permissions be added to your `AndroidManifest.xml`:
|
|
24
|
+
|
|
25
|
+
```xml
|
|
26
|
+
<!-- Geolocation API -->
|
|
27
|
+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
|
28
|
+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
|
29
|
+
<uses-feature android:name="android.hardware.location.gps" />
|
|
30
|
+
```
|
|
31
|
+
|
|
12
32
|
## API
|
|
13
33
|
|
|
14
34
|
<docgen-index>
|
|
@@ -28,8 +28,8 @@ public class NativeGeocoderPlugin extends Plugin {
|
|
|
28
28
|
}
|
|
29
29
|
@PluginMethod
|
|
30
30
|
public void forwardGeocode(PluginCall call) {
|
|
31
|
-
Number latitude = call.
|
|
32
|
-
Number longitude = call.
|
|
31
|
+
Number latitude = call.getDouble("latitude");
|
|
32
|
+
Number longitude = call.getDouble("longitude");
|
|
33
33
|
if (latitude == null || longitude == null) {
|
|
34
34
|
call.reject("Missing latitude or longitude");
|
|
35
35
|
return;
|
|
@@ -18,11 +18,11 @@ public class NativeGeocoderPlugin: CAPPlugin {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
@objc func forwardGeocode(_ call: CAPPluginCall) {
|
|
21
|
-
guard let latitude = call.
|
|
21
|
+
guard let latitude = call.getDouble("latitude") else {
|
|
22
22
|
call.reject("Missing latitude")
|
|
23
23
|
return
|
|
24
24
|
}
|
|
25
|
-
guard let longitude = call.
|
|
25
|
+
guard let longitude = call.getDouble("longitude") else {
|
|
26
26
|
call.reject("Missing longitude")
|
|
27
27
|
return
|
|
28
28
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/nativegeocoder",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.3",
|
|
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",
|
|
@@ -25,8 +25,9 @@
|
|
|
25
25
|
"keywords": [
|
|
26
26
|
"capacitor",
|
|
27
27
|
"plugin",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
28
|
+
"native",
|
|
29
|
+
"geocoding",
|
|
30
|
+
"geocoder"
|
|
30
31
|
],
|
|
31
32
|
"scripts": {
|
|
32
33
|
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|