From 2933ef1c09f9bcd446c01b029f90a0bb7b6d1228 Mon Sep 17 00:00:00 2001 From: Jesse Bounds Date: Wed, 29 Jun 2016 11:14:10 -0700 Subject: [PATCH] [ios] Always use symbol name for annotation update (#5509) This removes the guard that used to be in place from the time when UIView backed annotations did not have invisible image placeholders. Since images are now present for both sprite and UIView backed annotations, the guard is no longer necessary and removing it allows for the correct symbol name to be passed to the map object and this gets rid of `[INFO] {Worker}[Sprite]: Can't find sprite named 'default_marker'` log message. --- platform/ios/src/MGLMapView.mm | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index cd41f41d2..23aa9a2a1 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -1768,16 +1768,12 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration) if (annotation == [self annotationWithTag:annotationTag]) { const mbgl::Point point = MGLPointFromLocationCoordinate2D(annotation.coordinate); - - MGLAnnotationContext &annotationContext = _annotationContextsByAnnotationTag.at(annotationTag); + NSString *symbolName; - if (!annotationContext.annotationView) - { - MGLAnnotationImage *annotationImage = [self imageOfAnnotationWithTag:annotationTag]; - symbolName = annotationImage.styleIconIdentifier; - } - - _mbglMap->updateAnnotation(annotationTag, mbgl::SymbolAnnotation { point, symbolName.UTF8String ?: "" }); + MGLAnnotationImage *annotationImage = [self imageOfAnnotationWithTag:annotationTag]; + symbolName = annotationImage.styleIconIdentifier; + + _mbglMap->updateAnnotation(annotationTag, mbgl::SymbolAnnotation { point, symbolName.UTF8String}); if (annotationTag == _selectedAnnotationTag) { [self deselectAnnotation:annotation animated:YES];