capacitor-google-navigation 0.1.6 → 0.1.8
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
|
@@ -548,6 +548,37 @@ The Navigation SDK requires explicit enrollment — it is not available to all G
|
|
|
548
548
|
2. Your project has been granted access (you may need to request it via the [Navigation SDK get started page](https://developers.google.com/maps/documentation/navigation/ios-sdk/get-started))
|
|
549
549
|
3. Billing is active on the project
|
|
550
550
|
|
|
551
|
+
**Android — `Duplicate class` build error**
|
|
552
|
+
The Navigation SDK bundles Maps SDK and Location classes internally. Do not add `play-services-maps` or `play-services-location` as separate dependencies in your app or any plugin — they will conflict with the classes already inside the Navigation SDK AAR and cause a dex merge failure.
|
|
553
|
+
|
|
554
|
+
If you see an error like:
|
|
555
|
+
```
|
|
556
|
+
Duplicate class com.google.android.gms.maps.* found in modules ...
|
|
557
|
+
```
|
|
558
|
+
Check `android/app/build.gradle` and any plugin `build.gradle` files and remove any explicit `play-services-maps` or `play-services-location` dependencies.
|
|
559
|
+
|
|
560
|
+
**Android — `core library desugaring` build error**
|
|
561
|
+
The Navigation SDK requires core library desugaring to be enabled in the consuming app. If you see:
|
|
562
|
+
|
|
563
|
+
```
|
|
564
|
+
Dependency 'com.google.android.libraries.navigation:navigation:x.x.x' requires
|
|
565
|
+
core library desugaring to be enabled for :app.
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
Add the following to your app's `android/app/build.gradle`:
|
|
569
|
+
|
|
570
|
+
```groovy
|
|
571
|
+
android {
|
|
572
|
+
compileOptions {
|
|
573
|
+
coreLibraryDesugaringEnabled true
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
dependencies {
|
|
578
|
+
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.1.4"
|
|
579
|
+
}
|
|
580
|
+
```
|
|
581
|
+
|
|
551
582
|
**CocoaPods not found / pod install fails**
|
|
552
583
|
Make sure CocoaPods is installed (`sudo gem install cocoapods`) and run `npx cap sync` before `pod install`.
|
|
553
584
|
|
package/dist/docs.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"methods": [
|
|
8
8
|
{
|
|
9
9
|
"name": "initialize",
|
|
10
|
-
"signature": "(options: { apiKey: string; }) =>
|
|
10
|
+
"signature": "(options: { apiKey: string; }) => any",
|
|
11
11
|
"parameters": [
|
|
12
12
|
{
|
|
13
13
|
"name": "options",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"type": "{ apiKey: string; }"
|
|
16
16
|
}
|
|
17
17
|
],
|
|
18
|
-
"returns": "
|
|
18
|
+
"returns": "any",
|
|
19
19
|
"tags": [],
|
|
20
20
|
"docs": "Initialize the Navigation SDK with API key",
|
|
21
21
|
"complexTypes": [],
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"name": "startNavigation",
|
|
26
|
-
"signature": "(options: { destinationLatitude: number; destinationLongitude: number; travelMode?: 'DRIVING' | 'WALKING' | 'CYCLING' | 'TWO_WHEELER'; }) =>
|
|
26
|
+
"signature": "(options: { destinationLatitude: number; destinationLongitude: number; travelMode?: 'DRIVING' | 'WALKING' | 'CYCLING' | 'TWO_WHEELER'; }) => any",
|
|
27
27
|
"parameters": [
|
|
28
28
|
{
|
|
29
29
|
"name": "options",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"type": "{ destinationLatitude: number; destinationLongitude: number; travelMode?: 'DRIVING' | 'WALKING' | 'CYCLING' | 'TWO_WHEELER' | undefined; }"
|
|
32
32
|
}
|
|
33
33
|
],
|
|
34
|
-
"returns": "
|
|
34
|
+
"returns": "any",
|
|
35
35
|
"tags": [],
|
|
36
36
|
"docs": "Start navigation to a destination",
|
|
37
37
|
"complexTypes": [],
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"name": "stopNavigation",
|
|
42
|
-
"signature": "() =>
|
|
42
|
+
"signature": "() => any",
|
|
43
43
|
"parameters": [],
|
|
44
|
-
"returns": "
|
|
44
|
+
"returns": "any",
|
|
45
45
|
"tags": [],
|
|
46
46
|
"docs": "Stop navigation",
|
|
47
47
|
"complexTypes": [],
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
"name": "showNavigationView",
|
|
52
|
-
"signature": "(options: { show: boolean; }) =>
|
|
52
|
+
"signature": "(options: { show: boolean; }) => any",
|
|
53
53
|
"parameters": [
|
|
54
54
|
{
|
|
55
55
|
"name": "options",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"type": "{ show: boolean; }"
|
|
58
58
|
}
|
|
59
59
|
],
|
|
60
|
-
"returns": "
|
|
60
|
+
"returns": "any",
|
|
61
61
|
"tags": [],
|
|
62
62
|
"docs": "Show/hide navigation view",
|
|
63
63
|
"complexTypes": [],
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
"name": "addListener",
|
|
68
|
-
"signature": "(eventName: 'onArrival' | 'onRouteChanged' | 'onNavigationReady', listenerFunc: (event: any) => void) =>
|
|
68
|
+
"signature": "(eventName: 'onArrival' | 'onRouteChanged' | 'onNavigationReady', listenerFunc: (event: any) => void) => any",
|
|
69
69
|
"parameters": [
|
|
70
70
|
{
|
|
71
71
|
"name": "eventName",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"type": "(event: any) => void"
|
|
79
79
|
}
|
|
80
80
|
],
|
|
81
|
-
"returns": "
|
|
81
|
+
"returns": "any",
|
|
82
82
|
"tags": [],
|
|
83
83
|
"docs": "Add listener for navigation events",
|
|
84
84
|
"complexTypes": [
|
|
@@ -88,9 +88,9 @@
|
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
90
|
"name": "removeAllListeners",
|
|
91
|
-
"signature": "() =>
|
|
91
|
+
"signature": "() => any",
|
|
92
92
|
"parameters": [],
|
|
93
|
-
"returns": "
|
|
93
|
+
"returns": "any",
|
|
94
94
|
"tags": [],
|
|
95
95
|
"docs": "Remove all listeners",
|
|
96
96
|
"complexTypes": [],
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"tags": [],
|
|
113
113
|
"docs": "",
|
|
114
114
|
"complexTypes": [],
|
|
115
|
-
"type": "() =>
|
|
115
|
+
"type": "() => any"
|
|
116
116
|
}
|
|
117
117
|
]
|
|
118
118
|
}
|
|
@@ -2,6 +2,15 @@ import UIKit
|
|
|
2
2
|
import GoogleMaps
|
|
3
3
|
import GoogleNavigation
|
|
4
4
|
|
|
5
|
+
/// A transparent view that passes touches through to underlying windows,
|
|
6
|
+
/// only intercepting touches that land on one of its subviews (e.g. the close button).
|
|
7
|
+
private class PassthroughView: UIView {
|
|
8
|
+
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
|
|
9
|
+
let hit = super.hitTest(point, with: event)
|
|
10
|
+
return hit == self ? nil : hit
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
5
14
|
class NavigationMapViewController: UIViewController {
|
|
6
15
|
private let session: GMSNavigationSession
|
|
7
16
|
private var mapView: GMSMapView?
|
|
@@ -60,7 +69,9 @@ class NavigationMapViewController: UIViewController {
|
|
|
60
69
|
window.isHidden = false
|
|
61
70
|
|
|
62
71
|
let overlayVC = UIViewController()
|
|
63
|
-
|
|
72
|
+
let passthroughView = PassthroughView()
|
|
73
|
+
passthroughView.backgroundColor = .clear
|
|
74
|
+
overlayVC.view = passthroughView
|
|
64
75
|
window.rootViewController = overlayVC
|
|
65
76
|
|
|
66
77
|
let button = UIButton(type: .system)
|