Skip to content

Commit

Permalink
Fix dynamic imageSrc removal, fix flicker in react-native-maps#738 (r…
Browse files Browse the repository at this point in the history
  • Loading branch information
btoueg authored and Exilz committed Dec 9, 2016
1 parent c408333 commit c35f0fe
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ios/AirGoogleMaps/AIRGoogleMapMarker.m
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,18 @@ - (void)setImageSrc:(NSString *)imageSrc
_reloadImageCancellationBlock = nil;
}

if (!_imageSrc) {
if (_iconImageView) [_iconImageView removeFromSuperview];
return;
}

if (!_iconImageView) {
// prevent glitch with marker (cf. https://github.com/airbnb/react-native-maps/issues/738)
UIImageView *empyImageView = [[UIImageView alloc] init];
_iconImageView = empyImageView;
[self iconViewInsertSubview:_iconImageView atIndex:0];
}

_reloadImageCancellationBlock = [_bridge.imageLoader loadImageWithURLRequest:[RCTConvert NSURLRequest:_imageSrc]
size:self.bounds.size
scale:RCTScreenScale()
Expand Down

0 comments on commit c35f0fe

Please sign in to comment.