react-native-maps 1.26.1 → 1.26.3
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
|
@@ -29,11 +29,10 @@ See [Setup Instructions for the Included Example Project](docs/examples-setup.md
|
|
|
29
29
|
|
|
30
30
|
### Old Architecture
|
|
31
31
|
|
|
32
|
-
| Version
|
|
33
|
-
|
|
|
34
|
-
| 1.
|
|
35
|
-
| 1.14.0
|
|
36
|
-
| < 1.14.0 | >= 0.64.3 |
|
|
32
|
+
| Version | React Native Requirement |
|
|
33
|
+
| --------------- | ------------------------ |
|
|
34
|
+
| 1.14.0 - 1.20.1 | >= 0.74 |
|
|
35
|
+
| < 1.14.0 | >= 0.64.3 |
|
|
37
36
|
|
|
38
37
|
## Component API
|
|
39
38
|
|
|
@@ -57,6 +57,10 @@ public class NativeAirMapsModule extends NativeAirMapsModuleSpec {
|
|
|
57
57
|
@Override
|
|
58
58
|
public void run() {
|
|
59
59
|
MapView view = (MapView) uiManager.resolveView((int) tag);
|
|
60
|
+
if (view == null || view.map == null) {
|
|
61
|
+
promise.reject("E_MAP_CAMERA", "Cannot get camera position because map view is null");
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
60
64
|
CameraPosition position = view.map.getCameraPosition();
|
|
61
65
|
WritableMap map = Arguments.createMap();
|
|
62
66
|
WritableMap center = Arguments.createMap();
|
|
@@ -77,6 +81,10 @@ public class NativeAirMapsModule extends NativeAirMapsModuleSpec {
|
|
|
77
81
|
UIManager uiManager = UIManagerHelper.getUIManagerForReactTag(getReactApplicationContext(), (int) tag);
|
|
78
82
|
getReactApplicationContext().runOnUiQueueThread(() -> {
|
|
79
83
|
MapView view = (MapView) uiManager.resolveView((int) tag);
|
|
84
|
+
if (view == null) {
|
|
85
|
+
promise.reject("E_MAP_MARKERS", "Cannot get markers frames because map view is null");
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
80
88
|
double[][] boundaries = view.getMarkersFrames(onlyVisible);
|
|
81
89
|
if (boundaries != null) {
|
|
82
90
|
WritableMap coordinates = new WritableNativeMap();
|
|
@@ -103,7 +111,15 @@ public class NativeAirMapsModule extends NativeAirMapsModuleSpec {
|
|
|
103
111
|
UIManager uiManager = UIManagerHelper.getUIManagerForReactTag(getReactApplicationContext(), (int) tag);
|
|
104
112
|
getReactApplicationContext().runOnUiQueueThread(() -> {
|
|
105
113
|
MapView view = (MapView) uiManager.resolveView((int) tag);
|
|
114
|
+
if (view == null) {
|
|
115
|
+
promise.reject("E_MAP_BOUNDARIES", "Cannot get map boundaries because map view is null");
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
106
118
|
double[][] boundaries = view.getMapBoundaries();
|
|
119
|
+
if (boundaries == null) {
|
|
120
|
+
promise.reject("E_MAP_BOUNDARIES", "Map boundaries are null");
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
107
123
|
WritableMap coordinates = new WritableNativeMap();
|
|
108
124
|
WritableMap northEastHash = new WritableNativeMap();
|
|
109
125
|
WritableMap southWestHash = new WritableNativeMap();
|
|
@@ -147,6 +163,10 @@ public class NativeAirMapsModule extends NativeAirMapsModuleSpec {
|
|
|
147
163
|
@Override
|
|
148
164
|
public void run() {
|
|
149
165
|
MapView view = (MapView) uiManager.resolveView((int) tag);
|
|
166
|
+
if (view == null || view.map == null) {
|
|
167
|
+
promise.reject("E_SNAPSHOT", "Cannot take snapshot because map view or map is null");
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
150
170
|
view.map.snapshot(snapshot -> {
|
|
151
171
|
|
|
152
172
|
// Convert image to requested width/height if necessary
|
|
@@ -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 (
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
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
|
|
|
@@ -1134,6 +1142,10 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
1134
1142
|
annotationParent.removeView(annotation);
|
|
1135
1143
|
}
|
|
1136
1144
|
|
|
1145
|
+
// Ensure attacherGroup is not null before using it
|
|
1146
|
+
if (attacherGroup == null) {
|
|
1147
|
+
prepareAttacherView();
|
|
1148
|
+
}
|
|
1137
1149
|
// Add to the parent group
|
|
1138
1150
|
attacherGroup.addView(annotation);
|
|
1139
1151
|
|
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.
|
|
8
|
+
"version": "1.26.3",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"lint": "eslint . --max-warnings 0",
|