From 7e9701283f96bfcce3a56a3af4c8fe9154f02b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Thu, 2 Mar 2017 23:52:14 -0800 Subject: [ios, macos] Update callout when relocating annotation When relocating a selected point annotation, update the associated callout (popover) rather than deselecting the annotation. --- platform/macos/src/MGLMapView.mm | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'platform/macos/src/MGLMapView.mm') diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index d70b5c0f03..3e76fa9ad0 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -538,9 +538,7 @@ public: const mbgl::Point point = MGLPointFromLocationCoordinate2D(annotation.coordinate); MGLAnnotationImage *annotationImage = [self imageOfAnnotationWithTag:annotationTag]; _mbglMap->updateAnnotation(annotationTag, mbgl::SymbolAnnotation { point, annotationImage.styleIconIdentifier.UTF8String ?: "" }); - if (annotationTag == _selectedAnnotationTag) { - [self deselectAnnotation:annotation]; - } + [self updateAnnotationCallouts]; } } else if ([keyPath isEqualToString:@"coordinates"] && [object isKindOfClass:[MGLMultiPoint class]]) { @@ -554,12 +552,7 @@ public: // but safely updated. if (annotation == [self annotationWithTag:annotationTag]) { _mbglMap->updateAnnotation(annotationTag, [annotation annotationObjectWithDelegate:self]); - // We don't current support shape multipoint annotation selection, but let's make sure - // deselection is handled just to avoid problems in the future. - if (annotationTag == _selectedAnnotationTag) - { - [self deselectAnnotation:annotation]; - } + [self updateAnnotationCallouts]; } } } -- cgit v1.2.1