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

Commit

Permalink
[ios] Always use symbol name for annotation update (#5509)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
boundsj authored Jun 29, 2016
1 parent 1a6b513 commit 2933ef1
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions platform/ios/src/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1768,16 +1768,12 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
if (annotation == [self annotationWithTag:annotationTag])
{
const mbgl::Point<double> 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];
Expand Down

0 comments on commit 2933ef1

Please sign in to comment.