From 07134346f80c73982ff3968cb1b1f94051203dff Mon Sep 17 00:00:00 2001 From: Fabian Guerra Date: Tue, 31 Oct 2017 16:53:38 -0400 Subject: [ios, macos] Update changelogs. --- platform/ios/CHANGELOG.md | 1 + platform/ios/src/MGLMapView.mm | 6 +++--- platform/macos/CHANGELOG.md | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 5ca8ed929e..32713b60e1 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -32,6 +32,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Added `-[MGLMapView cameraThatFitsShape:direction:edgePadding:]` to get a camera with zoom level and center coordinate computed to fit a shape. ([#10107](https://github.com/mapbox/mapbox-gl-native/pull/10107)) * Added support selection of shape and polyline annotations.([#9984](https://github.com/mapbox/mapbox-gl-native/pull/9984)) * Fixed an issue where view annotations could be slightly misaligned. View annotation placement is now rounded to the nearest pixel. ([#10219](https://github.com/mapbox/mapbox-gl-native/pull/10219)) +* Fixed an issue where a shape annotation callout was not displayed if the centroid was not visible. ([#10255](https://github.com/mapbox/mapbox-gl-native/pull/10255)) ### Other changes diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 764b6a9fbf..ed51754b0a 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -1616,7 +1616,7 @@ public: if(annotation) { CGPoint calloutPoint = [singleTap locationInView:self]; - CGRect positionRect = [self positioningRectForAnnotation:annotation withDefaultCalloutPoint:calloutPoint]; + CGRect positionRect = [self positioningRectForAnnotation:annotation defaultCalloutPoint:calloutPoint]; [self selectAnnotation:annotation animated:YES calloutPositioningRect:positionRect]; } else @@ -3982,7 +3982,7 @@ public: - (void)selectAnnotation:(id )annotation animated:(BOOL)animated { - CGRect positioningRect = [self positioningRectForAnnotation:annotation withDefaultCalloutPoint:CGPointZero]; + CGRect positioningRect = [self positioningRectForAnnotation:annotation defaultCalloutPoint:CGPointZero]; [self selectAnnotation:annotation animated:animated calloutPositioningRect:positioningRect]; } @@ -4116,7 +4116,7 @@ public: /// and is appropriate for positioning a popover. /// If a shape annotation is visible but its centroid is not, and a default point is specified, /// the callout view is anchored to the default callout point. -- (CGRect)positioningRectForAnnotation:(id )annotation withDefaultCalloutPoint:(CGPoint)calloutPoint +- (CGRect)positioningRectForAnnotation:(id )annotation defaultCalloutPoint:(CGPoint)calloutPoint { MGLAnnotationTag annotationTag = [self annotationTagForAnnotation:annotation]; CGRect positioningRect = [self positioningRectForCalloutForAnnotationWithTag:annotationTag]; diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md index 4b3292c600..c087bf4609 100644 --- a/platform/macos/CHANGELOG.md +++ b/platform/macos/CHANGELOG.md @@ -28,6 +28,7 @@ * Added an `overlays` property to `MGLMapView`. ([#8617](https://github.com/mapbox/mapbox-gl-native/pull/8617)) * Added `-[MGLMapView cameraThatFitsShape:direction:edgePadding:]` to get a camera with zoom level and center coordinate computed to fit a shape. ([#10107](https://github.com/mapbox/mapbox-gl-native/pull/10107)) * Added support selection of shape and polyline annotations.([#9984](https://github.com/mapbox/mapbox-gl-native/pull/9984)) +* Fixed an issue where a shape annotation callout was not displayed if the centroid was not visible. ([#10255](https://github.com/mapbox/mapbox-gl-native/pull/10255)) ### Other changes -- cgit v1.2.1