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/CHANGELOG.md | 3 ++- platform/macos/src/MGLMapView.mm | 11 ++--------- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'platform/macos') diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md index 7f36b36cb6..76efbc2a0d 100644 --- a/platform/macos/CHANGELOG.md +++ b/platform/macos/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog for Mapbox macOS SDK -## master +## 0.4.0 ### Internationalization @@ -47,6 +47,7 @@ * Added support for the Carthage dependency manager. See [this SDK’s homepage](https://mapbox.github.io/mapbox-gl-native/macos/) for setup instructions. ([#8257](https://github.com/mapbox/mapbox-gl-native/pull/8257)) * Fixed an issue that, among other things, caused various islands to disappear at certain zoom levels. ([#7621](https://github.com/mapbox/mapbox-gl-native/pull/7621)) +* Changing the coordinates of a point annotation no longer deselects the annotation. ([#8269](https://github.com/mapbox/mapbox-gl-native/pull/8269)) * Fixed an issue where translucent point annotations along tile boundaries would be drawn darker than expected. ([#6832](https://github.com/mapbox/mapbox-gl-native/pull/6832)) * Fixed flickering that occurred when panning past the antimeridian. ([#7574](https://github.com/mapbox/mapbox-gl-native/pull/7574)) * Added a `MGLDistanceFormatter` class for formatting geographic distances. ([#7888](https://github.com/mapbox/mapbox-gl-native/pull/7888)) 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