From 1254bcdb4006d87fefedfc5020b3dc7d3cd0e544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Tue, 20 Dec 2016 16:11:05 -0800 Subject: [ios, macos] Update and reformat documentation for runtime styling (#7475) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [ios, macos] Optimized changelog for runtime styling Changelog entries related to style JSON now lead off with the analogous portion of the runtime styling API. * [ios, macos] Autolink cross-class property references in docs jazzy can autolink `Class.property` references in documentation comments. * [ios, macos] Removed extra blank lines * [ios, macos] Corrected typo in MGLMultiPoint docs * [ios, macos] Rewrote shape and feature docs Rewrote documentation about MGLShape, its subclasses, and MGLFeature to emphasize runtime styling uses over annotation uses, associate each type with real-world concepts, cross-reference related style layer classes, and cross-reference related or easily confused shape classes. Links to the GeoJSON specification have been updated to RFC 7946. * [ios, macos] Expanded style layer docs With this change, documentation about style layer classes is nominally based on the documentation in the style specification. However, all the existing layer types’ documentation has been overridden to explain what the layer looks like, relate the layer to a real-world concept, and cross-reference related geometry classes. This change also corrects the description of MGLBackgroundStyleLayer, which erroneously stated that the identifier must be “background”, whereas that only happens to be true by default for Studio template styles. * [ios, macos] Wrap style layer docs * [ios, macos] Removed unused code * [ios, macos] Corrected symbol references in docs * [ios, macos] Corrected typo in abstract class exception --- platform/darwin/src/MGLFillStyleLayer.h | 79 +++++++++++++++++++++++---------- 1 file changed, 55 insertions(+), 24 deletions(-) (limited to 'platform/darwin/src/MGLFillStyleLayer.h') diff --git a/platform/darwin/src/MGLFillStyleLayer.h b/platform/darwin/src/MGLFillStyleLayer.h index cf8c18b5c2..01f1b17f97 100644 --- a/platform/darwin/src/MGLFillStyleLayer.h +++ b/platform/darwin/src/MGLFillStyleLayer.h @@ -9,7 +9,8 @@ NS_ASSUME_NONNULL_BEGIN /** Controls the translation reference point. - Values of this type are used in the `fillTranslateAnchor` property of `MGLFillStyleLayer`. + Values of this type are used in the `MGLFillStyleLayer.fillTranslateAnchor` + property. */ typedef NS_ENUM(NSUInteger, MGLFillTranslateAnchor) { /** @@ -23,10 +24,19 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslateAnchor) { }; /** - A fill layer which allows customization of styling properties at runtime. You may - instantiate a new fill layer to add to a map style or you may query an - `MGLMapView` for its `style` and obtain existing layers using the - `-[MGLStyle layerWithIdentifier:]` method. + An `MGLFillStyleLayer` is a style layer that renders one or more filled (and + optionally stroked) polygons on the map. + + Use a fill style layer to configure the visual appearance of polygon or + multipolygon features in vector tiles loaded by an `MGLVectorSource` object or + `MGLPolygon`, `MGLPolygonFeature`, `MGLMultiPolygon`, or + `MGLMultiPolygonFeature` instances in an `MGLShapeSource` object. + + You can access an existing fill style layer using the + `-[MGLStyle layerWithIdentifier:]` method if you know its identifier; + otherwise, find it using the `MGLStyle.layers` property. You can also create a + new fill style layer and add it to the style using a method such as + `-[MGLStyle addLayer:]`. */ @interface MGLFillStyleLayer : MGLVectorStyleLayer @@ -35,69 +45,90 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslateAnchor) { /** Whether or not the fill should be antialiased. - The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing `YES`. Set this property to `nil` to reset it to the default value. + The default value of this property is an `MGLStyleValue` object containing an + `NSNumber` object containing `YES`. Set this property to `nil` to reset it to + the default value. - This attribute corresponds to the fill-antialias paint property in the Mapbox Style Specification. + This attribute corresponds to the fill-antialias + layout property in the Mapbox Style Specification. */ @property (nonatomic, null_resettable, getter=isFillAntialiased) MGLStyleValue *fillAntialiased; - @property (nonatomic, null_resettable) MGLStyleValue *fillAntialias __attribute__((unavailable("Use fillAntialiased instead."))); #if TARGET_OS_IPHONE /** The color of the filled part of this layer. - The default value of this property is an `MGLStyleValue` object containing `UIColor.blackColor`. Set this property to `nil` to reset it to the default value. - - This property is only applied to the style if `fillPattern` is set to `nil`. Otherwise, it is ignored. + The default value of this property is an `MGLStyleValue` object containing + `UIColor.blackColor`. Set this property to `nil` to reset it to the default + value. + + This property is only applied to the style if `fillPattern` is set to `nil`. + Otherwise, it is ignored. */ @property (nonatomic, null_resettable) MGLStyleValue *fillColor; #else /** The color of the filled part of this layer. - The default value of this property is an `MGLStyleValue` object containing `NSColor.blackColor`. Set this property to `nil` to reset it to the default value. - - This property is only applied to the style if `fillPattern` is set to `nil`. Otherwise, it is ignored. + The default value of this property is an `MGLStyleValue` object containing + `NSColor.blackColor`. Set this property to `nil` to reset it to the default + value. + + This property is only applied to the style if `fillPattern` is set to `nil`. + Otherwise, it is ignored. */ @property (nonatomic, null_resettable) MGLStyleValue *fillColor; #endif /** - The opacity of the entire fill layer. In contrast to the `fillColor`, this value will also affect the 1pt stroke around the fill, if the stroke is used. + The opacity of the entire fill layer. In contrast to the `fillColor`, this + value will also affect the 1pt stroke around the fill, if the stroke is used. - The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `1`. Set this property to `nil` to reset it to the default value. + The default value of this property is an `MGLStyleValue` object containing an + `NSNumber` object containing the float `1`. Set this property to `nil` to reset + it to the default value. */ @property (nonatomic, null_resettable) MGLStyleValue *fillOpacity; /** The outline color of the fill. Matches the value of `fillColor` if unspecified. - - This property is only applied to the style if `fillPattern` is set to `nil`, and `fillAntialiased` is set to an `MGLStyleValue` object containing an `NSNumber` object containing `YES`. Otherwise, it is ignored. + + This property is only applied to the style if `fillPattern` is set to `nil`, + and `fillAntialiased` is set to an `MGLStyleValue` object containing an + `NSNumber` object containing `YES`. Otherwise, it is ignored. */ @property (nonatomic, null_resettable) MGLStyleValue *fillOutlineColor; /** - Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). + Name of image in sprite to use for drawing image fills. For seamless patterns, + image width and height must be a factor of two (2, 4, 8, ..., 512). */ @property (nonatomic, null_resettable) MGLStyleValue *fillPattern; /** The geometry's offset. - + This property is measured in points. - The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing a `CGVector` struct set to 0 points from the left and 0 points from the top. Set this property to `nil` to reset it to the default value. + The default value of this property is an `MGLStyleValue` object containing an + `NSValue` object containing a `CGVector` struct set to 0 points from the left + and 0 points from the top. Set this property to `nil` to reset it to the + default value. */ @property (nonatomic, null_resettable) MGLStyleValue *fillTranslate; /** Controls the translation reference point. - The default value of this property is an `MGLStyleValue` object containing an `NSValue` object containing `MGLFillTranslateAnchorMap`. Set this property to `nil` to reset it to the default value. - - This property is only applied to the style if `fillTranslate` is non-`nil`. Otherwise, it is ignored. + The default value of this property is an `MGLStyleValue` object containing an + `NSValue` object containing `MGLFillTranslateAnchorMap`. Set this property to + `nil` to reset it to the default value. + + This property is only applied to the style if `fillTranslate` is non-`nil`. + Otherwise, it is ignored. */ @property (nonatomic, null_resettable) MGLStyleValue *fillTranslateAnchor; -- cgit v1.2.1 From 9faa4af1c3cf0665ede20de8d98005ef9016b792 Mon Sep 17 00:00:00 2001 From: Eric Wolfe Date: Wed, 21 Dec 2016 10:22:13 -0800 Subject: [ios] Add inline examples in documentation (#7337) --- platform/darwin/src/MGLFillStyleLayer.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'platform/darwin/src/MGLFillStyleLayer.h') diff --git a/platform/darwin/src/MGLFillStyleLayer.h b/platform/darwin/src/MGLFillStyleLayer.h index 01f1b17f97..2638e85aa5 100644 --- a/platform/darwin/src/MGLFillStyleLayer.h +++ b/platform/darwin/src/MGLFillStyleLayer.h @@ -37,6 +37,8 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslateAnchor) { otherwise, find it using the `MGLStyle.layers` property. You can also create a new fill style layer and add it to the style using a method such as `-[MGLStyle addLayer:]`. + + */ @interface MGLFillStyleLayer : MGLVectorStyleLayer -- cgit v1.2.1 From 50ae3eb3c0985567a0f86d08337d7cb8bed79a6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Wed, 4 Jan 2017 12:19:31 -0800 Subject: [ios, macos] Insert example code in original headers (#7569) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [ios, macos] Removed extraneous code fences * [ios] Streamlined example delimiters Use test method names as names of example blocks and test method documentation comments as front matter for examples. Set off example blocks using a syntax similar to playground markup syntax. Avoid hard-coding indentation levels. Trigger Xcode build error when an error occurs in the script. * [ios] Removed platform-specific code from examples * [ios] Fixed logic error The comment said 200 while the code said 1,500. * [ios] Formalize build phase input * [ios] Insert examples into original source documentation Rewrote the example code insertion script to work on the original source files and overwrite any existing code examples on the same symbols. The script uses SourceKitten to find the documentation comment for the symbol named by the test method. Replaced the Run Script build phase that runs the example code insertion script with a make rule that runs the same script. Inlined skeleton examples minus the contents of the code blocks. * [ios] Fixed syntax error * [ios] Ran ios-add-examples-to-docs * [ios] Avoid touching unchanged headers * [ios] Refactored example insertion script * [ios] Point jazzy at original sources * [ios] Invoke SourceKitten only once * [ios] Look for methods as well as properties * [ios] Thoroughly search for code blocks in doc comments Refactored the example code insertion script to index test methods by their names, then recursively search the SourceKitten output for documentation comments that contain Swift code blocks, replacing each code block with the associated test method body. * [ios, macos] Enabled example insertion for macOS The example code insertion script is now platform-agnostic. * [ios, macos] Fixed documentation example tests Set the map view’s style to a minimal local JSON file. Wait for the style to finish loading before running each test. Corrected CGVector type. * [ios, macos] Dry run mode The output of this mode isn’t a good indicator of whether any files would’ve needed to be changed, because the presence of a conditional compilation block in one of the test methods means this script would always change and revert the corresponding comment. * [ios] Fixed test failure The iOS implementation of MGLMapView tries to show the Streets style by default even if no access token has been set. Avoid a race condition and frequent test failure by specifying the minimal style on initialization. * [ios, macos] Ensure SourceKitten is installed before inserting example code * [ios, macos] Tear down map view after each test Keep map views from previous tests from hanging around, potentially obscuring the result of a subsequent test. Set the access token to a bogus token upfront for all style layer tests. Unified MGLStyle usage within MGLStyleTests. * [ios, macos] Reinsert examples after generating runtime styling headers --- platform/darwin/src/MGLFillStyleLayer.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'platform/darwin/src/MGLFillStyleLayer.h') diff --git a/platform/darwin/src/MGLFillStyleLayer.h b/platform/darwin/src/MGLFillStyleLayer.h index 2638e85aa5..184f44ef65 100644 --- a/platform/darwin/src/MGLFillStyleLayer.h +++ b/platform/darwin/src/MGLFillStyleLayer.h @@ -37,8 +37,16 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslateAnchor) { otherwise, find it using the `MGLStyle.layers` property. You can also create a new fill style layer and add it to the style using a method such as `-[MGLStyle addLayer:]`. - - + + ### Example + + ```swift + let layer = MGLFillStyleLayer(identifier: "parks", source: parks) + layer.sourceLayerIdentifier = "parks" + layer.fillColor = MGLStyleValue(rawValue: .green) + layer.predicate = NSPredicate(format: "type == %@", "national-park") + mapView.style.addLayer(layer) + ``` */ @interface MGLFillStyleLayer : MGLVectorStyleLayer -- cgit v1.2.1 From d5d6bcee0f2f11cfccb3cc8ee7bc90c4f0ac74e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Tue, 3 Jan 2017 01:42:15 -0800 Subject: [ios, macos] Keep style attribute NSValue categories near enum declarations Eliminated the separate NSValue+MGLStyleLayerAddition files, moving the categories into their respective style layer headers to be closer to the enumeration declarations. --- platform/darwin/src/MGLFillStyleLayer.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'platform/darwin/src/MGLFillStyleLayer.h') diff --git a/platform/darwin/src/MGLFillStyleLayer.h b/platform/darwin/src/MGLFillStyleLayer.h index 184f44ef65..a154b2e297 100644 --- a/platform/darwin/src/MGLFillStyleLayer.h +++ b/platform/darwin/src/MGLFillStyleLayer.h @@ -144,4 +144,27 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslateAnchor) { @end +/** + Methods for wrapping an enumeration value for a style layer attribute in an + `MGLFillStyleLayer` object and unwrapping its raw value. + */ +@interface NSValue (MGLFillStyleLayerAdditions) + +#pragma mark Working with Fill Style Layer Attribute Values + +/** + Creates a new value object containing the given `MGLFillTranslateAnchor` enumeration. + + @param fillTranslateAnchor The value for the new object. + @return A new value object that contains the enumeration value. + */ ++ (instancetype)valueWithMGLFillTranslateAnchor:(MGLFillTranslateAnchor)fillTranslateAnchor; + +/** + The `MGLFillTranslateAnchor` enumeration representation of the value. + */ +@property (readonly) MGLFillTranslateAnchor MGLFillTranslateAnchorValue; + +@end + NS_ASSUME_NONNULL_END -- cgit v1.2.1 From bf8d037fca3a5e76818f2cd546e783814f046019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Fri, 6 Jan 2017 12:29:03 -0800 Subject: =?UTF-8?q?[ios,=20macos]=20-translate=20=E2=86=92=20-translation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platform/darwin/src/MGLFillStyleLayer.h | 38 ++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to 'platform/darwin/src/MGLFillStyleLayer.h') diff --git a/platform/darwin/src/MGLFillStyleLayer.h b/platform/darwin/src/MGLFillStyleLayer.h index a154b2e297..f46998be5b 100644 --- a/platform/darwin/src/MGLFillStyleLayer.h +++ b/platform/darwin/src/MGLFillStyleLayer.h @@ -9,18 +9,18 @@ NS_ASSUME_NONNULL_BEGIN /** Controls the translation reference point. - Values of this type are used in the `MGLFillStyleLayer.fillTranslateAnchor` + Values of this type are used in the `MGLFillStyleLayer.fillTranslationAnchor` property. */ -typedef NS_ENUM(NSUInteger, MGLFillTranslateAnchor) { +typedef NS_ENUM(NSUInteger, MGLFillTranslationAnchor) { /** The fill is translated relative to the map. */ - MGLFillTranslateAnchorMap, + MGLFillTranslationAnchorMap, /** The fill is translated relative to the viewport. */ - MGLFillTranslateAnchorViewport, + MGLFillTranslationAnchorViewport, }; /** @@ -127,20 +127,32 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslateAnchor) { `NSValue` object containing a `CGVector` struct set to 0 points from the left and 0 points from the top. Set this property to `nil` to reset it to the default value. + + This attribute corresponds to the fill-translate + layout property in the Mapbox Style Specification. */ -@property (nonatomic, null_resettable) MGLStyleValue *fillTranslate; +@property (nonatomic, null_resettable) MGLStyleValue *fillTranslation; + +@property (nonatomic, null_resettable) MGLStyleValue *fillTranslate __attribute__((unavailable("Use fillTranslation instead."))); /** Controls the translation reference point. The default value of this property is an `MGLStyleValue` object containing an - `NSValue` object containing `MGLFillTranslateAnchorMap`. Set this property to + `NSValue` object containing `MGLFillTranslationAnchorMap`. Set this property to `nil` to reset it to the default value. - This property is only applied to the style if `fillTranslate` is non-`nil`. + This property is only applied to the style if `fillTranslation` is non-`nil`. Otherwise, it is ignored. + + This attribute corresponds to the fill-translate-anchor + layout property in the Mapbox Style Specification. */ -@property (nonatomic, null_resettable) MGLStyleValue *fillTranslateAnchor; +@property (nonatomic, null_resettable) MGLStyleValue *fillTranslationAnchor; + +@property (nonatomic, null_resettable) MGLStyleValue *fillTranslateAnchor __attribute__((unavailable("Use fillTranslationAnchor instead."))); @end @@ -153,17 +165,17 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslateAnchor) { #pragma mark Working with Fill Style Layer Attribute Values /** - Creates a new value object containing the given `MGLFillTranslateAnchor` enumeration. + Creates a new value object containing the given `MGLFillTranslationAnchor` enumeration. - @param fillTranslateAnchor The value for the new object. + @param fillTranslationAnchor The value for the new object. @return A new value object that contains the enumeration value. */ -+ (instancetype)valueWithMGLFillTranslateAnchor:(MGLFillTranslateAnchor)fillTranslateAnchor; ++ (instancetype)valueWithMGLFillTranslationAnchor:(MGLFillTranslationAnchor)fillTranslationAnchor; /** - The `MGLFillTranslateAnchor` enumeration representation of the value. + The `MGLFillTranslationAnchor` enumeration representation of the value. */ -@property (readonly) MGLFillTranslateAnchor MGLFillTranslateAnchorValue; +@property (readonly) MGLFillTranslationAnchor MGLFillTranslationAnchorValue; @end -- cgit v1.2.1 From d3a2ffe747550216b19d678c40980231baeeef11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Sat, 7 Jan 2017 15:54:08 -0800 Subject: [ios, macos] Fixed links to paint properties in style spec --- platform/darwin/src/MGLFillStyleLayer.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'platform/darwin/src/MGLFillStyleLayer.h') diff --git a/platform/darwin/src/MGLFillStyleLayer.h b/platform/darwin/src/MGLFillStyleLayer.h index f46998be5b..8bdf177a30 100644 --- a/platform/darwin/src/MGLFillStyleLayer.h +++ b/platform/darwin/src/MGLFillStyleLayer.h @@ -60,7 +60,7 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslationAnchor) { the default value. This attribute corresponds to the fill-antialias + href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-fill-antialias">fill-antialias layout property in the Mapbox Style Specification. */ @property (nonatomic, null_resettable, getter=isFillAntialiased) MGLStyleValue *fillAntialiased; @@ -129,7 +129,7 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslationAnchor) { default value. This attribute corresponds to the fill-translate + href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-fill-translate">fill-translate layout property in the Mapbox Style Specification. */ @property (nonatomic, null_resettable) MGLStyleValue *fillTranslation; @@ -147,7 +147,7 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslationAnchor) { Otherwise, it is ignored. This attribute corresponds to the fill-translate-anchor + href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-fill-translate-anchor">fill-translate-anchor layout property in the Mapbox Style Specification. */ @property (nonatomic, null_resettable) MGLStyleValue *fillTranslationAnchor; -- cgit v1.2.1 From e0f98704061f6e1b3b078da468baea37851391b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Sun, 8 Jan 2017 17:10:44 -0800 Subject: [macos] Flip offsets and translations The screen origin is at the lower-left, so offsets and translations increase rightwards and upwards, in contrast to iOS and Web contexts, where the coordinate system increases rightwards and downwards. Duplicated style layer property declarations to reflect this difference. --- platform/darwin/src/MGLFillStyleLayer.h | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'platform/darwin/src/MGLFillStyleLayer.h') diff --git a/platform/darwin/src/MGLFillStyleLayer.h b/platform/darwin/src/MGLFillStyleLayer.h index 8bdf177a30..16e1673a44 100644 --- a/platform/darwin/src/MGLFillStyleLayer.h +++ b/platform/darwin/src/MGLFillStyleLayer.h @@ -118,21 +118,37 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslationAnchor) { */ @property (nonatomic, null_resettable) MGLStyleValue *fillPattern; +#if TARGET_OS_IPHONE /** The geometry's offset. This property is measured in points. The default value of this property is an `MGLStyleValue` object containing an - `NSValue` object containing a `CGVector` struct set to 0 points from the left - and 0 points from the top. Set this property to `nil` to reset it to the - default value. + `NSValue` object containing a `CGVector` struct set to 0 points rightward and 0 + points downward. Set this property to `nil` to reset it to the default value. This attribute corresponds to the fill-translate layout property in the Mapbox Style Specification. */ @property (nonatomic, null_resettable) MGLStyleValue *fillTranslation; +#else +/** + The geometry's offset. + + This property is measured in points. + + The default value of this property is an `MGLStyleValue` object containing an + `NSValue` object containing a `CGVector` struct set to 0 points rightward and 0 + points upward. Set this property to `nil` to reset it to the default value. + + This attribute corresponds to the fill-translate + layout property in the Mapbox Style Specification. + */ +@property (nonatomic, null_resettable) MGLStyleValue *fillTranslation; +#endif @property (nonatomic, null_resettable) MGLStyleValue *fillTranslate __attribute__((unavailable("Use fillTranslation instead."))); -- cgit v1.2.1 From a4c44c51585fe1df8e8b38bf5b7b6a611b4ce986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Sun, 8 Jan 2017 17:30:09 -0800 Subject: [ios, macos] Cleaned up color, edge insets declarations, comments Eliminated references to MGLColor within style layer headers. --- platform/darwin/src/MGLFillStyleLayer.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'platform/darwin/src/MGLFillStyleLayer.h') diff --git a/platform/darwin/src/MGLFillStyleLayer.h b/platform/darwin/src/MGLFillStyleLayer.h index 16e1673a44..6fae42cefe 100644 --- a/platform/darwin/src/MGLFillStyleLayer.h +++ b/platform/darwin/src/MGLFillStyleLayer.h @@ -78,7 +78,7 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslationAnchor) { This property is only applied to the style if `fillPattern` is set to `nil`. Otherwise, it is ignored. */ -@property (nonatomic, null_resettable) MGLStyleValue *fillColor; +@property (nonatomic, null_resettable) MGLStyleValue *fillColor; #else /** The color of the filled part of this layer. @@ -90,7 +90,7 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslationAnchor) { This property is only applied to the style if `fillPattern` is set to `nil`. Otherwise, it is ignored. */ -@property (nonatomic, null_resettable) MGLStyleValue *fillColor; +@property (nonatomic, null_resettable) MGLStyleValue *fillColor; #endif /** @@ -103,6 +103,16 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslationAnchor) { */ @property (nonatomic, null_resettable) MGLStyleValue *fillOpacity; +#if TARGET_OS_IPHONE +/** + The outline color of the fill. Matches the value of `fillColor` if unspecified. + + This property is only applied to the style if `fillPattern` is set to `nil`, + and `fillAntialiased` is set to an `MGLStyleValue` object containing an + `NSNumber` object containing `YES`. Otherwise, it is ignored. + */ +@property (nonatomic, null_resettable) MGLStyleValue *fillOutlineColor; +#else /** The outline color of the fill. Matches the value of `fillColor` if unspecified. @@ -110,7 +120,8 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslationAnchor) { and `fillAntialiased` is set to an `MGLStyleValue` object containing an `NSNumber` object containing `YES`. Otherwise, it is ignored. */ -@property (nonatomic, null_resettable) MGLStyleValue *fillOutlineColor; +@property (nonatomic, null_resettable) MGLStyleValue *fillOutlineColor; +#endif /** Name of image in sprite to use for drawing image fills. For seamless patterns, -- cgit v1.2.1 From 424c12499cab69b935779d306d7d47d19139116e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Wed, 11 Jan 2017 08:06:20 -0800 Subject: [ios, macos] Make MGLMapView.style property nullable (#7664) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [ios, macos] Made MGLMapView.style property nullable MGLMapView’s style property is now nullable (optional in Swift). The property is set to nil while the style loads and in the event that the style has failed to load. * [ios, macos] Switch to delegate method * [macos] Create MGLMapView programmatically for layer tests When MGLMapView is created via a nib, -initWithCoder: is called, causing styleURL to be set to nil, in turn causing the default Streets style to be loaded, fooling MGLStyleLayerTests into thinking one-line has been loaded. Instead, create MGLMapView programmatically, passing the intended style URL into the initializer, preventing Streets from being loaded. --- platform/darwin/src/MGLFillStyleLayer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform/darwin/src/MGLFillStyleLayer.h') diff --git a/platform/darwin/src/MGLFillStyleLayer.h b/platform/darwin/src/MGLFillStyleLayer.h index 6fae42cefe..d05b21eb51 100644 --- a/platform/darwin/src/MGLFillStyleLayer.h +++ b/platform/darwin/src/MGLFillStyleLayer.h @@ -45,7 +45,7 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslationAnchor) { layer.sourceLayerIdentifier = "parks" layer.fillColor = MGLStyleValue(rawValue: .green) layer.predicate = NSPredicate(format: "type == %@", "national-park") - mapView.style.addLayer(layer) + mapView.style?.addLayer(layer) ``` */ @interface MGLFillStyleLayer : MGLVectorStyleLayer -- cgit v1.2.1