From eb153368674cb6324f37975419a7f7f64a3bb3b0 Mon Sep 17 00:00:00 2001 From: Brandon Aubrey Date: Wed, 10 Jul 2024 03:51:30 -0700 Subject: [PATCH] Fixed attribution link in action sheets (#2587) Co-authored-by: Bart Louwers --- platform/ios/CHANGELOG.md | 2 +- platform/ios/src/MLNMapView.mm | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index bdfa81ffb..30c83798a 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -6,7 +6,7 @@ MapLibre welcomes participation and contributions from everyone. Please read [`C - Add [Privacy Manifest](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files). MapLibre Native iOS has no built-in tracking, but it does use some system APIs for functional purposes that are marked by Apple as privacy sensitive. ([#1866](https://github.com/maplibre/maplibre-native/issues/1866)). - Change default `MLNMapSnapshotter` logo to the MapLibre logo ([#2541](https://github.com/maplibre/maplibre-native/pull/2541)). Note that showing the MapLibre logo is never required. You can configure whether to show the logo with the (now public) `showsLogo` property of `MLNMapSnapshotterOptions`. Check with your tile provider if you need to show a logo. - +- Fixed attribution link in action sheets ([#2587](https://github.com/maplibre/maplibre-native/pull/2587)). ## 6.5.0 - Allow uses to handle authorization for location services ([#2453](https://github.com/maplibre/maplibre-native/pull/2453)). See [`MLNMapview.shouldRequestAuthorizationToUseLocationServices`](https://maplibre.org/maplibre-native/ios/latest/documentation/maplibre/mlnmapview/shouldrequestauthorizationtouselocationservices). diff --git a/platform/ios/src/MLNMapView.mm b/platform/ios/src/MLNMapView.mm index 09fe6099f..74e3254c4 100644 --- a/platform/ios/src/MLNMapView.mm +++ b/platform/ios/src/MLNMapView.mm @@ -2879,7 +2879,13 @@ public: { UIAlertAction *action = [UIAlertAction actionWithTitle:[attributionInfo.title.string mgl_titleCasedStringWithLocale:[NSLocale currentLocale]] style:UIAlertActionStyleDefault - handler:nil]; + handler:^(UIAlertAction * _Nonnull actionBlock) { + NSURL *url = attributionInfo.URL; + if (url) + { + [[UIApplication sharedApplication] openURL:url]; + } + }]; [attributionController addAction:action]; }