diff options
author | Julian Rex <julian.rex@gmail.com> | 2018-05-03 20:36:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-03 20:36:37 -0400 |
commit | 1b9c8b5ca72c8863ba2fd674f327fcc145753c1f (patch) | |
tree | f98b6add6decd403049c85941eb9afe647fbb452 /platform/ios/src | |
parent | c3346f473ac7e3d49219c8dbc381d92f8fe3f017 (diff) | |
download | qtlocation-mapboxgl-1b9c8b5ca72c8863ba2fd674f327fcc145753c1f.tar.gz |
[ios] Switched to use center property (instead of frame) when repositioning annotation views (when adding back into queue). (#11817)
Diffstat (limited to 'platform/ios/src')
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 8 |
1 files changed, 5 insertions, 3 deletions
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]; } } |