react-native-google-maps-plus 1.10.1 → 1.10.2-dev.1

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.
@@ -867,10 +867,9 @@ class GoogleMapsViewImpl(
867
867
  }
868
868
 
869
869
  override fun onDetachedFromWindow() {
870
- super.onDetachedFromWindow()
871
870
  lifecycleObserver?.let { lifecycle?.removeObserver(it) }
872
871
  lifecycle = null
873
- lifecycleObserver?.toCreatedState()
872
+ super.onDetachedFromWindow()
874
873
  }
875
874
 
876
875
  override fun onMarkerClick(marker: Marker): Boolean {
@@ -35,6 +35,7 @@ class MapLifecycleEventObserver(
35
35
  }
36
36
 
37
37
  private fun toState(state: Lifecycle.State) {
38
+ if (currentState == Lifecycle.State.DESTROYED) return
38
39
  while (currentState != state) {
39
40
  when {
40
41
  currentState < state -> upFromCurrentState()
@@ -20,38 +20,53 @@ fun Location.toRnLocation(): RNLocation =
20
20
  elapsedRealtimeNanos = elapsedRealtimeNanos.toDouble(),
21
21
  bearingAccuracyDegrees =
22
22
  when {
23
- Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ->
24
- bearingAccuracyDegrees.toDouble()
25
-
26
- else -> null
23
+ Build.VERSION.SDK_INT < Build.VERSION_CODES.O -> null
24
+ else ->
25
+ try {
26
+ if (hasBearingAccuracy()) bearingAccuracyDegrees.toDouble() else null
27
+ } catch (_: IllegalStateException) {
28
+ null
29
+ }
27
30
  },
28
31
  speedAccuracyMetersPerSecond =
29
32
  when {
30
- Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ->
31
- speedAccuracyMetersPerSecond.toDouble()
32
-
33
- else -> null
33
+ Build.VERSION.SDK_INT < Build.VERSION_CODES.O -> null
34
+ else ->
35
+ try {
36
+ if (hasSpeedAccuracy()) speedAccuracyMetersPerSecond.toDouble() else null
37
+ } catch (_: IllegalStateException) {
38
+ null
39
+ }
34
40
  },
35
41
  verticalAccuracyMeters =
36
42
  when {
37
- Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ->
38
- verticalAccuracyMeters.toDouble()
39
-
40
- else -> null
43
+ Build.VERSION.SDK_INT < Build.VERSION_CODES.O -> null
44
+ else ->
45
+ try {
46
+ if (hasVerticalAccuracy()) verticalAccuracyMeters.toDouble() else null
47
+ } catch (_: IllegalStateException) {
48
+ null
49
+ }
41
50
  },
42
51
  mslAltitudeMeters =
43
52
  when {
44
- Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE ->
45
- mslAltitudeMeters
46
-
47
- else -> null
53
+ Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE -> null
54
+ else ->
55
+ try {
56
+ if (hasMslAltitude()) mslAltitudeMeters else null
57
+ } catch (_: IllegalStateException) {
58
+ null
59
+ }
48
60
  },
49
61
  mslAltitudeAccuracyMeters =
50
62
  when {
51
- Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE ->
52
- mslAltitudeAccuracyMeters.toDouble()
53
-
54
- else -> null
63
+ Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE -> null
64
+ else ->
65
+ try {
66
+ if (hasMslAltitude()) mslAltitudeAccuracyMeters.toDouble() else null
67
+ } catch (_: IllegalStateException) {
68
+ null
69
+ }
55
70
  },
56
71
  isMock =
57
72
  when {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-google-maps-plus",
3
- "version": "1.10.1",
3
+ "version": "1.10.2-dev.1",
4
4
  "description": "React Native wrapper for Android & iOS Google Maps SDK",
5
5
  "main": "./lib/module/index.js",
6
6
  "module": "./lib/module/index.js",