diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index f43029d0b..8a5b59711 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -3189,25 +3189,6 @@ public: return reusableView; } -- (MGLAnnotationView *)annotationViewAtPoint:(CGPoint)point -{ - std::vector annotationTags = [self annotationTagsInRect:self.bounds]; - - for(auto const& annotationTag: annotationTags) - { - auto &annotationContext = _annotationContextsByAnnotationTag[annotationTag]; - MGLAnnotationView *annotationView = annotationContext.annotationView; - CGPoint convertedPoint = [self convertPoint:point toView:annotationView]; - - if ([annotationView pointInside:convertedPoint withEvent:nil]) - { - return annotationView; - } - } - - return nil; -} - /** Returns the tag of the annotation at the given point in the view. @@ -4586,16 +4567,15 @@ public: MGLAnnotationView *annotationView = [self annotationViewForAnnotation:annotationContext.annotation]; if (annotationView) { - // If the annotation view has no superview it means it was never used before so add it - if (!annotationView.superview) - { - [self.glView addSubview:annotationView]; - } - annotationView.mapView = self; annotationView.center = [self convertCoordinate:annotationContext.annotation.coordinate toPointToView:self]; annotationContext.annotationView = annotationView; } + else + { + // if there is no annotationView at this point then we are dealing with a sprite backed annotation + continue; + } } bool annotationViewIsVisible = CGRectContainsRect(viewPort, annotationView.frame);