summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Rex <julian.rex@mapbox.com>2018-05-02 09:22:43 -0400
committerJulian Rex <julian.rex@mapbox.com>2018-05-03 19:09:11 -0400
commit13985d5a846c2453439cda08aafc285380bf19b5 (patch)
treecb1189f588187ea5495bf5d14293ec210bf8e2e0
parentf6da3ba9be27ff9b279730603c517c4cb5e57007 (diff)
downloadqtlocation-mapboxgl-upstream/jrex-11756-distorted-annotation-view.tar.gz
Switched to use center property (instead of frame) when repositioning annotation views (when adding back into queue).upstream/jrex-11756-distorted-annotation-view
-rw-r--r--platform/ios/CHANGELOG.md7
-rw-r--r--platform/ios/src/MGLMapView.mm8
2 files changed, 11 insertions, 4 deletions
diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md
index 8f62d28ae3..e28510f80d 100644
--- a/platform/ios/CHANGELOG.md
+++ b/platform/ios/CHANGELOG.md
@@ -8,11 +8,16 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT
* Deprecated `+[NSExpression featurePropertiesVariableExpression]` use `+[NSExpression featureAttributesVariableExpression]` instead. ([#11748](https://github.com/mapbox/mapbox-gl-native/pull/11748))
+
+### Annotations
+
+* Fixed an issue where selecting an onscreen annotation could move the map unintentionally. ([#11731](https://github.com/mapbox/mapbox-gl-native/pull/11731))
+* Fixed an issue where annotation views could become distorted if `rotatesToMatchCamera` is `YES`. ([#11817](https://github.com/mapbox/mapbox-gl-native/pull/11817))
+
### Other changes
* Added a Korean localization. ([#11792](https://github.com/mapbox/mapbox-gl-native/pull/11792))
* Fixed an issue where `-[MGLMapView metersPerPixelAtLatitude:]` was removed, but not marked as unavailable. ([#11765](https://github.com/mapbox/mapbox-gl-native/pull/11765))
-* Fixed an issue where selecting an onscreen annotation could move the map unintentionally. ([#11731](https://github.com/mapbox/mapbox-gl-native/pull/11731))
* Reduce per-frame render CPU time ([#11811](https://github.com/mapbox/mapbox-gl-native/issues/11811))
* Fixed a crash when removing an `MGLOfflinePack`. ([#6092](https://github.com/mapbox/mapbox-gl-native/issues/6092))
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index 34269ce442..0e1f786a39 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -5725,10 +5725,12 @@ public:
if (annotationView.layer.animationKeys.count > 0) {
continue;
}
+
// Move the annotation view far out of view to the left
- CGRect adjustedFrame = annotationView.frame;
- adjustedFrame.origin.x = -CGRectGetWidth(self.frame) * 10.0;
- annotationView.frame = adjustedFrame;
+ CGPoint adjustedCenter = annotationView.center;
+ adjustedCenter.x = -CGRectGetWidth(self.frame) * 10.0;
+ annotationView.center = adjustedCenter;
+
[self enqueueAnnotationViewForAnnotationContext:annotationContext];
}
}