react-native-maps 1.26.14 → 1.26.15
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/android/build.gradle
CHANGED
|
@@ -58,7 +58,7 @@ android {
|
|
|
58
58
|
|
|
59
59
|
defaultConfig {
|
|
60
60
|
minSdkVersion safeExtGet('minSdkVersion', 21)
|
|
61
|
-
targetSdkVersion safeExtGet('targetSdkVersion',
|
|
61
|
+
targetSdkVersion safeExtGet('targetSdkVersion', 35)
|
|
62
62
|
|
|
63
63
|
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
64
64
|
|
|
@@ -39,6 +39,7 @@ import com.rnmaps.maps.MapOverlay;
|
|
|
39
39
|
import com.rnmaps.maps.MapView;
|
|
40
40
|
import com.rnmaps.maps.SizeReportingShadowNode;
|
|
41
41
|
|
|
42
|
+
import java.util.List;
|
|
42
43
|
import java.util.Map;
|
|
43
44
|
|
|
44
45
|
@ReactModule(name = MapViewManager.REACT_CLASS)
|
|
@@ -318,12 +319,21 @@ public class MapViewManager extends ViewGroupManager<MapView> implements RNMapsM
|
|
|
318
319
|
|
|
319
320
|
@Override
|
|
320
321
|
public void addView(MapView parent, View child, int index) {
|
|
322
|
+
parent.addFeature(child, index);
|
|
321
323
|
if (child instanceof MapMarker && ((MapMarker) child).isLoadingImage()){
|
|
322
|
-
|
|
323
|
-
|
|
324
|
+
MapMarker markerView = (MapMarker) child;
|
|
325
|
+
// Marker is already added as invisible, restore visibility when image loads
|
|
326
|
+
markerView.setImageLoadedListener((uri, drawable, b) -> {
|
|
327
|
+
com.google.android.gms.maps.model.Marker googleMarker =
|
|
328
|
+
(com.google.android.gms.maps.model.Marker) markerView.getFeature();
|
|
329
|
+
if (googleMarker != null) {
|
|
330
|
+
// Restore original visibility (marker was hidden temporarily during image load)
|
|
331
|
+
if (View.VISIBLE == markerView.getVisibility()) {
|
|
332
|
+
googleMarker.setVisible(true);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
markerView.update(true);
|
|
324
336
|
});
|
|
325
|
-
} else {
|
|
326
|
-
parent.addFeature(child, index);
|
|
327
337
|
}
|
|
328
338
|
}
|
|
329
339
|
|
|
@@ -665,7 +665,6 @@ public class MapMarker extends MapFeature {
|
|
|
665
665
|
private Bitmap createDrawable() {
|
|
666
666
|
int width = this.width <= 0 ? 100 : this.width;
|
|
667
667
|
int height = this.height <= 0 ? 100 : this.height;
|
|
668
|
-
this.buildDrawingCache();
|
|
669
668
|
|
|
670
669
|
// Do not create the doublebuffer-bitmap each time. reuse it to save memory.
|
|
671
670
|
Bitmap bitmap = mLastBitmapCreated;
|
|
@@ -90,7 +90,7 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
90
90
|
GoogleMap.OnMarkerDragListener, OnMapReadyCallback, GoogleMap.OnPoiClickListener, GoogleMap.OnIndoorStateChangeListener, DefaultLifecycleObserver {
|
|
91
91
|
public GoogleMap map;
|
|
92
92
|
private Bundle savedMapState;
|
|
93
|
-
private
|
|
93
|
+
private ArrayList<MapFeature> savedFeatures = null;
|
|
94
94
|
private boolean shouldRestorePadding = false;
|
|
95
95
|
|
|
96
96
|
private MarkerManager markerManager;
|
|
@@ -140,7 +140,7 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
140
140
|
private static final String[] PERMISSIONS = new String[]{
|
|
141
141
|
"android.permission.ACCESS_FINE_LOCATION", "android.permission.ACCESS_COARSE_LOCATION"};
|
|
142
142
|
|
|
143
|
-
private final
|
|
143
|
+
private final List<MapFeature> features = new ArrayList<>();
|
|
144
144
|
private final Map<Marker, MapMarker> markerMap = new HashMap<>();
|
|
145
145
|
private final Map<Polyline, MapPolyline> polylineMap = new HashMap<>();
|
|
146
146
|
private final Map<Polygon, MapPolygon> polygonMap = new HashMap<>();
|
|
@@ -325,9 +325,12 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
325
325
|
prepareAttacherView();
|
|
326
326
|
getMapAsync((map)->{
|
|
327
327
|
onMapReady(map);
|
|
328
|
-
savedFeatures.
|
|
329
|
-
|
|
330
|
-
|
|
328
|
+
if (savedFeatures != null && !savedFeatures.isEmpty()) {
|
|
329
|
+
for (int i = 0; i < savedFeatures.size(); i++) {
|
|
330
|
+
addFeature(savedFeatures.get(i), i);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
savedFeatures = null;
|
|
331
334
|
});
|
|
332
335
|
}
|
|
333
336
|
}
|
|
@@ -341,8 +344,8 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
341
344
|
super.onSaveInstanceState(savedMapState);
|
|
342
345
|
super.onPause();
|
|
343
346
|
super.onStop();
|
|
344
|
-
savedFeatures = new
|
|
345
|
-
|
|
347
|
+
savedFeatures = new ArrayList<>(features);
|
|
348
|
+
features.clear();
|
|
346
349
|
shouldRestorePadding = true;
|
|
347
350
|
removeView(attacherGroup);
|
|
348
351
|
attacherGroup = null;
|
|
@@ -374,7 +377,7 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
374
377
|
LatLngBounds.Builder builder = new LatLngBounds.Builder();
|
|
375
378
|
boolean addedPosition = false;
|
|
376
379
|
LatLngBounds mapBounds = map.getProjection().getVisibleRegion().latLngBounds;
|
|
377
|
-
for (MapFeature feature : features
|
|
380
|
+
for (MapFeature feature : features) {
|
|
378
381
|
if (feature instanceof MapMarker) {
|
|
379
382
|
Marker marker = (Marker) feature.getFeature();
|
|
380
383
|
if (!onlyVisible ||
|
|
@@ -1128,7 +1131,7 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
1128
1131
|
if (child instanceof MapMarker) {
|
|
1129
1132
|
MapMarker annotation = (MapMarker) child;
|
|
1130
1133
|
annotation.addToMap(markerCollection);
|
|
1131
|
-
features.
|
|
1134
|
+
features.add(index, annotation);
|
|
1132
1135
|
|
|
1133
1136
|
// Allow visibility event to be triggered later
|
|
1134
1137
|
int visibility = annotation.getVisibility();
|
|
@@ -1155,47 +1158,47 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
1155
1158
|
} else if (child instanceof MapPolyline) {
|
|
1156
1159
|
MapPolyline polylineView = (MapPolyline) child;
|
|
1157
1160
|
polylineView.addToMap(polylineCollection);
|
|
1158
|
-
features.
|
|
1161
|
+
features.add(index, polylineView);
|
|
1159
1162
|
Polyline polyline = (Polyline) polylineView.getFeature();
|
|
1160
1163
|
polylineMap.put(polyline, polylineView);
|
|
1161
1164
|
} else if (child instanceof MapGradientPolyline) {
|
|
1162
1165
|
MapGradientPolyline polylineView = (MapGradientPolyline) child;
|
|
1163
1166
|
polylineView.addToMap(map);
|
|
1164
|
-
features.
|
|
1167
|
+
features.add(index, polylineView);
|
|
1165
1168
|
TileOverlay tileOverlay = (TileOverlay) polylineView.getFeature();
|
|
1166
1169
|
gradientPolylineMap.put(tileOverlay, polylineView);
|
|
1167
1170
|
} else if (child instanceof MapPolygon) {
|
|
1168
1171
|
MapPolygon polygonView = (MapPolygon) child;
|
|
1169
1172
|
polygonView.addToMap(polygonCollection);
|
|
1170
|
-
features.
|
|
1173
|
+
features.add(index, polygonView);
|
|
1171
1174
|
Polygon polygon = (Polygon) polygonView.getFeature();
|
|
1172
1175
|
polygonMap.put(polygon, polygonView);
|
|
1173
1176
|
} else if (child instanceof MapCircle) {
|
|
1174
1177
|
MapCircle circleView = (MapCircle) child;
|
|
1175
1178
|
circleView.addToMap(circleCollection);
|
|
1176
|
-
features.
|
|
1179
|
+
features.add(index, circleView);
|
|
1177
1180
|
} else if (child instanceof MapUrlTile) {
|
|
1178
1181
|
MapUrlTile urlTileView = (MapUrlTile) child;
|
|
1179
1182
|
urlTileView.addToMap(map);
|
|
1180
|
-
features.
|
|
1183
|
+
features.add(index, urlTileView);
|
|
1181
1184
|
} else if (child instanceof MapWMSTile) {
|
|
1182
1185
|
MapWMSTile urlTileView = (MapWMSTile) child;
|
|
1183
1186
|
urlTileView.addToMap(map);
|
|
1184
|
-
features.
|
|
1187
|
+
features.add(index, urlTileView);
|
|
1185
1188
|
} else if (child instanceof MapLocalTile) {
|
|
1186
1189
|
MapLocalTile localTileView = (MapLocalTile) child;
|
|
1187
1190
|
localTileView.addToMap(map);
|
|
1188
|
-
features.
|
|
1191
|
+
features.add(index, localTileView);
|
|
1189
1192
|
} else if (child instanceof MapOverlay) {
|
|
1190
1193
|
MapOverlay overlayView = (MapOverlay) child;
|
|
1191
1194
|
overlayView.addToMap(groundOverlayCollection);
|
|
1192
|
-
features.
|
|
1195
|
+
features.add(index, overlayView);
|
|
1193
1196
|
GroundOverlay overlay = (GroundOverlay) overlayView.getFeature();
|
|
1194
1197
|
overlayMap.put(overlay, overlayView);
|
|
1195
1198
|
} else if (child instanceof MapHeatmap) {
|
|
1196
1199
|
MapHeatmap heatmapView = (MapHeatmap) child;
|
|
1197
1200
|
heatmapView.addToMap(map);
|
|
1198
|
-
features.
|
|
1201
|
+
features.add(index, heatmapView);
|
|
1199
1202
|
TileOverlay heatmap = (TileOverlay) heatmapView.getFeature();
|
|
1200
1203
|
heatmapMap.put(heatmap, heatmapView);
|
|
1201
1204
|
} else if (child instanceof ViewGroup) {
|
|
@@ -1340,8 +1343,8 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
1340
1343
|
LatLngBounds.Builder builder = new LatLngBounds.Builder();
|
|
1341
1344
|
|
|
1342
1345
|
boolean addedPosition = false;
|
|
1343
|
-
if (
|
|
1344
|
-
for (MapFeature feature : features
|
|
1346
|
+
if (features.size() > 0) {
|
|
1347
|
+
for (MapFeature feature : features) {
|
|
1345
1348
|
if (feature instanceof MapMarker) {
|
|
1346
1349
|
Marker marker = (Marker) feature.getFeature();
|
|
1347
1350
|
builder.include(marker.getPosition());
|
|
@@ -1383,7 +1386,7 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
1383
1386
|
|
|
1384
1387
|
List<String> markerIDList = Arrays.asList(markerIDs);
|
|
1385
1388
|
|
|
1386
|
-
for (MapFeature feature : features
|
|
1389
|
+
for (MapFeature feature : features) {
|
|
1387
1390
|
if (feature instanceof MapMarker) {
|
|
1388
1391
|
String identifier = ((MapMarker) feature).getIdentifier();
|
|
1389
1392
|
Marker marker = (Marker) feature.getFeature();
|
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.26.
|
|
10
|
+
"version": "1.26.15",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"scripts": {
|
|
13
13
|
"lint": "eslint . --max-warnings 0",
|