summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-06-05 00:45:11 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-06-06 16:00:45 -0700
commitb3d9e125b1538f7642b70eb1014afe89208dc419 (patch)
tree61a4d2fad962966e5dcb59d66bfc6ae6677939e8 /platform
parent654f0156397b68420bc48dfa2d53589ea7c8042e (diff)
downloadqtlocation-mapboxgl-b3d9e125b1538f7642b70eb1014afe89208dc419.tar.gz
[ios] Avoid adding icon when relocating annotation
Fixed an issue that caused a default annotation icon to appear beneath an annotation view when relocating the annotation.
Diffstat (limited to 'platform')
-rw-r--r--platform/ios/src/MGLMapView.mm12
1 files changed, 10 insertions, 2 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index b05c5e41d4..74e2f1e73e 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -1779,8 +1779,16 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration)
if (annotation == [self annotationWithTag:annotationTag])
{
const mbgl::Point<double> point = MGLPointFromLocationCoordinate2D(annotation.coordinate);
- MGLAnnotationImage *annotationImage = [self imageOfAnnotationWithTag:annotationTag];
- _mbglMap->updateAnnotation(annotationTag, mbgl::SymbolAnnotation { point, annotationImage.styleIconIdentifier.UTF8String ?: "" });
+
+ 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 ?: "" });
if (annotationTag == _selectedAnnotationTag)
{
[self deselectAnnotation:annotation animated:YES];