react-native-google-maps-plus 1.6.1-dev.3 → 1.6.1-dev.5

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.
@@ -362,7 +362,7 @@ class RNGoogleMapsPlusView(
362
362
  durationMs: Double?,
363
363
  ) {
364
364
  onUi {
365
- val current = view.currentCamera ?: return@onUi
365
+ val current = view.currentCamera
366
366
  view.setCamera(
367
367
  camera.toCameraPosition(current),
368
368
  animated == true,
@@ -19,40 +19,44 @@ fun Location.toRnLocation(): RNLocation =
19
19
  provider = provider,
20
20
  elapsedRealtimeNanos = elapsedRealtimeNanos.toDouble(),
21
21
  bearingAccuracyDegrees =
22
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
23
- bearingAccuracyDegrees.toDouble()
24
- } else {
25
- null
22
+ when {
23
+ Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ->
24
+ bearingAccuracyDegrees.toDouble()
25
+
26
+ else -> null
26
27
  },
27
28
  speedAccuracyMetersPerSecond =
28
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
29
- speedAccuracyMetersPerSecond.toDouble()
30
- } else {
31
- null
29
+ when {
30
+ Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ->
31
+ speedAccuracyMetersPerSecond.toDouble()
32
+
33
+ else -> null
32
34
  },
33
35
  verticalAccuracyMeters =
34
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
35
- verticalAccuracyMeters.toDouble()
36
- } else {
37
- null
36
+ when {
37
+ Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ->
38
+ verticalAccuracyMeters.toDouble()
39
+
40
+ else -> null
38
41
  },
39
42
  mslAltitudeMeters =
40
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
41
- mslAltitudeMeters
42
- } else {
43
- null
43
+ when {
44
+ Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE ->
45
+ mslAltitudeMeters
46
+
47
+ else -> null
44
48
  },
45
49
  mslAltitudeAccuracyMeters =
46
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
47
- mslAltitudeAccuracyMeters.toDouble()
48
- } else {
49
- null
50
+ when {
51
+ Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE ->
52
+ mslAltitudeAccuracyMeters.toDouble()
53
+
54
+ else -> null
50
55
  },
51
56
  isMock =
52
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
53
- isMock
54
- } else {
55
- isFromMockProvider
57
+ when {
58
+ Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> isMock
59
+ else -> isFromMockProvider
56
60
  },
57
61
  ),
58
62
  ios = null,
@@ -4,14 +4,11 @@ import com.google.android.gms.maps.model.CameraPosition
4
4
  import com.google.android.gms.maps.model.LatLng
5
5
  import com.rngooglemapsplus.RNCamera
6
6
 
7
- fun RNCamera.toCameraPosition(current: CameraPosition?): CameraPosition {
8
- val builder = CameraPosition.builder()
9
-
10
- builder.target(center?.toLatLng() ?: current?.target ?: LatLng(0.0, 0.0))
11
-
12
- zoom?.let { builder.zoom(it.toFloat()) }
13
- bearing?.let { builder.bearing(it.toFloat()) }
14
- tilt?.let { builder.tilt(it.toFloat()) }
15
-
16
- return builder.build()
17
- }
7
+ fun RNCamera.toCameraPosition(current: CameraPosition?) =
8
+ CameraPosition
9
+ .builder()
10
+ .target(center?.toLatLng() ?: current?.target ?: LatLng(0.0, 0.0))
11
+ .zoom(zoom?.toFloat() ?: current?.zoom ?: 0f)
12
+ .bearing(bearing?.toFloat() ?: current?.bearing ?: 0f)
13
+ .tilt(tilt?.toFloat() ?: current?.tilt ?: 0f)
14
+ .build()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-google-maps-plus",
3
- "version": "1.6.1-dev.3",
3
+ "version": "1.6.1-dev.5",
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",