react-native-google-maps-plus 1.4.0 → 1.4.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.
@@ -20,15 +20,38 @@ class MapCircleBuilder {
20
20
  }
21
21
 
22
22
  fun update(
23
- circle: Circle,
23
+ prev: RNCircle,
24
24
  next: RNCircle,
25
+ circle: Circle,
25
26
  ) {
26
- circle.center = next.center.toLatLng()
27
- circle.radius = next.radius
28
- circle.strokeWidth = next.strokeWidth?.dpToPx() ?: 1f
29
- circle.strokeColor = next.strokeColor?.toColor() ?: Color.BLACK
30
- circle.fillColor = next.fillColor?.toColor() ?: Color.TRANSPARENT
31
- circle.isClickable = next.pressable ?: false
32
- circle.zIndex = next.zIndex?.toFloat() ?: 0f
27
+ if (prev.center.latitude != next.center.latitude ||
28
+ prev.center.longitude != next.center.longitude
29
+ ) {
30
+ circle.center = next.center.toLatLng()
31
+ }
32
+
33
+ if (prev.radius != next.radius) {
34
+ circle.radius = next.radius
35
+ }
36
+
37
+ if (prev.strokeWidth != next.strokeWidth) {
38
+ circle.strokeWidth = next.strokeWidth?.dpToPx() ?: 1f
39
+ }
40
+
41
+ if (prev.strokeColor != next.strokeColor) {
42
+ circle.strokeColor = next.strokeColor?.toColor() ?: Color.BLACK
43
+ }
44
+
45
+ if (prev.fillColor != next.fillColor) {
46
+ circle.fillColor = next.fillColor?.toColor() ?: Color.TRANSPARENT
47
+ }
48
+
49
+ if (prev.pressable != next.pressable) {
50
+ circle.isClickable = next.pressable ?: false
51
+ }
52
+
53
+ if (prev.zIndex != next.zIndex) {
54
+ circle.zIndex = next.zIndex?.toFloat() ?: 0f
55
+ }
33
56
  }
34
57
  }
@@ -54,33 +54,84 @@ class MapMarkerBuilder(
54
54
  }
55
55
 
56
56
  fun update(
57
- marker: Marker,
58
57
  prev: RNMarker,
59
58
  next: RNMarker,
59
+ marker: Marker,
60
60
  ) {
61
- marker.position =
62
- next.coordinate.toLatLng()
61
+ if (prev.coordinate.latitude != next.coordinate.latitude ||
62
+ prev.coordinate.longitude != next.coordinate.longitude
63
+ ) {
64
+ marker.position = next.coordinate.toLatLng()
65
+ }
63
66
 
64
67
  if (!prev.markerStyleEquals(next)) {
65
68
  buildIconAsync(marker.id, next) { icon ->
66
69
  marker.setIcon(icon)
70
+ if (prev.infoWindowAnchor?.x != next.infoWindowAnchor?.x ||
71
+ prev.infoWindowAnchor?.y != next.infoWindowAnchor?.y
72
+ ) {
73
+ marker.setInfoWindowAnchor(
74
+ (next.infoWindowAnchor?.x ?: 0.5f).toFloat(),
75
+ (next.infoWindowAnchor?.y ?: 0f).toFloat(),
76
+ )
77
+ }
78
+
79
+ if (prev.anchor?.x != next.anchor?.x ||
80
+ prev.anchor?.y != next.anchor?.y
81
+ ) {
82
+ marker.setAnchor(
83
+ (next.anchor?.x ?: 0.5f).toFloat(),
84
+ (next.anchor?.y ?: 1.0f).toFloat(),
85
+ )
86
+ }
67
87
  }
88
+ } else {
89
+ if (prev.infoWindowAnchor?.x != next.infoWindowAnchor?.x ||
90
+ prev.infoWindowAnchor?.y != next.infoWindowAnchor?.y
91
+ ) {
92
+ marker.setInfoWindowAnchor(
93
+ (next.infoWindowAnchor?.x ?: 0.5f).toFloat(),
94
+ (next.infoWindowAnchor?.y ?: 0f).toFloat(),
95
+ )
96
+ }
97
+
98
+ if (prev.anchor?.x != next.anchor?.x ||
99
+ prev.anchor?.y != next.anchor?.y
100
+ ) {
101
+ marker.setAnchor(
102
+ (next.anchor?.x ?: 0.5f).toFloat(),
103
+ (next.anchor?.y ?: 1.0f).toFloat(),
104
+ )
105
+ }
106
+ }
107
+
108
+ if (prev.title != next.title) {
109
+ marker.title = next.title
110
+ }
111
+
112
+ if (prev.snippet != next.snippet) {
113
+ marker.snippet = next.snippet
114
+ }
115
+
116
+ if (prev.opacity != next.opacity) {
117
+ marker.alpha = next.opacity?.toFloat() ?: 1f
118
+ }
119
+
120
+ if (prev.flat != next.flat) {
121
+ marker.isFlat = next.flat ?: false
122
+ }
123
+
124
+ if (prev.draggable != next.draggable) {
125
+ marker.isDraggable = next.draggable ?: false
126
+ }
127
+
128
+ if (prev.rotation != next.rotation) {
129
+ marker.rotation = next.rotation?.toFloat() ?: 0f
130
+ }
131
+
132
+ if (prev.zIndex != next.zIndex) {
133
+ marker.zIndex = next.zIndex?.toFloat() ?: 0f
68
134
  }
69
- marker.title = next.title
70
- marker.snippet = next.snippet
71
- marker.alpha = next.opacity?.toFloat() ?: 1f
72
- marker.isFlat = next.flat ?: false
73
- marker.isDraggable = next.draggable ?: false
74
- marker.rotation = next.rotation?.toFloat() ?: 0f
75
- marker.setInfoWindowAnchor(
76
- (next.infoWindowAnchor?.x ?: 0.5).toFloat(),
77
- (next.infoWindowAnchor?.y ?: 0).toFloat(),
78
- )
79
- marker.setAnchor(
80
- (next.anchor?.x ?: 0.5).toFloat(),
81
- (next.anchor?.y ?: 1.0).toFloat(),
82
- )
83
- marker.zIndex = next.zIndex?.toFloat() ?: 0f
84
135
  }
85
136
 
86
137
  fun buildIconAsync(
@@ -27,21 +27,60 @@ class MapPolygonBuilder {
27
27
  }
28
28
 
29
29
  fun update(
30
- poly: Polygon,
30
+ prev: RNPolygon,
31
31
  next: RNPolygon,
32
+ poly: Polygon,
32
33
  ) {
33
- poly.points =
34
- next.coordinates.map {
35
- it.toLatLng()
36
- }
37
- poly.fillColor = next.fillColor?.toColor() ?: Color.TRANSPARENT
38
- poly.strokeColor = next.strokeColor?.toColor() ?: Color.BLACK
39
- poly.strokeWidth = next.strokeWidth?.dpToPx() ?: 1f
40
- poly.isClickable = next.pressable ?: false
41
- poly.isGeodesic = next.geodesic ?: false
42
- poly.holes = next.holes?.map { hole ->
43
- hole.coordinates.map { it.toLatLng() }
44
- } ?: emptyList()
45
- poly.zIndex = next.zIndex?.toFloat() ?: 0f
34
+ val coordsChanged =
35
+ prev.coordinates.size != next.coordinates.size ||
36
+ !prev.coordinates.zip(next.coordinates).all { (a, b) ->
37
+ a.latitude == b.latitude && a.longitude == b.longitude
38
+ }
39
+
40
+ if (coordsChanged) {
41
+ poly.points = next.coordinates.map { it.toLatLng() }
42
+ }
43
+
44
+ val prevHoles = prev.holes?.toList() ?: emptyList()
45
+ val nextHoles = next.holes?.toList() ?: emptyList()
46
+ val holesChanged =
47
+ prevHoles.size != nextHoles.size ||
48
+ !prevHoles.zip(nextHoles).all { (ha, hb) ->
49
+ ha.coordinates.size == hb.coordinates.size &&
50
+ ha.coordinates.zip(hb.coordinates).all { (a, b) ->
51
+ a.latitude == b.latitude && a.longitude == b.longitude
52
+ }
53
+ }
54
+
55
+ if (holesChanged) {
56
+ poly.holes =
57
+ nextHoles.map { hole ->
58
+ hole.coordinates.map { it.toLatLng() }
59
+ }
60
+ }
61
+
62
+ if (prev.fillColor != next.fillColor) {
63
+ poly.fillColor = next.fillColor?.toColor() ?: Color.TRANSPARENT
64
+ }
65
+
66
+ if (prev.strokeColor != next.strokeColor) {
67
+ poly.strokeColor = next.strokeColor?.toColor() ?: Color.BLACK
68
+ }
69
+
70
+ if (prev.strokeWidth != next.strokeWidth) {
71
+ poly.strokeWidth = next.strokeWidth?.dpToPx() ?: 1f
72
+ }
73
+
74
+ if (prev.pressable != next.pressable) {
75
+ poly.isClickable = next.pressable ?: false
76
+ }
77
+
78
+ if (prev.geodesic != next.geodesic) {
79
+ poly.isGeodesic = next.geodesic ?: false
80
+ }
81
+
82
+ if (prev.zIndex != next.zIndex) {
83
+ poly.zIndex = next.zIndex?.toFloat() ?: 0f
84
+ }
46
85
  }
47
86
  }
@@ -31,19 +31,52 @@ class MapPolylineBuilder {
31
31
  }
32
32
 
33
33
  fun update(
34
- polyline: Polyline,
34
+ prev: RNPolyline,
35
35
  next: RNPolyline,
36
+ polyline: Polyline,
36
37
  ) {
37
- polyline.points = next.coordinates.map { it.toLatLng() }
38
- polyline.width = next.width?.dpToPx() ?: 1f
39
- val cap = mapLineCap(next.lineCap ?: RNLineCapType.BUTT)
40
- polyline.startCap = cap
41
- polyline.endCap = cap
42
- polyline.jointType = mapLineJoin(next.lineJoin ?: RNLineJoinType.MITER)
43
- polyline.color = next.color?.toColor() ?: Color.BLACK
44
- polyline.isClickable = next.pressable ?: false
45
- polyline.isGeodesic = next.geodesic ?: false
46
- polyline.zIndex = next.zIndex?.toFloat() ?: 0f
38
+ val coordsChanged =
39
+ prev.coordinates.size != next.coordinates.size ||
40
+ !prev.coordinates.zip(next.coordinates).all { (a, b) ->
41
+ a.latitude == b.latitude && a.longitude == b.longitude
42
+ }
43
+
44
+ if (coordsChanged) {
45
+ polyline.points = next.coordinates.map { it.toLatLng() }
46
+ }
47
+
48
+ if (prev.width != next.width) {
49
+ polyline.width = next.width?.dpToPx() ?: 1f
50
+ }
51
+
52
+ val newCap = mapLineCap(next.lineCap ?: RNLineCapType.BUTT)
53
+ val prevCap = mapLineCap(prev.lineCap ?: RNLineCapType.BUTT)
54
+ if (newCap != prevCap) {
55
+ polyline.startCap = newCap
56
+ polyline.endCap = newCap
57
+ }
58
+
59
+ val newJoin = mapLineJoin(next.lineJoin ?: RNLineJoinType.MITER)
60
+ val prevJoin = mapLineJoin(prev.lineJoin ?: RNLineJoinType.MITER)
61
+ if (newJoin != prevJoin) {
62
+ polyline.jointType = newJoin
63
+ }
64
+
65
+ if (prev.color != next.color) {
66
+ polyline.color = next.color?.toColor() ?: Color.BLACK
67
+ }
68
+
69
+ if (prev.pressable != next.pressable) {
70
+ polyline.isClickable = next.pressable ?: false
71
+ }
72
+
73
+ if (prev.geodesic != next.geodesic) {
74
+ polyline.isGeodesic = next.geodesic ?: false
75
+ }
76
+
77
+ if (prev.zIndex != next.zIndex) {
78
+ polyline.zIndex = next.zIndex?.toFloat() ?: 0f
79
+ }
47
80
  }
48
81
 
49
82
  private fun mapLineCap(type: RNLineCapType?): Cap =
@@ -157,7 +157,7 @@ class RNGoogleMapsPlusView(
157
157
  } else if (!prev.markerEquals(next)) {
158
158
  view.updateMarker(id) { marker ->
159
159
  onUi {
160
- markerBuilder.update(marker, next, prev)
160
+ markerBuilder.update(prev, next, marker)
161
161
  }
162
162
  }
163
163
  }
@@ -181,7 +181,7 @@ class RNGoogleMapsPlusView(
181
181
  } else if (!prev.polylineEquals(next)) {
182
182
  view.updatePolyline(id) { polyline ->
183
183
  onUi {
184
- polylineBuilder.update(polyline, next)
184
+ polylineBuilder.update(prev, next, polyline)
185
185
  }
186
186
  }
187
187
  }
@@ -205,7 +205,7 @@ class RNGoogleMapsPlusView(
205
205
  view.addPolygon(id, polygonBuilder.build(next))
206
206
  } else if (!prev.polygonEquals(next)) {
207
207
  view.updatePolygon(id) { polygon ->
208
- onUi { polygonBuilder.update(polygon, next) }
208
+ onUi { polygonBuilder.update(prev, next, polygon) }
209
209
  }
210
210
  }
211
211
  }
@@ -229,7 +229,7 @@ class RNGoogleMapsPlusView(
229
229
  } else if (!prev.circleEquals(next)) {
230
230
  view.updateCircle(id) { circle ->
231
231
  onUi {
232
- circleBuilder.update(circle, next)
232
+ circleBuilder.update(prev, next, circle)
233
233
  }
234
234
  }
235
235
  }
@@ -14,14 +14,34 @@ final class MapCircleBuilder {
14
14
  return circle
15
15
  }
16
16
 
17
- func update(_ next: RNCircle, _ c: GMSCircle) {
18
- c.position = next.center.toCLLocationCoordinate2D()
19
- c.radius = next.radius
20
- c.fillColor = next.fillColor?.toUIColor() ?? nil
21
- c.strokeColor = next.strokeColor?.toUIColor() ?? .black
22
- c.strokeWidth = CGFloat(next.strokeWidth ?? 1.0)
23
- c.isTappable = next.pressable ?? false
24
- c.zIndex = Int32(next.zIndex ?? 0)
25
- }
17
+ func update(_ prev: RNCircle, _ next: RNCircle, _ c: GMSCircle) {
18
+ if prev.center.latitude != next.center.latitude
19
+ || prev.center.longitude != next.center.longitude {
20
+ c.position = next.center.toCLLocationCoordinate2D()
21
+ }
22
+
23
+ if prev.radius != next.radius {
24
+ c.radius = next.radius ?? 0
25
+ }
26
+
27
+ if prev.fillColor != next.fillColor {
28
+ c.fillColor = next.fillColor?.toUIColor() ?? .clear
29
+ }
30
+
31
+ if prev.strokeColor != next.strokeColor {
32
+ c.strokeColor = next.strokeColor?.toUIColor() ?? .black
33
+ }
26
34
 
35
+ if prev.strokeWidth != next.strokeWidth {
36
+ c.strokeWidth = CGFloat(next.strokeWidth ?? 1.0)
37
+ }
38
+
39
+ if prev.pressable != next.pressable {
40
+ c.isTappable = next.pressable ?? false
41
+ }
42
+
43
+ if prev.zIndex != next.zIndex {
44
+ c.zIndex = Int32(next.zIndex ?? 0)
45
+ }
46
+ }
27
47
  }
@@ -44,31 +44,58 @@ final class MapMarkerBuilder {
44
44
 
45
45
  @MainActor
46
46
  func update(_ prev: RNMarker, _ next: RNMarker, _ m: GMSMarker) {
47
- m.position = next.coordinate.toCLLocationCoordinate2D()
48
- m.title = next.title
49
- m.snippet = next.snippet
50
- m.iconView?.alpha = CGFloat(next.opacity ?? 1)
51
- m.isFlat = next.flat ?? false
52
- m.isDraggable = next.draggable ?? false
53
- m.rotation = next.rotation ?? 0
54
- m.infoWindowAnchor = CGPoint(
55
- x: next.infoWindowAnchor?.x ?? 0.5,
56
- y: next.infoWindowAnchor?.y ?? 0
57
- )
58
- m.zIndex = Int32(next.zIndex ?? 0)
59
- m.groundAnchor = CGPoint(
60
- x: next.anchor?.x ?? 0.5,
61
- y: next.anchor?.y ?? 1
62
- )
47
+ if prev.coordinate.latitude != next.coordinate.latitude
48
+ || prev.coordinate.longitude != next.coordinate.longitude {
49
+ m.position = next.coordinate.toCLLocationCoordinate2D()
50
+ }
51
+
52
+ if prev.title != next.title {
53
+ m.title = next.title
54
+ }
55
+
56
+ if prev.snippet != next.snippet {
57
+ m.snippet = next.snippet
58
+ }
59
+
60
+ if prev.opacity != next.opacity {
61
+ let opacity = Float(next.opacity ?? 1)
62
+ m.opacity = opacity
63
+ m.iconView?.alpha = CGFloat(opacity)
64
+ }
65
+
66
+ if prev.flat != next.flat {
67
+ m.isFlat = next.flat ?? false
68
+ }
69
+
70
+ if prev.draggable != next.draggable {
71
+ m.isDraggable = next.draggable ?? false
72
+ }
73
+
74
+ if prev.rotation != next.rotation {
75
+ m.rotation = next.rotation ?? 0
76
+ }
77
+
78
+ if prev.zIndex != next.zIndex {
79
+ m.zIndex = Int32(next.zIndex ?? 0)
80
+ }
81
+
63
82
  if !prev.markerStyleEquals(next) {
64
83
  buildIconAsync(next.id, next) { img in
65
84
  m.tracksViewChanges = true
66
85
  m.icon = img
67
86
 
68
- if prev.anchor?.x != next.anchor?.x || prev.anchor?.y != next.anchor?.y {
87
+ if prev.anchor?.x != next.anchor?.x || prev.anchor?.y != next.anchor?.y{
69
88
  m.groundAnchor = CGPoint(
70
89
  x: next.anchor?.x ?? 0.5,
71
- y: next.anchor?.y ?? 0.5
90
+ y: next.anchor?.y ?? 1
91
+ )
92
+ }
93
+
94
+ if prev.infoWindowAnchor?.x != next.infoWindowAnchor?.x
95
+ || prev.infoWindowAnchor?.y != next.infoWindowAnchor?.y {
96
+ m.infoWindowAnchor = CGPoint(
97
+ x: next.infoWindowAnchor?.x ?? 0.5,
98
+ y: next.infoWindowAnchor?.y ?? 0
72
99
  )
73
100
  }
74
101
 
@@ -76,6 +103,21 @@ final class MapMarkerBuilder {
76
103
  m?.tracksViewChanges = false
77
104
  }
78
105
  }
106
+ } else {
107
+ if prev.anchor?.x != next.anchor?.x || prev.anchor?.y != next.anchor?.y{
108
+ m.groundAnchor = CGPoint(
109
+ x: next.anchor?.x ?? 0.5,
110
+ y: next.anchor?.y ?? 1
111
+ )
112
+ }
113
+
114
+ if prev.infoWindowAnchor?.x != next.infoWindowAnchor?.x
115
+ || prev.infoWindowAnchor?.y != next.infoWindowAnchor?.y {
116
+ m.infoWindowAnchor = CGPoint(
117
+ x: next.infoWindowAnchor?.x ?? 0.5,
118
+ y: next.infoWindowAnchor?.y ?? 0
119
+ )
120
+ }
79
121
  }
80
122
  }
81
123
 
@@ -28,26 +28,60 @@ final class MapPolygonBuilder {
28
28
  return pg
29
29
  }
30
30
 
31
- func update(_ next: RNPolygon, _ pg: GMSPolygon) {
32
- let path = GMSMutablePath()
33
- next.coordinates.forEach {
34
- path.add(
35
- $0.toCLLocationCoordinate2D()
36
- )
31
+ func update(_ prev: RNPolygon, _ next: RNPolygon, _ pg: GMSPolygon) {
32
+ let coordsChanged =
33
+ prev.coordinates.count != next.coordinates.count
34
+ || !zip(prev.coordinates, next.coordinates).allSatisfy {
35
+ $0.latitude == $1.latitude && $0.longitude == $1.longitude
36
+ }
37
+
38
+ if coordsChanged {
39
+ let path = GMSMutablePath()
40
+ next.coordinates.forEach { path.add($0.toCLLocationCoordinate2D()) }
41
+ pg.path = path
37
42
  }
38
- pg.path = path
39
43
 
40
- pg.fillColor = next.fillColor?.toUIColor() ?? .clear
41
- pg.strokeColor = next.strokeColor?.toUIColor() ?? .black
42
- pg.strokeWidth = CGFloat(next.strokeWidth ?? 1.0)
43
- pg.isTappable = next.pressable ?? false
44
- pg.geodesic = next.geodesic ?? false
45
- pg.holes =
46
- next.holes?.map { hole in
44
+ let prevHoles = prev.holes ?? []
45
+ let nextHoles = next.holes ?? []
46
+ let holesChanged =
47
+ prevHoles.count != nextHoles.count
48
+ || !zip(prevHoles, nextHoles).allSatisfy { a, b in
49
+ a.coordinates.count == b.coordinates.count
50
+ && zip(a.coordinates, b.coordinates).allSatisfy {
51
+ $0.latitude == $1.latitude && $0.longitude == $1.longitude
52
+ }
53
+ }
54
+
55
+ if holesChanged {
56
+ pg.holes = nextHoles.map { hole in
47
57
  let path = GMSMutablePath()
48
58
  hole.coordinates.forEach { path.add($0.toCLLocationCoordinate2D()) }
49
59
  return path
50
- } ?? []
51
- pg.zIndex = Int32(next.zIndex ?? 0)
60
+ }
61
+ }
62
+
63
+ if prev.fillColor != next.fillColor {
64
+ pg.fillColor = next.fillColor?.toUIColor() ?? .clear
65
+ }
66
+
67
+ if prev.strokeColor != next.strokeColor {
68
+ pg.strokeColor = next.strokeColor?.toUIColor() ?? .black
69
+ }
70
+
71
+ if prev.strokeWidth != next.strokeWidth {
72
+ pg.strokeWidth = CGFloat(next.strokeWidth ?? 1.0)
73
+ }
74
+
75
+ if prev.pressable != next.pressable {
76
+ pg.isTappable = next.pressable ?? false
77
+ }
78
+
79
+ if prev.geodesic != next.geodesic {
80
+ pg.geodesic = next.geodesic ?? false
81
+ }
82
+
83
+ if prev.zIndex != next.zIndex {
84
+ pg.zIndex = Int32(next.zIndex ?? 0)
85
+ }
52
86
  }
53
87
  }
@@ -22,21 +22,37 @@ final class MapPolylineBuilder {
22
22
  return pl
23
23
  }
24
24
 
25
- func update(_ next: RNPolyline, _ pl: GMSPolyline) {
26
- let path = GMSMutablePath()
27
- next.coordinates.forEach {
28
- path.add(
29
- $0.toCLLocationCoordinate2D()
30
- )
25
+ func update(_ prev: RNPolyline, _ next: RNPolyline, _ pl: GMSPolyline) {
26
+ let coordsChanged =
27
+ prev.coordinates.count != next.coordinates.count
28
+ || !zip(prev.coordinates, next.coordinates).allSatisfy {
29
+ $0.latitude == $1.latitude && $0.longitude == $1.longitude
30
+ }
31
+
32
+ if coordsChanged {
33
+ let path = GMSMutablePath()
34
+ next.coordinates.forEach { path.add($0.toCLLocationCoordinate2D()) }
35
+ pl.path = path
36
+ }
37
+
38
+ if prev.width != next.width {
39
+ pl.strokeWidth = CGFloat(next.width ?? 1.0)
40
+ }
41
+
42
+ if prev.color != next.color {
43
+ pl.strokeColor = next.color?.toUIColor() ?? .black
44
+ }
45
+
46
+ if prev.pressable != next.pressable {
47
+ pl.isTappable = next.pressable ?? false
48
+ }
49
+
50
+ if prev.geodesic != next.geodesic {
51
+ pl.geodesic = next.geodesic ?? false
52
+ }
53
+
54
+ if prev.zIndex != next.zIndex {
55
+ pl.zIndex = Int32(next.zIndex ?? 0)
31
56
  }
32
- pl.path = path
33
-
34
- /* lineCap not supported */
35
- /* lineJoin not supported */
36
- pl.strokeWidth = CGFloat(next.width ?? 1.0)
37
- pl.strokeColor = next.color?.toUIColor() ?? .black
38
- pl.isTappable = next.pressable ?? false
39
- pl.geodesic = next.geodesic ?? false
40
- pl.zIndex = Int32(next.zIndex ?? 0)
41
57
  }
42
58
  }
@@ -169,7 +169,7 @@ final class RNGoogleMapsPlusView: HybridRNGoogleMapsPlusViewSpec {
169
169
  if let prev = prevById[id] {
170
170
  if !prev.polylineEquals(next) {
171
171
  impl.updatePolyline(id: id) { pl in
172
- self.polylineBuilder.update(next, pl)
172
+ self.polylineBuilder.update(prev, next, pl)
173
173
  }
174
174
  }
175
175
  } else {
@@ -201,7 +201,7 @@ final class RNGoogleMapsPlusView: HybridRNGoogleMapsPlusViewSpec {
201
201
  if let prev = prevById[id] {
202
202
  if !prev.polygonEquals(next) {
203
203
  impl.updatePolygon(id: id) { pg in
204
- self.polygonBuilder.update(next, pg)
204
+ self.polygonBuilder.update(prev, next, pg)
205
205
  }
206
206
  }
207
207
  } else {
@@ -230,7 +230,7 @@ final class RNGoogleMapsPlusView: HybridRNGoogleMapsPlusViewSpec {
230
230
  if let prev = prevById[id] {
231
231
  if !prev.circleEquals(next) {
232
232
  impl.updateCircle(id: id) { circle in
233
- self.circleBuilder.update(next, circle)
233
+ self.circleBuilder.update(prev, next, circle)
234
234
  }
235
235
  }
236
236
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-google-maps-plus",
3
- "version": "1.4.0",
3
+ "version": "1.4.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",