Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 27deb3a

Browse files
committed
[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.
1 parent 1a6b513 commit 27deb3a

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

platform/ios/src/MGLMapView.mm

+5-9
Original file line numberDiff line numberDiff line change
@@ -1768,16 +1768,12 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
17681768
if (annotation == [self annotationWithTag:annotationTag])
17691769
{
17701770
const mbgl::Point<double> point = MGLPointFromLocationCoordinate2D(annotation.coordinate);
1771-
1772-
MGLAnnotationContext &annotationContext = _annotationContextsByAnnotationTag.at(annotationTag);
1771+
17731772
NSString *symbolName;
1774-
if (!annotationContext.annotationView)
1775-
{
1776-
MGLAnnotationImage *annotationImage = [self imageOfAnnotationWithTag:annotationTag];
1777-
symbolName = annotationImage.styleIconIdentifier;
1778-
}
1779-
1780-
_mbglMap->updateAnnotation(annotationTag, mbgl::SymbolAnnotation { point, symbolName.UTF8String ?: "" });
1773+
MGLAnnotationImage *annotationImage = [self imageOfAnnotationWithTag:annotationTag];
1774+
symbolName = annotationImage.styleIconIdentifier;
1775+
1776+
_mbglMap->updateAnnotation(annotationTag, mbgl::SymbolAnnotation { point, symbolName.UTF8String});
17811777
if (annotationTag == _selectedAnnotationTag)
17821778
{
17831779
[self deselectAnnotation:annotation animated:YES];

0 commit comments

Comments
 (0)