diff options
Diffstat (limited to 'platform/macos')
-rw-r--r-- | platform/macos/CHANGELOG.md | 7 | ||||
-rw-r--r-- | platform/macos/docs/guides/For Style Authors.md | 11 | ||||
-rw-r--r-- | platform/macos/macos.xcodeproj/project.pbxproj | 1 | ||||
-rw-r--r-- | platform/macos/src/MGLMapView.mm | 13 | ||||
-rw-r--r-- | platform/macos/src/NSColor+MGLAdditions.h | 1 | ||||
-rw-r--r-- | platform/macos/src/NSColor+MGLAdditions.mm | 6 |
6 files changed, 33 insertions, 6 deletions
diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md index 2542f57d95..ebfb3f335a 100644 --- a/platform/macos/CHANGELOG.md +++ b/platform/macos/CHANGELOG.md @@ -10,6 +10,12 @@ * Added `MGLNetworkConfiguration` class to customize the SDK's `NSURLSessionConfiguration` object. ([#11447](https://github.com/mapbox/mapbox-gl-native/pull/13886)) * Fixed an issue that caused `MGL_FUNCTION` to ignore multiple formatting parameters when passed a `format` function as parameter. ([#14064](https://github.com/mapbox/mapbox-gl-native/pull/14064)) * Added `mgl_attributed:` expression operator, which concatenate `MGLAttributedExpression` objects for specifying rich text in the `MGLSymbolStyleLayer.text` property. ([#14094](https://github.com/mapbox/mapbox-gl-native/pull/14094)) +* Fixed an issue that caused conditional expressions to crash when passed nested conditional expressions as parameters. ([#14181](https://github.com/mapbox/mapbox-gl-native/pull/14181)) +* Added `-[MGLMapViewDelegate mapView:didFailToLoadImage:]` to load missing symbol icons in the style if they are not found. ([#14302](https://github.com/mapbox/mapbox-gl-native/pull/14302)) + +### Offline + +* Fixed a bug that caused offline packs created prior to v0.7.0 (introduced in [#11055](https://github.com/mapbox/mapbox-gl-native/pull/11055)) to be marked as `MGLOfflinePackStateInactive`. ([#14188](https://github.com/mapbox/mapbox-gl-native/pull/14188)) ### Annotations @@ -19,6 +25,7 @@ ### Packaging * Added Czech and Galician localizations. ([#13782](https://github.com/mapbox/mapbox-gl-native/pull/13782), [#14095](https://github.com/mapbox/mapbox-gl-native/pull/14095)) +* Added support for building with Xcode 10.2 / iOS SDK 12.2. ([#14241](https://github.com/mapbox/mapbox-gl-native/pull/14241)) ## 0.13.0 - December 20, 2018 diff --git a/platform/macos/docs/guides/For Style Authors.md b/platform/macos/docs/guides/For Style Authors.md index 038ddf1f93..5a81eb3593 100644 --- a/platform/macos/docs/guides/For Style Authors.md +++ b/platform/macos/docs/guides/For Style Authors.md @@ -411,5 +411,16 @@ In style JSON | In the format string `["any", f0, …, fn]` | `p0 OR … OR pn` `["none", f0, …, fn]` | `NOT (p0 OR … OR pn)` +## Specifying the text format + +The following format attributes are defined as `NSString` constans that you +can use to update the formatting of `MGLSymbolStyleLayer.text` property. + +In style JSON | In Objective-C | In Swift +--------------|-----------------------|--------- +`text-font` | `MGLFontNamesAttribute` | `.fontNamesAttribute` +`font-scale` | `MGLFontScaleAttribute` | `.fontScaleAttribute` +`text-color` | `MGLFontColorAttribute` | `.fontColorAttribute` + See the “[Predicates and Expressions](predicates-and-expressions.html)” guide for a full description of the supported operators and operand types. diff --git a/platform/macos/macos.xcodeproj/project.pbxproj b/platform/macos/macos.xcodeproj/project.pbxproj index 5d5a94c78a..57c4f198f0 100644 --- a/platform/macos/macos.xcodeproj/project.pbxproj +++ b/platform/macos/macos.xcodeproj/project.pbxproj @@ -2008,6 +2008,7 @@ GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_CPP_RTTI = NO; GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = "NDEBUG=1"; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index 911d254889..0fdecd6cc8 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -36,8 +36,8 @@ #import <mbgl/renderer/renderer.hpp> #import <mbgl/renderer/renderer_backend.hpp> #import <mbgl/renderer/backend_scope.hpp> -#import <mbgl/storage/default_file_source.hpp> #import <mbgl/storage/network_status.hpp> +#import <mbgl/storage/resource_options.hpp> #import <mbgl/math/wrap.hpp> #import <mbgl/util/constants.hpp> #import <mbgl/util/chrono.hpp> @@ -292,10 +292,17 @@ public: mbgl::MapOptions mapOptions; mapOptions.withMapMode(mbgl::MapMode::Continuous) + .withSize(self.size) + .withPixelRatio(config.scaleFactor) .withConstrainMode(mbgl::ConstrainMode::None) .withViewportMode(mbgl::ViewportMode::Default) .withCrossSourceCollisions(enableCrossSourceCollisions); - _mbglMap = new mbgl::Map(*_rendererFrontend, *_mbglView, self.size, config.scaleFactor, *config.fileSource, *_mbglThreadPool, mapOptions); + + mbgl::ResourceOptions resourceOptions; + resourceOptions.withCachePath([[MGLOfflineStorage sharedOfflineStorage] mbglCachePath]) + .withAssetPath([NSBundle mainBundle].resourceURL.path.UTF8String); + + _mbglMap = new mbgl::Map(*_rendererFrontend, *_mbglView, *_mbglThreadPool, mapOptions, resourceOptions); // Install the OpenGL layer. Interface Builder’s synchronous drawing means // we can’t display a map, so don’t even bother to have a map layer. @@ -690,7 +697,7 @@ public: self.dormant = NO; } - if (window && _mbglMap->getConstrainMode() == mbgl::ConstrainMode::None) { + if (window && _mbglMap->getMapOptions().constrainMode() == mbgl::ConstrainMode::None) { _mbglMap->setConstrainMode(mbgl::ConstrainMode::HeightOnly); } diff --git a/platform/macos/src/NSColor+MGLAdditions.h b/platform/macos/src/NSColor+MGLAdditions.h index 21c939fec6..a3c5aba63f 100644 --- a/platform/macos/src/NSColor+MGLAdditions.h +++ b/platform/macos/src/NSColor+MGLAdditions.h @@ -23,5 +23,6 @@ + (NSExpression *)mgl_expressionForRGBComponents:(NSArray<NSExpression *> *)components; + (NSExpression *)mgl_expressionForRGBAComponents:(NSArray<NSExpression *> *)components; ++ (NSColor *)mgl_colorWithRGBComponents:(NSArray<NSExpression *> *)componentExpressions; @end diff --git a/platform/macos/src/NSColor+MGLAdditions.mm b/platform/macos/src/NSColor+MGLAdditions.mm index c73c1a41b7..ea7d99f66d 100644 --- a/platform/macos/src/NSColor+MGLAdditions.mm +++ b/platform/macos/src/NSColor+MGLAdditions.mm @@ -37,7 +37,7 @@ @implementation NSExpression (MGLColorAdditions) + (NSExpression *)mgl_expressionForRGBComponents:(NSArray<NSExpression *> *)components { - if (NSColor *color = [self mgl_colorWithComponentExpressions:components]) { + if (NSColor *color = [self mgl_colorWithRGBComponents:components]) { return [NSExpression expressionForConstantValue:color]; } @@ -49,7 +49,7 @@ } + (NSExpression *)mgl_expressionForRGBAComponents:(NSArray<NSExpression *> *)components { - if (NSColor *color = [self mgl_colorWithComponentExpressions:components]) { + if (NSColor *color = [self mgl_colorWithRGBComponents:components]) { return [NSExpression expressionForConstantValue:color]; } @@ -62,7 +62,7 @@ /** Returns a color object corresponding to the given component expressions. */ -+ (NSColor *)mgl_colorWithComponentExpressions:(NSArray<NSExpression *> *)componentExpressions { ++ (NSColor *)mgl_colorWithRGBComponents:(NSArray<NSExpression *> *)componentExpressions { // Map the component expressions to constant components. If any component is // a non-constant expression, the components cannot be converted into a // constant color value. |