diff options
author | Lloyd Sheng <i@lloydsheng.com> | 2019-03-22 17:52:53 +0800 |
---|---|---|
committer | Lloyd Sheng <i@lloydsheng.com> | 2019-04-11 15:59:48 +0800 |
commit | 1992e031b9858a4c5a073b8961126b869d6f11f8 (patch) | |
tree | 421820465dc57a3dbb087a6acdfc43e12ccd968a | |
parent | 8f0837a6ea40d1b7f8f54a0eb186952187fcd16b (diff) | |
download | qtlocation-mapboxgl-1992e031b9858a4c5a073b8961126b869d6f11f8.tar.gz |
Fix arrow direction issue
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 0a699057e0..49218747ae 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -6410,8 +6410,19 @@ public: } - (void)updateAttributionAlertView { - if (self.attributionController && self.attributionController.presentingViewController) { + if (self.attributionController.presentingViewController) { self.attributionController.popoverPresentationController.sourceRect = self.attributionButton.frame; + switch (self.attributionButtonPosition) { + case MGLOrnamentPositionTopLeft: + case MGLOrnamentPositionTopRight: + [self.attributionController.popoverPresentationController setPermittedArrowDirections:UIMenuControllerArrowUp]; + break; + case MGLOrnamentPositionBottomLeft: + case MGLOrnamentPositionBottomRight: + [self.attributionController.popoverPresentationController setPermittedArrowDirections:UIMenuControllerArrowDown]; + break; + } + [self.attributionController.popoverPresentationController.containerView setNeedsLayout]; } } |