react-native-maps 1.3.2-beta.1 → 1.3.2-beta.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.
@@ -89,7 +89,9 @@ public class AirMapView extends MapView implements GoogleMap.InfoWindowAdapter,
89
89
  private boolean moveOnMarkerPress = true;
90
90
  private boolean cacheEnabled = false;
91
91
  private ReadableMap initialRegion;
92
+ private ReadableMap initialCamera;
92
93
  private ReadableMap region;
94
+ private ReadableMap camera;
93
95
  private String customMapStyleString;
94
96
  private boolean initialRegionSet = false;
95
97
  private boolean initialCameraSet = false;
@@ -467,8 +469,11 @@ public class AirMapView extends MapView implements GoogleMap.InfoWindowAdapter,
467
469
  }
468
470
 
469
471
  public void setInitialCamera(ReadableMap initialCamera) {
470
- if (!initialCameraSet && initialCamera != null) {
471
- setCamera(initialCamera);
472
+ this.initialCamera = initialCamera;
473
+ // Theoretically onMapReady might be called before setInitialCamera
474
+ // In that case, trigger moveToCamera manually
475
+ if (!initialCameraSet && map != null) {
476
+ moveToCamera(initialCamera);
472
477
  initialCameraSet = true;
473
478
  }
474
479
  }
@@ -477,8 +482,13 @@ public class AirMapView extends MapView implements GoogleMap.InfoWindowAdapter,
477
482
  if(initialRegion != null) {
478
483
  moveToRegion(initialRegion);
479
484
  initialRegionSet = true;
480
- } else {
485
+ } else if(initialCamera != null) {
486
+ moveToCamera(initialCamera);
487
+ initialCameraSet = true;
488
+ } else if(region != null) {
481
489
  moveToRegion(region);
490
+ } else {
491
+ moveToCamera(camera);
482
492
  }
483
493
  if(customMapStyleString != null) {
484
494
  map.setMapStyle(new MapStyleOptions(customMapStyleString));
@@ -517,6 +527,13 @@ public class AirMapView extends MapView implements GoogleMap.InfoWindowAdapter,
517
527
  }
518
528
 
519
529
  public void setCamera(ReadableMap camera) {
530
+ this.camera = camera;
531
+ if(camera != null && map != null) {
532
+ moveToCamera(camera);
533
+ }
534
+ }
535
+
536
+ public void moveToCamera(ReadableMap camera) {
520
537
  if (camera == null) return;
521
538
 
522
539
  CameraPosition.Builder builder = new CameraPosition.Builder();
package/lib/MapView.js CHANGED
@@ -330,6 +330,7 @@ class MapView extends React.Component {
330
330
  style: this.props.style,
331
331
  region: null,
332
332
  initialRegion: this.props.initialRegion || null,
333
+ initialCamera: this.props.initialCamera,
333
334
  ref: this.map,
334
335
  onChange: this._onChange,
335
336
  onMapReady: this._onMapReady,
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "main": "lib/index.js",
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.3.2-beta.1",
8
+ "version": "1.3.2-beta.2",
9
9
  "license": "MIT",
10
10
  "scripts": {
11
11
  "lint": "eslint . --max-warnings 0",
@@ -52,21 +52,21 @@
52
52
  }
53
53
  },
54
54
  "devDependencies": {
55
- "@commitlint/cli": "17.0.3",
56
- "@commitlint/config-conventional": "17.0.3",
57
- "@react-native-community/eslint-config": "3.0.3",
55
+ "@commitlint/cli": "17.1.2",
56
+ "@commitlint/config-conventional": "17.1.0",
57
+ "@react-native-community/eslint-config": "3.1.0",
58
58
  "@semantic-release/changelog": "6.0.1",
59
59
  "@semantic-release/git": "10.0.1",
60
- "@types/react-native": "0.69.3",
61
- "babel-jest": "^27.3.1",
62
- "eslint": "^7.32.0",
60
+ "@types/react-native": "0.70.3",
61
+ "babel-jest": "29.0.3",
62
+ "eslint": "8.23.1",
63
63
  "husky": "8.0.1",
64
- "jest": "^27.3.1",
64
+ "jest": "29.0.3",
65
65
  "prettier": "2.7.1",
66
- "react": "18.0.0",
67
- "react-native": "0.69.2",
68
- "semantic-release": "19.0.3",
69
- "typescript": "4.7.4"
66
+ "react": "18.1.0",
67
+ "react-native": "0.70.1",
68
+ "semantic-release": "19.0.5",
69
+ "typescript": "4.8.3"
70
70
  },
71
71
  "dependencies": {
72
72
  "@types/geojson": "^7946.0.8"