react-native-maps 1.29.5 → 1.29.7

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.
@@ -193,7 +193,9 @@ public class MapManager extends ViewGroupManager<MapView> {
193
193
  }
194
194
 
195
195
  view.applyBaseMapPadding(left, top, right, bottom);
196
- view.map.setPadding(left, top, right, bottom);
196
+ if (view.map != null) {
197
+ view.map.setPadding(left, top, right, bottom);
198
+ }
197
199
  }
198
200
 
199
201
  @ReactProp(name = "showsUserLocation", defaultBoolean = false)
@@ -1363,7 +1363,7 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
1363
1363
  }
1364
1364
 
1365
1365
  public void updateExtraData(Object extraData) {
1366
- if (setPaddingDeferred && super.getHeight() > 0 && super.getWidth() > 0) {
1366
+ if (setPaddingDeferred && map != null && super.getHeight() > 0 && super.getWidth() > 0) {
1367
1367
  CameraUpdate cu = CameraUpdateFactory.newCameraPosition(map.getCameraPosition());
1368
1368
 
1369
1369
  map.setPadding(edgeLeftPadding + baseLeftMapPadding,
@@ -1530,8 +1530,9 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
1530
1530
  int edgeBottomPadding;
1531
1531
 
1532
1532
  public void applyBaseMapPadding(int left, int top, int right, int bottom) {
1533
- if (super.getHeight() <= 0 || super.getWidth() <= 0) {
1534
- // the map is not laid out yet and calling setPadding() now has no effect
1533
+ if (map == null || super.getHeight() <= 0 || super.getWidth() <= 0) {
1534
+ // the map is not ready or not laid out yet and calling setPadding() now
1535
+ // has no effect, or crashes when the GoogleMap instance does not exist
1535
1536
  baseLeftMapPadding = left;
1536
1537
  baseRightMapPadding = right;
1537
1538
  baseTopMapPadding = top;
@@ -168,7 +168,20 @@ bool areHolesEqual(const std::vector<std::vector<RNMapsGooglePolygonHolesStruct>
168
168
  if(newViewProps.zIndex.has_value()){
169
169
  _view.zIndex = newViewProps.zIndex.value();
170
170
  }
171
- if (newViewProps.coordinates.size() != oldViewProps.coordinates.size()){
171
+ // Rebuild the path when the coordinates change in count OR value. Comparing
172
+ // only the count means moving an existing vertex (same point count, new
173
+ // lat/lng) never updates the rendered shape.
174
+ bool coordsChanged = newViewProps.coordinates.size() != oldViewProps.coordinates.size();
175
+ if (!coordsChanged) {
176
+ for (size_t i = 0; i < newViewProps.coordinates.size(); i++) {
177
+ if (newViewProps.coordinates.at(i).latitude != oldViewProps.coordinates.at(i).latitude ||
178
+ newViewProps.coordinates.at(i).longitude != oldViewProps.coordinates.at(i).longitude) {
179
+ coordsChanged = true;
180
+ break;
181
+ }
182
+ }
183
+ }
184
+ if (coordsChanged){
172
185
  GMSMutablePath *path = [GMSMutablePath path];
173
186
  for(int i = 0; i < newViewProps.coordinates.size(); i++)
174
187
  {
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "types": "dist/src/index.d.ts",
8
8
  "author": "Leland Richardson <leland.m.richardson@gmail.com>",
9
9
  "homepage": "https://github.com/react-native-maps/react-native-maps#readme",
10
- "version": "1.29.5",
10
+ "version": "1.29.7",
11
11
  "license": "MIT",
12
12
  "scripts": {
13
13
  "lint": "eslint . --max-warnings 0",