diff --git a/ios/AirGoogleMaps/AIRGoogleMapMarker.m b/ios/AirGoogleMaps/AIRGoogleMapMarker.m index d9fa3eb44c..a3bbbffc00 100644 --- a/ios/AirGoogleMaps/AIRGoogleMapMarker.m +++ b/ios/AirGoogleMaps/AIRGoogleMapMarker.m @@ -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()