react-native-maps 1.26.1 → 1.26.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.
@@ -91,6 +91,7 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
91
91
  public GoogleMap map;
92
92
  private Bundle savedMapState;
93
93
  private Map<Integer, MapFeature> savedFeatures = new HashMap<>();
94
+ private boolean shouldRestorePadding = false;
94
95
 
95
96
  private MarkerManager markerManager;
96
97
  private MarkerManager.Collection markerCollection;
@@ -342,6 +343,7 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
342
343
  super.onStop();
343
344
  savedFeatures = new HashMap<>(features);
344
345
  savedFeatures.keySet().forEach(this::removeFeatureAt);
346
+ shouldRestorePadding = true;
345
347
  removeView(attacherGroup);
346
348
  attacherGroup = null;
347
349
  detachLifecycleObserver();
@@ -781,12 +783,12 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
781
783
  }
782
784
 
783
785
  private void applyBridgedProps() {
784
- if (initialRegion != null) {
786
+ if (initialRegion != null && !initialRegionSet) {
785
787
  moveToRegion(initialRegion);
786
788
  initialRegionSet = true;
787
789
  } else if (region != null) {
788
790
  moveToRegion(region);
789
- } else if (initialCamera != null) {
791
+ } else if (initialCamera != null && !initialCameraSet) {
790
792
  moveToCamera(initialCamera);
791
793
  initialCameraSet = true;
792
794
  } else if (camera != null) {
@@ -796,12 +798,18 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
796
798
  map.setMapStyle(new MapStyleOptions(customMapStyleString));
797
799
  }
798
800
  this.setPoiClickEnabled(poiClickEnabled);
799
- if (setPaddingDeferred &&
800
- (baseLeftMapPadding != 0 ||
801
- baseTopMapPadding != 0 ||
802
- baseRightMapPadding != 0 ||
803
- baseBottomMapPadding != 0)) {
804
- applyBaseMapPadding(baseLeftMapPadding, baseTopMapPadding, baseRightMapPadding, baseBottomMapPadding);
801
+ if (baseLeftMapPadding != 0 ||
802
+ baseTopMapPadding != 0 ||
803
+ baseRightMapPadding != 0 ||
804
+ baseBottomMapPadding != 0) {
805
+ if (setPaddingDeferred) {
806
+ applyBaseMapPadding(baseLeftMapPadding, baseTopMapPadding, baseRightMapPadding, baseBottomMapPadding);
807
+ } else if (shouldRestorePadding) {
808
+ CameraUpdate cu = CameraUpdateFactory.newCameraPosition(map.getCameraPosition());
809
+ map.setPadding(baseLeftMapPadding, baseTopMapPadding, baseRightMapPadding, baseBottomMapPadding);
810
+ map.moveCamera(cu);
811
+ shouldRestorePadding = false;
812
+ }
805
813
  }
806
814
  }
807
815
 
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "main": "src/index.ts",
6
6
  "author": "Leland Richardson <leland.m.richardson@gmail.com>",
7
7
  "homepage": "https://github.com/react-native-maps/react-native-maps#readme",
8
- "version": "1.26.1",
8
+ "version": "1.26.2",
9
9
  "license": "MIT",
10
10
  "scripts": {
11
11
  "lint": "eslint . --max-warnings 0",