react-native-maps 1.29.9 → 1.29.11

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);
@@ -34,6 +34,7 @@ CGRect unionRect(CGRect a, CGRect b) {
34
34
  RCTDirectEventBlock _onSelect;
35
35
  RCTDirectEventBlock _onDeselect;
36
36
  __weak UIImageView *_iconImageView;
37
+ UIImage *_iconImage;
37
38
  UIView *_iconView;
38
39
  UIColor *_pinColor;
39
40
  CLLocationCoordinate2D _coordinates;
@@ -130,6 +131,13 @@ CGRect unionRect(CGRect a, CGRect b) {
130
131
  if (_pinColor){
131
132
  _realMarker.icon = [GMSMarker markerImageWithColor:_pinColor];
132
133
  }
134
+ if (_iconSrc){
135
+ if (_iconImage){
136
+ _realMarker.icon = _iconImage;
137
+ } else {
138
+ [self setIconSrc:_iconSrc];
139
+ }
140
+ }
133
141
  if (_opacity != 1.0){
134
142
  [_realMarker setOpacity:_opacity];
135
143
  }
@@ -420,6 +428,7 @@ CGRect unionRect(CGRect a, CGRect b) {
420
428
  - (void)setIconSrc:(NSString *)iconSrc
421
429
  {
422
430
  _iconSrc = iconSrc;
431
+ _iconImage = nil;
423
432
 
424
433
  if (_reloadImageCancellationBlock) {
425
434
  _reloadImageCancellationBlock();
@@ -446,6 +455,7 @@ CGRect unionRect(CGRect a, CGRect b) {
446
455
  NSLog(@"%@", error);
447
456
  }
448
457
  dispatch_async(dispatch_get_main_queue(), ^{
458
+ self->_iconImage = image;
449
459
  self->_realMarker.icon = image;
450
460
  });
451
461
  }];
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.9",
10
+ "version": "1.29.11",
11
11
  "license": "MIT",
12
12
  "scripts": {
13
13
  "lint": "eslint . --max-warnings 0",