summaryrefslogtreecommitdiff
path: root/platform/macos/src
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2017-03-02 23:52:14 -0800
committerMinh Nguyễn <mxn@1ec5.org>2017-03-03 22:09:41 -0800
commit7e9701283f96bfcce3a56a3af4c8fe9154f02b61 (patch)
treed312cd5ed41192447313d423a640d56de45d5d6f /platform/macos/src
parent9ea41136345c919ba06f31a940ff7a23caabfb08 (diff)
downloadqtlocation-mapboxgl-7e9701283f96bfcce3a56a3af4c8fe9154f02b61.tar.gz
[ios, macos] Update callout when relocating annotation
When relocating a selected point annotation, update the associated callout (popover) rather than deselecting the annotation.
Diffstat (limited to 'platform/macos/src')
-rw-r--r--platform/macos/src/MGLMapView.mm11
1 files changed, 2 insertions, 9 deletions
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<double> 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];
}
}
}