react-native-google-maps-plus 1.10.0-dev.2 → 1.10.0-dev.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.
|
@@ -56,6 +56,8 @@ class LocationHandler(
|
|
|
56
56
|
this.interval = interval ?: INTERVAL_DEFAULT
|
|
57
57
|
this.minUpdateInterval = minUpdateInterval ?: MIN_UPDATE_INTERVAL
|
|
58
58
|
buildLocationRequest(this.priority, this.interval, this.minUpdateInterval)
|
|
59
|
+
|
|
60
|
+
if (!isActive) return
|
|
59
61
|
stop()
|
|
60
62
|
start()
|
|
61
63
|
}
|
|
@@ -173,7 +175,7 @@ class LocationHandler(
|
|
|
173
175
|
val error = e.toLocationErrorCode(context)
|
|
174
176
|
onError?.invoke(error)
|
|
175
177
|
}
|
|
176
|
-
} catch (
|
|
178
|
+
} catch (_: SecurityException) {
|
|
177
179
|
onError?.invoke(RNLocationErrorCode.PERMISSION_DENIED)
|
|
178
180
|
} catch (ex: Exception) {
|
|
179
181
|
val error = ex.toLocationErrorCode(context)
|
|
@@ -193,11 +195,9 @@ class LocationHandler(
|
|
|
193
195
|
|
|
194
196
|
override fun activate(listener: LocationSource.OnLocationChangedListener) {
|
|
195
197
|
this.listener = listener
|
|
196
|
-
start()
|
|
197
198
|
}
|
|
198
199
|
|
|
199
200
|
override fun deactivate() {
|
|
200
201
|
listener = null
|
|
201
|
-
stop()
|
|
202
202
|
}
|
|
203
203
|
}
|
|
@@ -10,8 +10,8 @@ GMSIndoorDisplayDelegate {
|
|
|
10
10
|
private let locationHandler: LocationHandler
|
|
11
11
|
private let markerBuilder: MapMarkerBuilder
|
|
12
12
|
private var mapView: GMSMapView?
|
|
13
|
-
private var
|
|
14
|
-
private var
|
|
13
|
+
private var mapViewInitialized = false
|
|
14
|
+
private var mapViewLoaded = false
|
|
15
15
|
private var deInitialized = false
|
|
16
16
|
|
|
17
17
|
private var pendingMarkers: [(id: String, marker: GMSMarker)] = []
|
|
@@ -97,8 +97,8 @@ GMSIndoorDisplayDelegate {
|
|
|
97
97
|
|
|
98
98
|
@MainActor
|
|
99
99
|
func initMapView() {
|
|
100
|
-
if
|
|
101
|
-
|
|
100
|
+
if mapViewInitialized { return }
|
|
101
|
+
mapViewInitialized = true
|
|
102
102
|
googleMapOptions.frame = bounds
|
|
103
103
|
|
|
104
104
|
mapView = GMSMapView.init(options: googleMapOptions)
|
|
@@ -221,7 +221,7 @@ GMSIndoorDisplayDelegate {
|
|
|
221
221
|
@MainActor
|
|
222
222
|
var trafficEnabled: Bool? {
|
|
223
223
|
didSet {
|
|
224
|
-
mapView?.isTrafficEnabled = false
|
|
224
|
+
mapView?.isTrafficEnabled = trafficEnabled ?? false
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
|
|
@@ -717,7 +717,6 @@ GMSIndoorDisplayDelegate {
|
|
|
717
717
|
self.mapView?.indoorDisplay.delegate = nil
|
|
718
718
|
self.mapView?.delegate = nil
|
|
719
719
|
self.mapView = nil
|
|
720
|
-
self.initialized = false
|
|
721
720
|
}
|
|
722
721
|
}
|
|
723
722
|
|
|
@@ -752,8 +751,8 @@ GMSIndoorDisplayDelegate {
|
|
|
752
751
|
}
|
|
753
752
|
|
|
754
753
|
func mapViewDidFinishTileRendering(_ mapView: GMSMapView) {
|
|
755
|
-
guard !
|
|
756
|
-
|
|
754
|
+
guard !mapViewLoaded else { return }
|
|
755
|
+
mapViewLoaded = true
|
|
757
756
|
let visibleRegion = mapView.projection.visibleRegion().toRNRegion()
|
|
758
757
|
let camera = mapView.camera.toRNCamera()
|
|
759
758
|
|
|
@@ -761,7 +760,7 @@ GMSIndoorDisplayDelegate {
|
|
|
761
760
|
}
|
|
762
761
|
|
|
763
762
|
func mapView(_ mapView: GMSMapView, willMove gesture: Bool) {
|
|
764
|
-
if !
|
|
763
|
+
if !mapViewLoaded { return }
|
|
765
764
|
onMain {
|
|
766
765
|
self.cameraMoveReasonIsGesture = gesture
|
|
767
766
|
|
|
@@ -773,7 +772,7 @@ GMSIndoorDisplayDelegate {
|
|
|
773
772
|
}
|
|
774
773
|
|
|
775
774
|
func mapView(_ mapView: GMSMapView, didChange position: GMSCameraPosition) {
|
|
776
|
-
if !
|
|
775
|
+
if !mapViewLoaded { return }
|
|
777
776
|
onMain {
|
|
778
777
|
let visibleRegion = mapView.projection.visibleRegion().toRNRegion()
|
|
779
778
|
let camera = mapView.camera.toRNCamera()
|
|
@@ -784,7 +783,7 @@ GMSIndoorDisplayDelegate {
|
|
|
784
783
|
}
|
|
785
784
|
|
|
786
785
|
func mapView(_ mapView: GMSMapView, idleAt position: GMSCameraPosition) {
|
|
787
|
-
if !
|
|
786
|
+
if !mapViewLoaded { return }
|
|
788
787
|
onMain {
|
|
789
788
|
let visibleRegion = mapView.projection.visibleRegion().toRNRegion()
|
|
790
789
|
let camera = mapView.camera.toRNCamera()
|
package/package.json
CHANGED