capacitor-google-navigation 0.1.7 → 0.1.9
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.
|
@@ -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?
|
|
@@ -57,10 +66,11 @@ class NavigationMapViewController: UIViewController {
|
|
|
57
66
|
let window = UIWindow(windowScene: scene)
|
|
58
67
|
window.windowLevel = .alert + 1
|
|
59
68
|
window.backgroundColor = .clear
|
|
60
|
-
window.isHidden = false
|
|
61
69
|
|
|
62
70
|
let overlayVC = UIViewController()
|
|
63
|
-
|
|
71
|
+
let passthroughView = PassthroughView()
|
|
72
|
+
passthroughView.backgroundColor = .clear
|
|
73
|
+
overlayVC.view = passthroughView
|
|
64
74
|
window.rootViewController = overlayVC
|
|
65
75
|
|
|
66
76
|
let button = UIButton(type: .system)
|
|
@@ -80,6 +90,7 @@ class NavigationMapViewController: UIViewController {
|
|
|
80
90
|
])
|
|
81
91
|
|
|
82
92
|
self.overlayWindow = window
|
|
93
|
+
window.isHidden = false
|
|
83
94
|
}
|
|
84
95
|
|
|
85
96
|
private func tearDownCloseButtonWindow() {
|