react-native-maps 1.29.8 → 1.29.10

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.
@@ -709,6 +709,14 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
709
709
 
710
710
 
711
711
  isMapReady = true;
712
+ // Google's MapView removes every child when its map delegate is created
713
+ // (MapView.zza.onCreate -> removeAllViews). That takes the attacher group added
714
+ // in our constructor with it, so custom marker views added before the first
715
+ // detach/re-attach cycle never reach the window and Fresco never loads their
716
+ // images. Put the group back as soon as the map is ready.
717
+ if (attacherGroup != null && attacherGroup.getParent() == null) {
718
+ addView(attacherGroup);
719
+ }
712
720
  if (kmlSrc != null) {
713
721
  setKmlSrc(kmlSrc);
714
722
  kmlSrc = null;
@@ -1225,6 +1233,10 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
1225
1233
  // Ensure attacherGroup is not null before using it
1226
1234
  if (attacherGroup == null) {
1227
1235
  prepareAttacherView();
1236
+ } else if (attacherGroup.getParent() == null) {
1237
+ // Orphaned by Google's removeAllViews (see onMapReady); re-add it so the
1238
+ // marker view below actually attaches and its images load.
1239
+ addView(attacherGroup);
1228
1240
  }
1229
1241
  // Add to the parent group
1230
1242
  attacherGroup.addView(annotation);
@@ -270,6 +270,23 @@ using namespace facebook::react;
270
270
  return self;
271
271
  }
272
272
 
273
+ // The legacy AIRGoogleMapMarker is never added to a view hierarchy under Fabric, so its
274
+ // layoutSubviews never runs and the iconView it hands to GMSMarker stays 0x0 — custom-view
275
+ // markers render blank. Size it from Fabric's layout (the marker is position:absolute, so
276
+ // this is the size of its children) and ask GMS to re-snapshot the icon.
277
+ - (void)updateLayoutMetrics:(LayoutMetrics const &)layoutMetrics
278
+ oldLayoutMetrics:(LayoutMetrics const &)oldLayoutMetrics
279
+ {
280
+ [super updateLayoutMetrics:layoutMetrics oldLayoutMetrics:oldLayoutMetrics];
281
+ CGRect bounds = CGRectMake(0, 0, layoutMetrics.frame.size.width, layoutMetrics.frame.size.height);
282
+ if (CGRectIsEmpty(bounds) || CGRectEqualToRect(_view.iconView.frame, bounds)) {
283
+ return;
284
+ }
285
+ _view.frame = bounds;
286
+ _view.iconView.frame = bounds;
287
+ [_view redraw];
288
+ }
289
+
273
290
  - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
274
291
  {
275
292
  [self prepareMarkerView];
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.29.8",
10
+ "version": "1.29.10",
11
11
  "license": "MIT",
12
12
  "scripts": {
13
13
  "lint": "eslint . --max-warnings 0",