From 27deb3a96e7ccc0ad980d50225e1f223ea9571dd Mon Sep 17 00:00:00 2001 From: Jesse Bounds Date: Wed, 29 Jun 2016 07:17:33 -0700 Subject: [PATCH] [ios] Always use symbol name for annotation update 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 cd41f41d216..23aa9a2a1b6 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -1768,16 +1768,12 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N 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];