react-native-google-maps-plus 1.6.0 → 1.6.1-dev.2

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
@@ -12,7 +12,7 @@
12
12
  [![Platform: Android](https://img.shields.io/badge/platform-android-green.svg?logo=android&logoColor=white)](https://developer.android.com/)
13
13
  [![Platform: iOS](https://img.shields.io/badge/platform-iOS-lightgrey.svg?logo=apple&logoColor=black)](https://developer.apple.com/ios/)
14
14
 
15
- React-native wrapper for android & IOS google maps sdk
15
+ React Native wrapper for Android & iOS Google Maps SDK.
16
16
 
17
17
  ## Installation
18
18
 
@@ -140,11 +140,9 @@ class GoogleMapsViewImpl(
140
140
  override fun onCameraMoveStarted(reason: Int) {
141
141
  lastSubmittedCameraPosition = null
142
142
  cameraMoveReason = reason
143
- val bounds = googleMap?.projection?.visibleRegion?.latLngBounds
144
- val cameraPosition = googleMap?.cameraPosition
145
- if (bounds == null || cameraPosition == null) {
146
- return
147
- }
143
+ val bounds = googleMap?.projection?.visibleRegion?.latLngBounds ?: return
144
+ val cameraPosition = googleMap?.cameraPosition ?: return
145
+
148
146
  val isGesture = GoogleMap.OnCameraMoveStartedListener.REASON_GESTURE == reason
149
147
 
150
148
  onCameraChangeStart?.invoke(
@@ -155,11 +153,9 @@ class GoogleMapsViewImpl(
155
153
  }
156
154
 
157
155
  override fun onCameraMove() {
158
- val bounds = googleMap?.projection?.visibleRegion?.latLngBounds
159
- val cameraPosition = googleMap?.cameraPosition
160
- if (bounds == null || cameraPosition == null) {
161
- return
162
- }
156
+ val bounds = googleMap?.projection?.visibleRegion?.latLngBounds ?: return
157
+ val cameraPosition = googleMap?.cameraPosition ?: return
158
+
163
159
  if (cameraPosition == lastSubmittedCameraPosition) {
164
160
  return
165
161
  }
@@ -167,7 +163,7 @@ class GoogleMapsViewImpl(
167
163
 
168
164
  val isGesture = GoogleMap.OnCameraMoveStartedListener.REASON_GESTURE == cameraMoveReason
169
165
 
170
- onCameraChangeStart?.invoke(
166
+ onCameraChange?.invoke(
171
167
  bounds.toRnRegion(),
172
168
  cameraPosition.toRnCamera(),
173
169
  isGesture,
@@ -175,15 +171,12 @@ class GoogleMapsViewImpl(
175
171
  }
176
172
 
177
173
  override fun onCameraIdle() {
178
- val bounds = googleMap?.projection?.visibleRegion?.latLngBounds
179
- val cameraPosition = googleMap?.cameraPosition
174
+ val bounds = googleMap?.projection?.visibleRegion?.latLngBounds ?: return
175
+ val cameraPosition = googleMap?.cameraPosition ?: return
180
176
 
181
- if (bounds == null || cameraPosition == null) {
182
- return
183
- }
184
177
  val isGesture = GoogleMap.OnCameraMoveStartedListener.REASON_GESTURE == cameraMoveReason
185
178
 
186
- onCameraChangeStart?.invoke(
179
+ onCameraChangeComplete?.invoke(
187
180
  bounds.toRnRegion(),
188
181
  cameraPosition.toRnCamera(),
189
182
  isGesture,
@@ -279,7 +272,7 @@ class GoogleMapsViewImpl(
279
272
  value?.scrollDuringRotateOrZoomEnabled ?: true
280
273
  isTiltGesturesEnabled = value?.tiltEnabled ?: true
281
274
  isZoomControlsEnabled = value?.zoomControlsEnabled ?: false
282
- isZoomGesturesEnabled = value?.zoomGesturesEnabled ?: false
275
+ isZoomGesturesEnabled = value?.zoomGesturesEnabled ?: true
283
276
  }
284
277
  }
285
278
  }
@@ -404,11 +397,6 @@ class GoogleMapsViewImpl(
404
397
  durationMs: Int,
405
398
  ) {
406
399
  onUi {
407
- val current = googleMap?.cameraPosition
408
- if (current == null) {
409
- return@onUi
410
- }
411
-
412
400
  val update = CameraUpdateFactory.newCameraPosition(cameraPosition)
413
401
 
414
402
  if (animated) {
@@ -140,10 +140,9 @@ class MapMarkerBuilder(
140
140
  onReady: (BitmapDescriptor?) -> Unit,
141
141
  ) {
142
142
  jobsById[id]?.cancel()
143
- if (m.iconSvg == null) {
144
- onReady(null)
145
- return
146
- }
143
+
144
+ m.iconSvg ?: return onReady(null)
145
+
147
146
  val key = m.styleHash()
148
147
  iconCache.get(key)?.let { cached ->
149
148
  onReady(cached)
@@ -191,10 +190,9 @@ class MapMarkerBuilder(
191
190
  }
192
191
 
193
192
  private suspend fun renderBitmap(m: RNMarker): Bitmap? {
193
+ m.iconSvg ?: return null
194
+
194
195
  var bmp: Bitmap? = null
195
- if (m.iconSvg == null) {
196
- return null
197
- }
198
196
  try {
199
197
  coroutineContext.ensureActive()
200
198
  val svg = SVG.getFromString(m.iconSvg.svgString)
@@ -147,19 +147,16 @@ class RNGoogleMapsPlusView(
147
147
 
148
148
  nextById.forEach { (id, next) ->
149
149
  val prev = prevById[id]
150
- if (prev == null) {
151
- markerBuilder.buildIconAsync(id, next) { icon ->
152
- view.addMarker(
153
- id,
154
- markerBuilder.build(next, icon),
155
- )
156
- }
157
- } else if (!prev.markerEquals(next)) {
158
- view.updateMarker(id) { marker ->
159
- onUi {
160
- markerBuilder.update(prev, next, marker)
150
+ when {
151
+ prev == null ->
152
+ markerBuilder.buildIconAsync(id, next) { icon ->
153
+ view.addMarker(id, markerBuilder.build(next, icon))
154
+ }
155
+
156
+ !prev.markerEquals(next) ->
157
+ view.updateMarker(id) { marker ->
158
+ onUi { markerBuilder.update(prev, next, marker) }
161
159
  }
162
- }
163
160
  }
164
161
  }
165
162
  }
@@ -176,14 +173,14 @@ class RNGoogleMapsPlusView(
176
173
 
177
174
  nextById.forEach { (id, next) ->
178
175
  val prev = prevById[id]
179
- if (prev == null) {
180
- view.addPolyline(id, polylineBuilder.build(next))
181
- } else if (!prev.polylineEquals(next)) {
182
- view.updatePolyline(id) { polyline ->
183
- onUi {
184
- polylineBuilder.update(prev, next, polyline)
176
+ when {
177
+ prev == null ->
178
+ view.addPolyline(id, polylineBuilder.build(next))
179
+
180
+ !prev.polylineEquals(next) ->
181
+ view.updatePolyline(id) { polyline ->
182
+ onUi { polylineBuilder.update(prev, next, polyline) }
185
183
  }
186
- }
187
184
  }
188
185
  }
189
186
  }
@@ -201,12 +198,14 @@ class RNGoogleMapsPlusView(
201
198
 
202
199
  nextById.forEach { (id, next) ->
203
200
  val prev = prevById[id]
204
- if (prev == null) {
205
- view.addPolygon(id, polygonBuilder.build(next))
206
- } else if (!prev.polygonEquals(next)) {
207
- view.updatePolygon(id) { polygon ->
208
- onUi { polygonBuilder.update(prev, next, polygon) }
209
- }
201
+ when {
202
+ prev == null ->
203
+ view.addPolygon(id, polygonBuilder.build(next))
204
+
205
+ !prev.polygonEquals(next) ->
206
+ view.updatePolygon(id) { polygon ->
207
+ onUi { polygonBuilder.update(prev, next, polygon) }
208
+ }
210
209
  }
211
210
  }
212
211
  }
@@ -224,14 +223,14 @@ class RNGoogleMapsPlusView(
224
223
 
225
224
  nextById.forEach { (id, next) ->
226
225
  val prev = prevById[id]
227
- if (prev == null) {
228
- view.addCircle(id, circleBuilder.build(next))
229
- } else if (!prev.circleEquals(next)) {
230
- view.updateCircle(id) { circle ->
231
- onUi {
232
- circleBuilder.update(prev, next, circle)
226
+ when {
227
+ prev == null ->
228
+ view.addCircle(id, circleBuilder.build(next))
229
+
230
+ !prev.circleEquals(next) ->
231
+ view.updateCircle(id) { circle ->
232
+ onUi { circleBuilder.update(prev, next, circle) }
233
233
  }
234
- }
235
234
  }
236
235
  }
237
236
  }
@@ -164,7 +164,7 @@ GMSIndoorDisplayDelegate {
164
164
  mapView?.settings.allowScrollGesturesDuringRotateOrZoom =
165
165
  uiSettings?.scrollDuringRotateOrZoomEnabled ?? true
166
166
  mapView?.settings.tiltGestures = uiSettings?.tiltEnabled ?? true
167
- mapView?.settings.zoomGestures = uiSettings?.zoomGesturesEnabled ?? false
167
+ mapView?.settings.zoomGestures = uiSettings?.zoomGesturesEnabled ?? true
168
168
  }
169
169
  }
170
170
 
@@ -664,7 +664,7 @@ GMSIndoorDisplayDelegate {
664
664
  let region = bounds.toRNRegion()
665
665
  let camera = mapView.camera.toRNCamera()
666
666
 
667
- self.onCameraChange?(region, camera, gesture)
667
+ self.onCameraChangeStart?(region, camera, gesture)
668
668
  }
669
669
  }
670
670
 
@@ -698,7 +698,7 @@ GMSIndoorDisplayDelegate {
698
698
  let region = bounds.toRNRegion()
699
699
  let camera = mapView.camera.toRNCamera()
700
700
 
701
- self.onCameraChange?(region, camera, self.cameraMoveReasonIsGesture)
701
+ self.onCameraChangeComplete?(region, camera, self.cameraMoveReasonIsGesture)
702
702
  }
703
703
  }
704
704
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-google-maps-plus",
3
- "version": "1.6.0",
4
- "description": "React-native wrapper for android & IOS google maps sdk",
3
+ "version": "1.6.1-dev.2",
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",
7
7
  "types": "./lib/typescript/src/index.d.ts",
@@ -79,38 +79,34 @@
79
79
  "@commitlint/config-conventional": "20.0.0",
80
80
  "@eslint/compat": "1.4.0",
81
81
  "@eslint/eslintrc": "3.3.1",
82
- "@eslint/js": "9.37.0",
82
+ "@eslint/js": "9.38.0",
83
83
  "@expo/config-plugins": "54.0.2",
84
84
  "@jamesacarr/eslint-formatter-github-actions": "0.2.0",
85
- "@react-native/babel-preset": "0.82.0",
86
- "@react-native/eslint-config": "0.82.0",
85
+ "@react-native/babel-preset": "0.82.1",
86
+ "@react-native/eslint-config": "0.82.1",
87
87
  "@semantic-release/changelog": "6.0.3",
88
88
  "@semantic-release/git": "10.0.1",
89
- "@semantic-release/npm": "13.0.0-beta.1",
89
+ "@semantic-release/npm": "13.1.1",
90
90
  "@types/jest": "30.0.0",
91
91
  "@types/react": "19.2.2",
92
92
  "clang-format-node": "2.0.2",
93
93
  "conventional-changelog-conventionalcommits": "9.1.0",
94
94
  "del-cli": "7.0.0",
95
- "eslint": "9.37.0",
95
+ "eslint": "9.38.0",
96
96
  "eslint-config-prettier": "10.1.8",
97
97
  "eslint-plugin-ft-flow": "3.0.11",
98
98
  "eslint-plugin-prettier": "5.5.4",
99
99
  "jest": "30.2.0",
100
- "lefthook": "1.13.6",
101
- "nitrogen": "0.30.1",
100
+ "lefthook": "2.0.0",
101
+ "nitrogen": "0.30.2",
102
102
  "prettier": "3.6.2",
103
103
  "react": "19.2.0",
104
- "react-native": "0.82.0",
104
+ "react-native": "0.82.1",
105
105
  "react-native-builder-bob": "0.40.13",
106
- "react-native-nitro-modules": "0.30.1",
107
- "semantic-release": "25.0.0-beta.6",
106
+ "react-native-nitro-modules": "0.30.2",
107
+ "semantic-release": "25.0.1",
108
108
  "typescript": "5.9.3"
109
109
  },
110
- "overrides": {
111
- "@semantic-release/npm": "13.0.0-beta.1",
112
- "semantic-release": "25.0.0-beta.6"
113
- },
114
110
  "peerDependencies": {
115
111
  "expo": "*",
116
112
  "react": "*",