summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-08-18 03:27:38 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-08-19 14:20:27 -0700
commit14aeb107f3599d30acc56b223920d96cccf40610 (patch)
treebc002936fb446325e039778892106c6c9bd8c783
parent938540b9192b55f2cc524db83fe7ff96504ac699 (diff)
downloadqtlocation-mapboxgl-14aeb107f3599d30acc56b223920d96cccf40610.tar.gz
[ios, macos] Document style attribute interdependencies
-rw-r--r--platform/darwin/scripts/generate-style-code.js37
-rw-r--r--platform/darwin/src/MGLBackgroundStyleLayer.h6
-rw-r--r--platform/darwin/src/MGLCircleStyleLayer.h16
-rw-r--r--platform/darwin/src/MGLFillStyleLayer.h16
-rw-r--r--platform/darwin/src/MGLLineStyleLayer.h34
-rw-r--r--platform/darwin/src/MGLRasterStyleLayer.h14
-rw-r--r--platform/darwin/src/MGLStyleLayer.h.ejs14
-rw-r--r--platform/darwin/src/MGLSymbolStyleLayer.h180
8 files changed, 225 insertions, 92 deletions
diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js
index a99a0182a9..963900567d 100644
--- a/platform/darwin/scripts/generate-style-code.js
+++ b/platform/darwin/scripts/generate-style-code.js
@@ -109,6 +109,19 @@ global.propertyDoc = function (property, layerType) {
return doc.replace(/(p)ixel/gi, '$1oint').replace(/(\d)px\b/g, '$1pt');
};
+global.propertyReqs = function (property, layoutPropertiesByName, type) {
+ return 'This property is only applied to the style if ' + property.requires.map(function (req) {
+ if (typeof req === 'string') {
+ return '`' + camelizeWithLeadingLowercase(req) + '` is non-`nil`';
+ } else if ('!' in req) {
+ return '`' + camelizeWithLeadingLowercase(req['!']) + '` is set to `nil`';
+ } else {
+ let name = Object.keys(req)[0];
+ return '`' + camelizeWithLeadingLowercase(name) + '` is set to ' + describeValue(req[Object.keys(req)[0]], layoutPropertiesByName[name], type);
+ }
+ }).join(', and ') + '. Otherwise, it is ignored.';
+};
+
global.parseColor = function (str) {
let m = str.match(/^#(\d\d)(\d\d)(\d\d)$/);
if (m) {
@@ -131,18 +144,18 @@ global.parseColor = function (str) {
}
};
-global.propertyDefault = function (property, layerType) {
+global.describeValue = function (value, property, layerType) {
switch (property.type) {
case 'boolean':
- return property.default ? '`YES`' : '`NO`';
+ return value ? '`YES`' : '`NO`';
case 'number':
case 'string':
- return '`' + property.default + '`';
+ return '`' + value + '`';
case 'enum':
let objCType = `${prefix}${camelize(layerType)}${suffix}${camelize(property.name)}`;
- return '`' + `${objCType}${camelize(property.default)}` + '`';
+ return '`' + `${objCType}${camelize(value)}` + '`';
case 'color':
- let color = parseColor(property.default);
+ let color = parseColor(value);
if (!color) {
throw new Error(`unrecognized color format in default value of ${property.name}`);
}
@@ -153,20 +166,24 @@ global.propertyDefault = function (property, layerType) {
units = ` ${units}`.replace(/pixel/, 'point');
}
if (property.name.indexOf('padding') !== -1) {
- //if (property.default.reduce((a, b) => a + b, 0) === 0) {
+ //if (value.reduce((a, b) => a + b, 0) === 0) {
// return '`NSEdgeInsetsZero` or `UIEdgeInsetsZero`';
//}
- return `${property.default[0]}${units} on the top, ${property.default[1]}${units} on the right, ${property.default[2]}${units} on the bottom, and ${property.default[3]}${units} on the left`;
+ return `${value[0]}${units} on the top, ${value[1]}${units} on the right, ${value[2]}${units} on the bottom, and ${value[3]}${units} on the left`;
}
if (property.name.indexOf('offset') !== -1 || property.name.indexOf('translate') !== -1) {
- return `${property.default[0]}${units} from the left and ${property.default[1]}${units} from the top`;
+ return `${value[0]}${units} from the left and ${value[1]}${units} from the top`;
}
- return '`' + property.default.join('`, `') + '`';
+ return '`' + value.join('`, `') + '`';
default:
throw new Error(`unknown type for ${property.name}`);
}
};
+global.propertyDefault = function (property, layerType) {
+ return describeValue(property.default, property, layerType);
+};
+
global.propertyType = function (property, _private) {
return _private ? `id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>` : `id <MGLStyleAttributeValue>`;
};
@@ -290,6 +307,8 @@ const layers = spec.layer.type.values.map((type) => {
type: type,
layoutProperties: layoutProperties,
paintProperties: paintProperties,
+ layoutPropertiesByName: spec[`layout_${type}`],
+ paintPropertiesByName: spec[`paint_${type}`],
};
});
diff --git a/platform/darwin/src/MGLBackgroundStyleLayer.h b/platform/darwin/src/MGLBackgroundStyleLayer.h
index ecf4f995e9..544354d978 100644
--- a/platform/darwin/src/MGLBackgroundStyleLayer.h
+++ b/platform/darwin/src/MGLBackgroundStyleLayer.h
@@ -12,8 +12,10 @@ NS_ASSUME_NONNULL_BEGIN
/**
The color with which the background will be drawn.
-
+
The default value of this property is an `NSColor` or `UIColor`object whose RGB value is 0, 0, 0 and whose alpha value is 1. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `backgroundPattern` is set to `nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> backgroundColor;
@@ -24,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
The opacity at which the background will be drawn.
-
+
The default value of this property is `1`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> backgroundOpacity;
diff --git a/platform/darwin/src/MGLCircleStyleLayer.h b/platform/darwin/src/MGLCircleStyleLayer.h
index a7391c43dc..af3ab3da6d 100644
--- a/platform/darwin/src/MGLCircleStyleLayer.h
+++ b/platform/darwin/src/MGLCircleStyleLayer.h
@@ -24,28 +24,28 @@ typedef NS_ENUM(NSUInteger, MGLCircleStyleLayerCirclePitchScale) {
Circle radius.
This property is measured in points.
-
+
The default value of this property is `5`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> circleRadius;
/**
The color of the circle.
-
+
The default value of this property is an `NSColor` or `UIColor`object whose RGB value is 0, 0, 0 and whose alpha value is 1. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> circleColor;
/**
Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.
-
+
The default value of this property is `0`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> circleBlur;
/**
The opacity at which the circle will be drawn.
-
+
The default value of this property is `1`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> circleOpacity;
@@ -54,21 +54,23 @@ typedef NS_ENUM(NSUInteger, MGLCircleStyleLayerCirclePitchScale) {
The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
This property is measured in points.
-
+
The default value of this property is 0 points from the left and 0 points from the top. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> circleTranslate;
/**
Control whether the translation is relative to the map (north) or viewport (screen)
-
+
The default value of this property is `MGLCircleStyleLayerCircleTranslateAnchorMap`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `circleTranslate` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> circleTranslateAnchor;
/**
Controls the scaling behavior of the circle when the map is pitched. The value `MGLCircleStyleLayerCirclePitchScaleMap` scales circles according to their apparent distance to the camera. The value `MGLCircleStyleLayerCirclePitchScaleViewport` results in no pitch-related scaling.
-
+
The default value of this property is `MGLCircleStyleLayerCirclePitchScaleMap`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> circlePitchScale;
diff --git a/platform/darwin/src/MGLFillStyleLayer.h b/platform/darwin/src/MGLFillStyleLayer.h
index f5030a9dc6..26a438af30 100644
--- a/platform/darwin/src/MGLFillStyleLayer.h
+++ b/platform/darwin/src/MGLFillStyleLayer.h
@@ -17,27 +17,31 @@ typedef NS_ENUM(NSUInteger, MGLFillStyleLayerFillTranslateAnchor) {
/**
Whether or not the fill should be antialiased.
-
+
The default value of this property is `YES`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> fillAntialias;
/**
The opacity of the entire fill layer. In contrast to the fill-color, this value will also affect the 1pt stroke around the fill, if the stroke is used.
-
+
The default value of this property is `1`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> fillOpacity;
/**
The color of the filled part of this layer. This color can be specified as rgba with an alpha component and the color's opacity will not affect the opacity of the 1pt stroke, if it is used.
-
+
The default value of this property is an `NSColor` or `UIColor`object whose RGB value is 0, 0, 0 and whose alpha value is 1. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `fillPattern` is set to `nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> fillColor;
/**
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 `fillAntialias` is set to `YES`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> fillOutlineColor;
@@ -45,15 +49,17 @@ typedef NS_ENUM(NSUInteger, MGLFillStyleLayerFillTranslateAnchor) {
The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
This property is measured in points.
-
+
The default value of this property is 0 points from the left and 0 points from the top. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> fillTranslate;
/**
Control whether the translation is relative to the map (north) or viewport (screen)
-
+
The default value of this property is `MGLFillStyleLayerFillTranslateAnchorMap`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `fillTranslate` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> fillTranslateAnchor;
diff --git a/platform/darwin/src/MGLLineStyleLayer.h b/platform/darwin/src/MGLLineStyleLayer.h
index 226df74760..6a8900b99c 100644
--- a/platform/darwin/src/MGLLineStyleLayer.h
+++ b/platform/darwin/src/MGLLineStyleLayer.h
@@ -29,29 +29,33 @@ typedef NS_ENUM(NSUInteger, MGLLineStyleLayerLineTranslateAnchor) {
/**
The display of line endings.
-
+
The default value of this property is `MGLLineStyleLayerLineCapButt`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineCap;
/**
The display of lines when joining.
-
+
The default value of this property is `MGLLineStyleLayerLineJoinMiter`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineJoin;
/**
Used to automatically convert miter joins to bevel joins for sharp angles.
-
+
The default value of this property is `2`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `lineJoin` is set to `MGLLineStyleLayerLineJoinMiter`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineMiterLimit;
/**
Used to automatically convert round joins to miter joins for shallow angles.
-
+
The default value of this property is `1.05`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `lineJoin` is set to `MGLLineStyleLayerLineJoinRound`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineRoundLimit;
@@ -59,15 +63,17 @@ typedef NS_ENUM(NSUInteger, MGLLineStyleLayerLineTranslateAnchor) {
/**
The opacity at which the line will be drawn.
-
+
The default value of this property is `1`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineOpacity;
/**
The color with which the line will be drawn.
-
+
The default value of this property is an `NSColor` or `UIColor`object whose RGB value is 0, 0, 0 and whose alpha value is 1. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `linePattern` is set to `nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineColor;
@@ -75,15 +81,17 @@ typedef NS_ENUM(NSUInteger, MGLLineStyleLayerLineTranslateAnchor) {
The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.
This property is measured in points.
-
+
The default value of this property is 0 points from the left and 0 points from the top. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineTranslate;
/**
Control whether the translation is relative to the map (north) or viewport (screen)
-
+
The default value of this property is `MGLLineStyleLayerLineTranslateAnchorMap`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `lineTranslate` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineTranslateAnchor;
@@ -91,7 +99,7 @@ typedef NS_ENUM(NSUInteger, MGLLineStyleLayerLineTranslateAnchor) {
Stroke thickness.
This property is measured in points.
-
+
The default value of this property is `1`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineWidth;
@@ -100,7 +108,7 @@ typedef NS_ENUM(NSUInteger, MGLLineStyleLayerLineTranslateAnchor) {
Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.
This property is measured in points.
-
+
The default value of this property is `0`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineGapWidth;
@@ -109,7 +117,7 @@ typedef NS_ENUM(NSUInteger, MGLLineStyleLayerLineTranslateAnchor) {
The line's offset perpendicular to its direction. Values may be positive or negative, where positive indicates "rightwards" (if you were moving in the direction of the line) and negative indicates "leftwards."
This property is measured in points.
-
+
The default value of this property is `0`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineOffset;
@@ -118,7 +126,7 @@ typedef NS_ENUM(NSUInteger, MGLLineStyleLayerLineTranslateAnchor) {
Blur applied to the line, in points.
This property is measured in points.
-
+
The default value of this property is `0`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineBlur;
@@ -127,6 +135,8 @@ typedef NS_ENUM(NSUInteger, MGLLineStyleLayerLineTranslateAnchor) {
Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to points, multiply the length by the current line width.
This property is measured in line widths.
+
+ This property is only applied to the style if `linePattern` is set to `nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> lineDasharray;
diff --git a/platform/darwin/src/MGLRasterStyleLayer.h b/platform/darwin/src/MGLRasterStyleLayer.h
index 082bd37b10..ef72ae3f0f 100644
--- a/platform/darwin/src/MGLRasterStyleLayer.h
+++ b/platform/darwin/src/MGLRasterStyleLayer.h
@@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
The opacity at which the image will be drawn.
-
+
The default value of this property is `1`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> rasterOpacity;
@@ -21,35 +21,35 @@ NS_ASSUME_NONNULL_BEGIN
Rotates hues around the color wheel.
This property is measured in degrees.
-
+
The default value of this property is `0`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> rasterHueRotate;
/**
Increase or reduce the brightness of the image. The value is the minimum brightness.
-
+
The default value of this property is `0`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> rasterBrightnessMin;
/**
Increase or reduce the brightness of the image. The value is the maximum brightness.
-
+
The default value of this property is `1`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> rasterBrightnessMax;
/**
Increase or reduce the saturation of the image.
-
+
The default value of this property is `0`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> rasterSaturation;
/**
Increase or reduce the contrast of the image.
-
+
The default value of this property is `0`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> rasterContrast;
@@ -58,7 +58,7 @@ NS_ASSUME_NONNULL_BEGIN
Fade duration when a new tile is added.
This property is measured in milliseconds.
-
+
The default value of this property is `300`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> rasterFadeDuration;
diff --git a/platform/darwin/src/MGLStyleLayer.h.ejs b/platform/darwin/src/MGLStyleLayer.h.ejs
index b31510aee7..700127f311 100644
--- a/platform/darwin/src/MGLStyleLayer.h.ejs
+++ b/platform/darwin/src/MGLStyleLayer.h.ejs
@@ -2,6 +2,8 @@
const type = locals.type;
const layoutProperties = locals.layoutProperties;
const paintProperties = locals.paintProperties;
+ const layoutPropertiesByName = locals.layoutPropertiesByName;
+ const paintPropertiesByName = locals.paintPropertiesByName;
-%>
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
@@ -39,8 +41,10 @@ typedef NS_ENUM(NSUInteger, MGL<%- camelize(type) %>StyleLayer<%- camelize(prope
<% for (const property of layoutProperties) { -%>
/**
<%- propertyDoc(property, type) %><% if ('default' in property) { %>
-
- The default value of this property is <%= propertyDefault(property, type) %>.<% if (!property.required) { %> Set this property to `nil` to reset it to the default.<% } %><% } %>
+
+ The default value of this property is <%= propertyDefault(property, type) %>.<% if (!property.required) { %> Set this property to `nil` to reset it to the default.<% } %><% } %><% if (property.requires) { %>
+
+ <%= propertyReqs(property, layoutPropertiesByName, type) %><% } %>
*/
@property (nonatomic<% if (!property.required) { %>, null_resettable<% } %>) <%- propertyType(property, false, type) %> <%- camelizeWithLeadingLowercase(property.name) %>;
@@ -51,8 +55,10 @@ typedef NS_ENUM(NSUInteger, MGL<%- camelize(type) %>StyleLayer<%- camelize(prope
<% for (const property of paintProperties) { -%>
/**
<%- propertyDoc(property, type) %><% if ('default' in property) { %>
-
- The default value of this property is <%= propertyDefault(property, type) %>.<% if (!property.required) { %> Set this property to `nil` to reset it to the default.<% } %><% } %>
+
+ The default value of this property is <%= propertyDefault(property, type) %>.<% if (!property.required) { %> Set this property to `nil` to reset it to the default.<% } %><% } %><% if (property.requires) { %>
+
+ <%= propertyReqs(property, paintPropertiesByName, type) %><% } %>
*/
@property (nonatomic<% if (!property.required) { %>, null_resettable<% } %>) <%- propertyType(property, false, type) %> <%- camelizeWithLeadingLowercase(property.name) %>;
diff --git a/platform/darwin/src/MGLSymbolStyleLayer.h b/platform/darwin/src/MGLSymbolStyleLayer.h
index d92ad55967..65bab34b96 100644
--- a/platform/darwin/src/MGLSymbolStyleLayer.h
+++ b/platform/darwin/src/MGLSymbolStyleLayer.h
@@ -73,7 +73,7 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
/**
Label placement relative to its geometry. `MGLSymbolStyleLayerSymbolPlacementLine` can only be used on LineStrings and Polygons.
-
+
The default value of this property is `MGLSymbolStyleLayerSymbolPlacementPoint`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> symbolPlacement;
@@ -82,57 +82,71 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
Distance between two symbol anchors.
This property is measured in points.
-
+
The default value of this property is `250`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `symbolPlacement` is set to `MGLSymbolStyleLayerSymbolPlacementLine`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> symbolSpacing;
/**
If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer.
-
+
The default value of this property is `NO`. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> symbolAvoidEdges;
/**
If true, the icon will be visible even if it collides with other previously drawn symbols.
-
+
The default value of this property is `NO`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconAllowOverlap;
/**
If true, other symbols can be visible even if they collide with the icon.
-
+
The default value of this property is `NO`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconIgnorePlacement;
/**
If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.
-
+
The default value of this property is `NO`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `iconImage` is non-`nil`, and `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconOptional;
/**
Orientation of icon when map is rotated.
-
+
The default value of this property is `MGLSymbolStyleLayerIconRotationAlignmentViewport`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconRotationAlignment;
/**
Scale factor for icon. 1 is original size, 3 triples the size.
-
+
The default value of this property is `1`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconSize;
/**
Position and scale an icon by the its corresponding text.
-
+
The default value of this property is `MGLSymbolStyleLayerIconTextFitNone`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `iconImage` is non-`nil`, and `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconTextFit;
@@ -140,8 +154,10 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
Size of padding area around the text-fit size in clockwise order: top, right, bottom, left.
This property is measured in points.
-
+
The default value of this property is 0 points on the top, 0 points on the right, 0 points on the bottom, and 0 points on the left. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `iconImage` is non-`nil`, and `iconTextFit` is non-`nil`, and `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconTextFitPadding;
@@ -154,8 +170,10 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
Rotates the icon clockwise.
This property is measured in degrees.
-
+
The default value of this property is `0`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconRotate;
@@ -163,48 +181,60 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
Size of the additional area around the icon bounding box used for detecting symbol collisions.
This property is measured in points.
-
+
The default value of this property is `2`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconPadding;
/**
If true, the icon may be flipped to prevent it from being rendered upside-down.
-
+
The default value of this property is `NO`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `iconImage` is non-`nil`, and `iconRotationAlignment` is set to `MGLSymbolStyleLayerIconRotationAlignmentMap`, and `symbolPlacement` is set to `MGLSymbolStyleLayerSymbolPlacementLine`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconKeepUpright;
/**
Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up.
-
+
The default value of this property is 0 from the left and 0 from the top. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconOffset;
/**
Aligns text to the plane of the `MGLSymbolStyleLayerTextPitchAlignmentViewport` or the `MGLSymbolStyleLayerTextPitchAlignmentMap` when the map is pitched. Matches `textRotationAlignment` if unspecified.
+
+ This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textPitchAlignment;
/**
Orientation of text when map is rotated.
-
+
The default value of this property is `MGLSymbolStyleLayerTextRotationAlignmentViewport`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textRotationAlignment;
/**
Value to use for a text label. Feature properties are specified using tokens like {field_name}.
-
+
The default value of this property is ``. Set this property to `nil` to reset it to the default.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textField;
/**
Font stack to use for displaying text.
-
+
The default value of this property is `Open Sans Regular`, `Arial Unicode MS Regular`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textFont;
@@ -212,8 +242,10 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
Font size.
This property is measured in points.
-
+
The default value of this property is `16`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textSize;
@@ -221,8 +253,10 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
The maximum line width for text wrapping.
This property is measured in ems.
-
+
The default value of this property is `10`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textMaxWidth;
@@ -230,8 +264,10 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
Text leading value for multi-line text.
This property is measured in ems.
-
+
The default value of this property is `1.2`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textLineHeight;
@@ -239,22 +275,28 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
Text tracking amount.
This property is measured in ems.
-
+
The default value of this property is `0`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textLetterSpacing;
/**
Text justification options.
-
+
The default value of this property is `MGLSymbolStyleLayerTextJustifyCenter`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textJustify;
/**
Part of the text placed closest to the anchor.
-
+
The default value of this property is `MGLSymbolStyleLayerTextAnchorCenter`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textAnchor;
@@ -262,8 +304,10 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
Maximum angle change between adjacent characters.
This property is measured in degrees.
-
+
The default value of this property is `45`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`, and `symbolPlacement` is set to `MGLSymbolStyleLayerSymbolPlacementLine`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textMaxAngle;
@@ -271,8 +315,10 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
Rotates the text clockwise.
This property is measured in degrees.
-
+
The default value of this property is `0`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textRotate;
@@ -280,22 +326,28 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
Size of the additional area around the text bounding box used for detecting symbol collisions.
This property is measured in points.
-
+
The default value of this property is `2`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textPadding;
/**
If true, the text may be flipped vertically to prevent it from being rendered upside-down.
-
+
The default value of this property is `YES`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`, and `textRotationAlignment` is set to `MGLSymbolStyleLayerTextRotationAlignmentMap`, and `symbolPlacement` is set to `MGLSymbolStyleLayerSymbolPlacementLine`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textKeepUpright;
/**
Specifies how to capitalize text, similar to the CSS `text-transform` property.
-
+
The default value of this property is `MGLSymbolStyleLayerTextTransformNone`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textTransform;
@@ -303,29 +355,37 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up.
This property is measured in ems.
-
+
The default value of this property is 0 ems from the left and 0 ems from the top. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textOffset;
/**
If true, the text will be visible even if it collides with other previously drawn symbols.
-
+
The default value of this property is `NO`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textAllowOverlap;
/**
If true, other symbols can be visible even if they collide with the text.
-
+
The default value of this property is `NO`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textIgnorePlacement;
/**
If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.
-
+
The default value of this property is `NO`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`, and `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textOptional;
@@ -333,22 +393,28 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
/**
The opacity at which the icon will be drawn.
-
+
The default value of this property is `1`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconOpacity;
/**
The color of the icon. This can only be used with sdf icons.
-
+
The default value of this property is an `NSColor` or `UIColor`object whose RGB value is 0, 0, 0 and whose alpha value is 1. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconColor;
/**
The color of the icon's halo. Icon halos can only be used with sdf icons.
-
+
The default value of this property is an `NSColor` or `UIColor`object whose RGB value is 0, 0, 0 and whose alpha value is 0. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconHaloColor;
@@ -356,8 +422,10 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
Distance of halo to the icon outline.
This property is measured in points.
-
+
The default value of this property is `0`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconHaloWidth;
@@ -365,8 +433,10 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
Fade out the halo towards the outside.
This property is measured in points.
-
+
The default value of this property is `0`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconHaloBlur;
@@ -374,36 +444,46 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
This property is measured in points.
-
+
The default value of this property is 0 points from the left and 0 points from the top. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `iconImage` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconTranslate;
/**
Control whether the translation is relative to the map (north) or viewport (screen).
-
+
The default value of this property is `MGLSymbolStyleLayerIconTranslateAnchorMap`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `iconImage` is non-`nil`, and `iconTranslate` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> iconTranslateAnchor;
/**
The opacity at which the text will be drawn.
-
+
The default value of this property is `1`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textOpacity;
/**
The color with which the text will be drawn.
-
+
The default value of this property is an `NSColor` or `UIColor`object whose RGB value is 0, 0, 0 and whose alpha value is 1. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textColor;
/**
The color of the text's halo, which helps it stand out from backgrounds.
-
+
The default value of this property is an `NSColor` or `UIColor`object whose RGB value is 0, 0, 0 and whose alpha value is 0. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textHaloColor;
@@ -411,8 +491,10 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.
This property is measured in points.
-
+
The default value of this property is `0`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textHaloWidth;
@@ -420,8 +502,10 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
The halo's fadeout distance towards the outside.
This property is measured in points.
-
+
The default value of this property is `0`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textHaloBlur;
@@ -429,15 +513,19 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
This property is measured in points.
-
+
The default value of this property is 0 points from the left and 0 points from the top. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textTranslate;
/**
Control whether the translation is relative to the map (north) or viewport (screen).
-
+
The default value of this property is `MGLSymbolStyleLayerTextTranslateAnchorMap`. Set this property to `nil` to reset it to the default.
+
+ This property is only applied to the style if `textField` is non-`nil`, and `textTranslate` is non-`nil`. Otherwise, it is ignored.
*/
@property (nonatomic, null_resettable) id <MGLStyleAttributeValue> textTranslateAnchor;