react-native-maps 1.26.2 → 1.26.4
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
|
|
@@ -1142,6 +1142,10 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
1142
1142
|
annotationParent.removeView(annotation);
|
|
1143
1143
|
}
|
|
1144
1144
|
|
|
1145
|
+
// Ensure attacherGroup is not null before using it
|
|
1146
|
+
if (attacherGroup == null) {
|
|
1147
|
+
prepareAttacherView();
|
|
1148
|
+
}
|
|
1145
1149
|
// Add to the parent group
|
|
1146
1150
|
attacherGroup.addView(annotation);
|
|
1147
1151
|
|
|
@@ -1233,7 +1237,7 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
1233
1237
|
feature.removeFromMap(polygonCollection);
|
|
1234
1238
|
} else if (feature instanceof MapPolyline) {
|
|
1235
1239
|
feature.removeFromMap(polylineCollection);
|
|
1236
|
-
} else {
|
|
1240
|
+
} else if (feature != null) {
|
|
1237
1241
|
feature.removeFromMap(map);
|
|
1238
1242
|
}
|
|
1239
1243
|
}
|
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.4",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"lint": "eslint . --max-warnings 0",
|