diff options
Diffstat (limited to 'platform/ios/src/MGLMapView.mm')
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 0849cbd12f..31eac056e5 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -18,6 +18,7 @@ #include <mbgl/style/image.hpp> #include <mbgl/style/transition_options.hpp> #include <mbgl/style/layers/custom_layer.hpp> +#include <mbgl/renderer/mode.hpp> #include <mbgl/renderer/renderer.hpp> #include <mbgl/renderer/renderer_backend.hpp> #include <mbgl/renderer/backend_scope.hpp> @@ -40,11 +41,11 @@ #import "MGLGeometry_Private.h" #import "MGLMultiPoint_Private.h" #import "MGLOfflineStorage_Private.h" +#import "MGLVectorSource_Private.h" #import "MGLFoundation_Private.h" #import "MGLRendererFrontend.h" #import "MGLRendererConfiguration.h" -#import "MGLVectorSource+MGLAdditions.h" #import "NSBundle+MGLAdditions.h" #import "NSDate+MGLAdditions.h" #import "NSException+MGLAdditions.h" @@ -460,6 +461,9 @@ public: _attributionButtonConstraints = [NSMutableArray array]; [_attributionButton addObserver:self forKeyPath:@"hidden" options:NSKeyValueObservingOptionNew context:NULL]; + UILongPressGestureRecognizer *attributionLongPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(showAttribution:)]; + [_attributionButton addGestureRecognizer:attributionLongPress]; + // setup compass // _compassView = [[UIImageView alloc] initWithImage:self.compassImage]; @@ -1974,13 +1978,28 @@ public: #pragma mark - Attribution - -- (void)showAttribution:(__unused id)sender +- (void)showAttribution:(id)sender { + BOOL shouldShowVersion = [sender isKindOfClass:[UILongPressGestureRecognizer class]]; + if (shouldShowVersion) + { + UILongPressGestureRecognizer *longPress = (UILongPressGestureRecognizer *)sender; + if (longPress.state != UIGestureRecognizerStateBegan) + { + return; + } + } + NSString *title = NSLocalizedStringWithDefaultValue(@"SDK_NAME", nil, nil, @"Mapbox Maps SDK for iOS", @"Action sheet title"); UIAlertController *attributionController = [UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleActionSheet]; - + + if (shouldShowVersion) + { + attributionController.title = [title stringByAppendingFormat:@" %@", [NSBundle mgl_frameworkInfoDictionary][@"MGLSemanticVersionString"]]; + } + NSArray *attributionInfos = [self.style attributionInfosWithFontSize:[UIFont buttonFontSize] linkColor:nil]; for (MGLAttributionInfo *info in attributionInfos) @@ -6033,7 +6052,7 @@ public: [nativeView didFinishLoadingStyle]; } - mbgl::gl::ProcAddress initializeExtension(const char* name) override { + mbgl::gl::ProcAddress getExtensionFunctionPointer(const char* name) override { static CFBundleRef framework = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengles")); if (!framework) { throw std::runtime_error("Failed to load OpenGL framework."); |