From ee9c4c3b48be6e0d3d763c5d4e7458796a62f56d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Wed, 24 Jan 2018 00:28:06 -0800 Subject: [PATCH 1/2] [ios, macos] Documented ranges of style properties --- .../darwin/scripts/generate-style-code.js | 26 +++++++-- platform/darwin/src/MGLBackgroundStyleLayer.h | 4 +- platform/darwin/src/MGLCircleStyleLayer.h | 18 +++--- .../darwin/src/MGLFillExtrusionStyleLayer.h | 12 ++-- platform/darwin/src/MGLFillStyleLayer.h | 4 +- platform/darwin/src/MGLHillshadeStyleLayer.h | 8 +-- platform/darwin/src/MGLLight.h | 4 +- platform/darwin/src/MGLLineStyleLayer.h | 24 ++++---- platform/darwin/src/MGLRasterStyleLayer.h | 26 ++++----- platform/darwin/src/MGLSymbolStyleLayer.h | 58 +++++++++---------- 10 files changed, 99 insertions(+), 85 deletions(-) diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js index a7804ac948c..f919a649cbb 100755 --- a/platform/darwin/scripts/generate-style-code.js +++ b/platform/darwin/scripts/generate-style-code.js @@ -300,7 +300,17 @@ global.propertyDoc = function (propertyName, property, layerType, kind) { doc += `\n\nThis attribute corresponds to the ${property.original} layout property in the Mapbox Style Specification.`; } doc += '\n\nYou can set this property to an expression containing any of the following:\n\n'; - doc += `* Constant ${describeType(property)} values\n`; + doc += `* Constant ${describeType(property)} values`; + if ('minimum' in property) { + if ('maximum' in property) { + doc += ` between ${formatNumber(property.minimum)} and ${formatNumber(property.maximum)} inclusive`; + } else { + doc += ` no less than ${formatNumber(property.minimum)}`; + } + } else if ('maximum' in property) { + doc += ` no greater than ${formatNumber(property.maximum)}`; + } + doc += '\n'; if (property.type === 'enum') { doc += '* Any of the following constant string values:\n'; doc += Object.keys(property.values).map(value => ' * `' + value + '`: ' + property.values[value].doc).join('\n') + '\n'; @@ -392,7 +402,7 @@ global.describeValue = function (value, property, layerType) { case 'boolean': return value ? '`YES`' : '`NO`'; case 'number': - return 'the float `' + value + '`'; + return 'the float ' + formatNumber(value); case 'string': if (value === '') { return 'the empty string'; @@ -427,7 +437,7 @@ global.describeValue = function (value, property, layerType) { if (color.r === 1 && color.g === 1 && color.b === 1 && color.a === 1) { return '`UIColor.whiteColor`'; } - return 'a `UIColor`' + ` object whose RGB value is ${color.r}, ${color.g}, ${color.b} and whose alpha value is ${color.a}`; + return 'a `UIColor`' + ` object whose RGB value is ${formatNumber(color.r)}, ${formatNumber(color.g)}, ${formatNumber(color.b)} and whose alpha value is ${formatNumber(color.a)}`; case 'array': let units = property.units || ''; if (units) { @@ -438,12 +448,12 @@ global.describeValue = function (value, property, layerType) { if (value[0] === 0 && value[1] === 0 && value[2] === 0 && value[3] === 0) { return 'an `NSValue` object containing `UIEdgeInsetsZero`'; } - return 'an `NSValue` object containing a `UIEdgeInsets` struct set to' + ` ${value[0]}${units} on the top, ${value[3]}${units} on the left, ${value[2]}${units} on the bottom, and ${value[1]}${units} on the right`; + return 'an `NSValue` object containing a `UIEdgeInsets` struct set to' + ` ${formatNumber(value[0])}${units} on the top, ${formatNumber(value[3])}${units} on the left, ${formatNumber(value[2])}${units} on the bottom, and ${formatNumber(value[1])}${units} on the right`; case 'offset': case 'translate': - return 'an `NSValue` object containing a `CGVector` struct set to' + ` ${value[0]}${units} rightward and ${value[1]}${units} downward`; + return 'an `NSValue` object containing a `CGVector` struct set to' + ` ${formatNumber(value[0])}${units} rightward and ${formatNumber(value[1])}${units} downward`; case 'position': - return 'an `MGLSphericalPosition` struct set to' + ` ${value[0]} radial, ${value[1]} azimuthal and ${value[2]} polar`; + return 'an `MGLSphericalPosition` struct set to' + ` ${formatNumber(value[0])} radial, ${formatNumber(value[1])} azimuthal and ${formatNumber(value[2])} polar`; default: return 'the array `' + value.join('`, `') + '`'; } @@ -452,6 +462,10 @@ global.describeValue = function (value, property, layerType) { } }; +global.formatNumber = function (num) { + return num.toLocaleString().replace('-', '\u2212'); +} + global.propertyDefault = function (property, layerType) { if (property.name === 'heatmap-color') { return 'an expression that evaluates to a rainbow color scale from blue to red'; diff --git a/platform/darwin/src/MGLBackgroundStyleLayer.h b/platform/darwin/src/MGLBackgroundStyleLayer.h index 9d2673c859c..4bb8a36e04f 100644 --- a/platform/darwin/src/MGLBackgroundStyleLayer.h +++ b/platform/darwin/src/MGLBackgroundStyleLayer.h @@ -71,11 +71,11 @@ which it is added. The opacity at which the background will be drawn. The default value of this property is an expression that evaluates to the float - `1`. Set this property to `nil` to reset it to the default value. + 1. Set this property to `nil` to reset it to the default value. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values between 0 and 1 inclusive * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables diff --git a/platform/darwin/src/MGLCircleStyleLayer.h b/platform/darwin/src/MGLCircleStyleLayer.h index caa6d2f6cb8..2523637179a 100644 --- a/platform/darwin/src/MGLCircleStyleLayer.h +++ b/platform/darwin/src/MGLCircleStyleLayer.h @@ -116,7 +116,7 @@ MGL_EXPORT full opacity. The default value of this property is an expression that evaluates to the float - `0`. Set this property to `nil` to reset it to the default value. + 0. Set this property to `nil` to reset it to the default value. You can set this property to an expression containing any of the following: @@ -165,11 +165,11 @@ MGL_EXPORT The opacity at which the circle will be drawn. The default value of this property is an expression that evaluates to the float - `1`. Set this property to `nil` to reset it to the default value. + 1. Set this property to `nil` to reset it to the default value. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values between 0 and 1 inclusive * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -214,11 +214,11 @@ MGL_EXPORT This property is measured in points. The default value of this property is an expression that evaluates to the float - `5`. Set this property to `nil` to reset it to the default value. + 5. Set this property to `nil` to reset it to the default value. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values no less than 0 * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -293,11 +293,11 @@ MGL_EXPORT The opacity of the circle's stroke. The default value of this property is an expression that evaluates to the float - `1`. Set this property to `nil` to reset it to the default value. + 1. Set this property to `nil` to reset it to the default value. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values between 0 and 1 inclusive * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -320,11 +320,11 @@ MGL_EXPORT This property is measured in points. The default value of this property is an expression that evaluates to the float - `0`. Set this property to `nil` to reset it to the default value. + 0. Set this property to `nil` to reset it to the default value. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values no less than 0 * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables diff --git a/platform/darwin/src/MGLFillExtrusionStyleLayer.h b/platform/darwin/src/MGLFillExtrusionStyleLayer.h index d1d5af6ba27..2eb3174675a 100644 --- a/platform/darwin/src/MGLFillExtrusionStyleLayer.h +++ b/platform/darwin/src/MGLFillExtrusionStyleLayer.h @@ -77,14 +77,14 @@ MGL_EXPORT This property is measured in meters. The default value of this property is an expression that evaluates to the float - `0`. Set this property to `nil` to reset it to the default value. + 0. Set this property to `nil` to reset it to the default value. This property is only applied to the style if `fillExtrusionHeight` is non-`nil`. Otherwise, it is ignored. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values no less than 0 * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -137,11 +137,11 @@ MGL_EXPORT This property is measured in meters. The default value of this property is an expression that evaluates to the float - `0`. Set this property to `nil` to reset it to the default value. + 0. Set this property to `nil` to reset it to the default value. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values no less than 0 * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -162,11 +162,11 @@ MGL_EXPORT per-layer, not per-feature, basis, and data-driven styling is not available. The default value of this property is an expression that evaluates to the float - `1`. Set this property to `nil` to reset it to the default value. + 1. Set this property to `nil` to reset it to the default value. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values between 0 and 1 inclusive * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables diff --git a/platform/darwin/src/MGLFillStyleLayer.h b/platform/darwin/src/MGLFillStyleLayer.h index 5caab91b455..421813bbcaf 100644 --- a/platform/darwin/src/MGLFillStyleLayer.h +++ b/platform/darwin/src/MGLFillStyleLayer.h @@ -127,11 +127,11 @@ MGL_EXPORT value will also affect the 1pt stroke around the fill, if the stroke is used. The default value of this property is an expression that evaluates to the float - `1`. Set this property to `nil` to reset it to the default value. + 1. Set this property to `nil` to reset it to the default value. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values between 0 and 1 inclusive * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables diff --git a/platform/darwin/src/MGLHillshadeStyleLayer.h b/platform/darwin/src/MGLHillshadeStyleLayer.h index b2eeb59aba9..bc831c7f06b 100644 --- a/platform/darwin/src/MGLHillshadeStyleLayer.h +++ b/platform/darwin/src/MGLHillshadeStyleLayer.h @@ -107,11 +107,11 @@ MGL_EXPORT Intensity of the hillshade The default value of this property is an expression that evaluates to the float - `0.5`. Set this property to `nil` to reset it to the default value. + 0.5. Set this property to `nil` to reset it to the default value. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values between 0 and 1 inclusive * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -187,11 +187,11 @@ MGL_EXPORT `hillshadeIlluminationAnchor` is set to `MGLHillshadeIlluminationAnchorMap`. The default value of this property is an expression that evaluates to the float - `335`. Set this property to `nil` to reset it to the default value. + 335. Set this property to `nil` to reset it to the default value. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values between 0 and 359 inclusive * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables diff --git a/platform/darwin/src/MGLLight.h b/platform/darwin/src/MGLLight.h index d7e64cbfad9..2bdb874a375 100644 --- a/platform/darwin/src/MGLLight.h +++ b/platform/darwin/src/MGLLight.h @@ -163,11 +163,11 @@ MGL_EXPORT more extreme contrast. The default value of this property is an expression that evaluates to the float - `0.5`. + 0.5. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values between 0 and 1 inclusive * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables diff --git a/platform/darwin/src/MGLLineStyleLayer.h b/platform/darwin/src/MGLLineStyleLayer.h index 003f48ae43b..bdb5464ebc2 100644 --- a/platform/darwin/src/MGLLineStyleLayer.h +++ b/platform/darwin/src/MGLLineStyleLayer.h @@ -179,7 +179,7 @@ MGL_EXPORT Used to automatically convert miter joins to bevel joins for sharp angles. The default value of this property is an expression that evaluates to the float - `2`. Set this property to `nil` to reset it to the default value. + 2. Set this property to `nil` to reset it to the default value. This property is only applied to the style if `lineJoin` is set to an expression that evaluates to `miter`. Otherwise, it is ignored. @@ -201,7 +201,7 @@ MGL_EXPORT Used to automatically convert round joins to miter joins for shallow angles. The default value of this property is an expression that evaluates to the float - `1.05`. Set this property to `nil` to reset it to the default value. + 1.05. Set this property to `nil` to reset it to the default value. This property is only applied to the style if `lineJoin` is set to an expression that evaluates to `round`. Otherwise, it is ignored. @@ -227,11 +227,11 @@ MGL_EXPORT This property is measured in points. The default value of this property is an expression that evaluates to the float - `0`. Set this property to `nil` to reset it to the default value. + 0. Set this property to `nil` to reset it to the default value. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values no less than 0 * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -291,7 +291,7 @@ MGL_EXPORT You can set this property to an expression containing any of the following: - * Constant array values + * Constant array values no less than 0 * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -319,11 +319,11 @@ MGL_EXPORT This property is measured in points. The default value of this property is an expression that evaluates to the float - `0`. Set this property to `nil` to reset it to the default value. + 0. Set this property to `nil` to reset it to the default value. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values no less than 0 * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -348,7 +348,7 @@ MGL_EXPORT This property is measured in points. The default value of this property is an expression that evaluates to the float - `0`. Set this property to `nil` to reset it to the default value. + 0. Set this property to `nil` to reset it to the default value. You can set this property to an expression containing any of the following: @@ -372,11 +372,11 @@ MGL_EXPORT The opacity at which the line will be drawn. The default value of this property is an expression that evaluates to the float - `1`. Set this property to `nil` to reset it to the default value. + 1. Set this property to `nil` to reset it to the default value. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values between 0 and 1 inclusive * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -518,11 +518,11 @@ MGL_EXPORT This property is measured in points. The default value of this property is an expression that evaluates to the float - `1`. Set this property to `nil` to reset it to the default value. + 1. Set this property to `nil` to reset it to the default value. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values no less than 0 * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables diff --git a/platform/darwin/src/MGLRasterStyleLayer.h b/platform/darwin/src/MGLRasterStyleLayer.h index 7773246cad9..fd41f271edf 100644 --- a/platform/darwin/src/MGLRasterStyleLayer.h +++ b/platform/darwin/src/MGLRasterStyleLayer.h @@ -64,7 +64,7 @@ MGL_EXPORT brightness. The default value of this property is an expression that evaluates to the float - `1`. Set this property to `nil` to reset it to the default value. + 1. Set this property to `nil` to reset it to the default value. This attribute corresponds to the raster-brightness-max @@ -72,7 +72,7 @@ MGL_EXPORT You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values between 0 and 1 inclusive * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -97,7 +97,7 @@ MGL_EXPORT brightness. The default value of this property is an expression that evaluates to the float - `0`. Set this property to `nil` to reset it to the default value. + 0. Set this property to `nil` to reset it to the default value. This attribute corresponds to the raster-brightness-min @@ -105,7 +105,7 @@ MGL_EXPORT You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values between 0 and 1 inclusive * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -129,11 +129,11 @@ MGL_EXPORT Increase or reduce the contrast of the image. The default value of this property is an expression that evaluates to the float - `0`. Set this property to `nil` to reset it to the default value. + 0. Set this property to `nil` to reset it to the default value. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values between −1 and 1 inclusive * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -157,11 +157,11 @@ MGL_EXPORT This property is measured in milliseconds. The default value of this property is an expression that evaluates to the float - `300`. Set this property to `nil` to reset it to the default value. + 300. Set this property to `nil` to reset it to the default value. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values no less than 0 * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -178,7 +178,7 @@ MGL_EXPORT This property is measured in degrees. The default value of this property is an expression that evaluates to the float - `0`. Set this property to `nil` to reset it to the default value. + 0. Set this property to `nil` to reset it to the default value. This attribute corresponds to the raster-hue-rotate @@ -210,11 +210,11 @@ MGL_EXPORT The opacity at which the image will be drawn. The default value of this property is an expression that evaluates to the float - `1`. Set this property to `nil` to reset it to the default value. + 1. Set this property to `nil` to reset it to the default value. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values between 0 and 1 inclusive * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -236,11 +236,11 @@ MGL_EXPORT Increase or reduce the saturation of the image. The default value of this property is an expression that evaluates to the float - `0`. Set this property to `nil` to reset it to the default value. + 0. Set this property to `nil` to reset it to the default value. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values between −1 and 1 inclusive * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables diff --git a/platform/darwin/src/MGLSymbolStyleLayer.h b/platform/darwin/src/MGLSymbolStyleLayer.h index 1017db5442f..2fd5ef24794 100644 --- a/platform/darwin/src/MGLSymbolStyleLayer.h +++ b/platform/darwin/src/MGLSymbolStyleLayer.h @@ -559,14 +559,14 @@ MGL_EXPORT This property is measured in points. The default value of this property is an expression that evaluates to the float - `2`. Set this property to `nil` to reset it to the default value. + 2. Set this property to `nil` to reset it to the default value. This property is only applied to the style if `iconImageName` is non-`nil`. Otherwise, it is ignored. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values no less than 0 * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -610,7 +610,7 @@ MGL_EXPORT This property is measured in degrees. The default value of this property is an expression that evaluates to the float - `0`. Set this property to `nil` to reset it to the default value. + 0. Set this property to `nil` to reset it to the default value. This property is only applied to the style if `iconImageName` is non-`nil`. Otherwise, it is ignored. @@ -673,7 +673,7 @@ MGL_EXPORT This property is measured in factor of the original icon sizes. The default value of this property is an expression that evaluates to the float - `1`. Set this property to `nil` to reset it to the default value. + 1. Set this property to `nil` to reset it to the default value. This property is only applied to the style if `iconImageName` is non-`nil`. Otherwise, it is ignored. @@ -684,7 +684,7 @@ MGL_EXPORT You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values no less than 0 * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -853,7 +853,7 @@ MGL_EXPORT This property is measured in degrees. The default value of this property is an expression that evaluates to the float - `45`. Set this property to `nil` to reset it to the default value. + 45. Set this property to `nil` to reset it to the default value. This property is only applied to the style if `text` is non-`nil`, and `symbolPlacement` is set to an expression that evaluates to `line`. Otherwise, @@ -885,7 +885,7 @@ MGL_EXPORT This property is measured in ems. The default value of this property is an expression that evaluates to the float - `10`. Set this property to `nil` to reset it to the default value. + 10. Set this property to `nil` to reset it to the default value. This property is only applied to the style if `text` is non-`nil`. Otherwise, it is ignored. @@ -896,7 +896,7 @@ MGL_EXPORT You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values no less than 0 * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -968,14 +968,14 @@ MGL_EXPORT This property is measured in points. The default value of this property is an expression that evaluates to the float - `250`. Set this property to `nil` to reset it to the default value. + 250. Set this property to `nil` to reset it to the default value. This property is only applied to the style if `symbolPlacement` is set to an expression that evaluates to `line`. Otherwise, it is ignored. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values no less than 1 * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -1122,7 +1122,7 @@ MGL_EXPORT This property is measured in points. The default value of this property is an expression that evaluates to the float - `16`. Set this property to `nil` to reset it to the default value. + 16. Set this property to `nil` to reset it to the default value. This property is only applied to the style if `text` is non-`nil`. Otherwise, it is ignored. @@ -1133,7 +1133,7 @@ MGL_EXPORT You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values no less than 0 * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -1212,7 +1212,7 @@ MGL_EXPORT This property is measured in ems. The default value of this property is an expression that evaluates to the float - `0`. Set this property to `nil` to reset it to the default value. + 0. Set this property to `nil` to reset it to the default value. This property is only applied to the style if `text` is non-`nil`. Otherwise, it is ignored. @@ -1234,7 +1234,7 @@ MGL_EXPORT This property is measured in ems. The default value of this property is an expression that evaluates to the float - `1.2`. Set this property to `nil` to reset it to the default value. + 1.2. Set this property to `nil` to reset it to the default value. This property is only applied to the style if `text` is non-`nil`. Otherwise, it is ignored. @@ -1331,14 +1331,14 @@ MGL_EXPORT This property is measured in points. The default value of this property is an expression that evaluates to the float - `2`. Set this property to `nil` to reset it to the default value. + 2. Set this property to `nil` to reset it to the default value. This property is only applied to the style if `text` is non-`nil`. Otherwise, it is ignored. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values no less than 0 * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -1382,7 +1382,7 @@ MGL_EXPORT This property is measured in degrees. The default value of this property is an expression that evaluates to the float - `0`. Set this property to `nil` to reset it to the default value. + 0. Set this property to `nil` to reset it to the default value. This property is only applied to the style if `text` is non-`nil`. Otherwise, it is ignored. @@ -1498,14 +1498,14 @@ MGL_EXPORT This property is measured in points. The default value of this property is an expression that evaluates to the float - `0`. Set this property to `nil` to reset it to the default value. + 0. Set this property to `nil` to reset it to the default value. This property is only applied to the style if `iconImageName` is non-`nil`. Otherwise, it is ignored. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values no less than 0 * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -1556,14 +1556,14 @@ MGL_EXPORT This property is measured in points. The default value of this property is an expression that evaluates to the float - `0`. Set this property to `nil` to reset it to the default value. + 0. Set this property to `nil` to reset it to the default value. This property is only applied to the style if `iconImageName` is non-`nil`. Otherwise, it is ignored. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values no less than 0 * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -1583,14 +1583,14 @@ MGL_EXPORT The opacity at which the icon will be drawn. The default value of this property is an expression that evaluates to the float - `1`. Set this property to `nil` to reset it to the default value. + 1. Set this property to `nil` to reset it to the default value. This property is only applied to the style if `iconImageName` is non-`nil`. Otherwise, it is ignored. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values between 0 and 1 inclusive * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -1741,14 +1741,14 @@ MGL_EXPORT This property is measured in points. The default value of this property is an expression that evaluates to the float - `0`. Set this property to `nil` to reset it to the default value. + 0. Set this property to `nil` to reset it to the default value. This property is only applied to the style if `text` is non-`nil`. Otherwise, it is ignored. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values no less than 0 * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -1799,14 +1799,14 @@ MGL_EXPORT This property is measured in points. The default value of this property is an expression that evaluates to the float - `0`. Set this property to `nil` to reset it to the default value. + 0. Set this property to `nil` to reset it to the default value. This property is only applied to the style if `text` is non-`nil`. Otherwise, it is ignored. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values no less than 0 * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -1826,14 +1826,14 @@ MGL_EXPORT The opacity at which the text will be drawn. The default value of this property is an expression that evaluates to the float - `1`. Set this property to `nil` to reset it to the default value. + 1. Set this property to `nil` to reset it to the default value. This property is only applied to the style if `text` is non-`nil`. Otherwise, it is ignored. You can set this property to an expression containing any of the following: - * Constant numeric values + * Constant numeric values between 0 and 1 inclusive * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables From f1a066041ea5b6a95889887bcd2459c47f90459c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Thu, 25 Jan 2018 23:02:07 -0800 Subject: [PATCH 2/2] [ios] Fixed syntax error in style author guide --- platform/darwin/docs/guides/For Style Authors.md.ejs | 2 +- platform/ios/docs/guides/For Style Authors.md | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/platform/darwin/docs/guides/For Style Authors.md.ejs b/platform/darwin/docs/guides/For Style Authors.md.ejs index 3f6c3fc2a40..fc259e4da31 100644 --- a/platform/darwin/docs/guides/For Style Authors.md.ejs +++ b/platform/darwin/docs/guides/For Style Authors.md.ejs @@ -359,7 +359,7 @@ In style specification | Method, function, or predicate type | Format string syn <% if (macOS) { -%> `rgb` | `+[NSColor colorWithCalibratedRed:green:blue:alpha:]` | `rgba` | `+[NSColor colorWithCalibratedRed:green:blue:alpha:]` | -<% } else { %> +<% } else { -%> `rgb` | `+[UIColor colorWithRed:green:blue:alpha:]` | `rgba` | `+[UIColor colorWithRed:green:blue:alpha:]` | <% } -%> diff --git a/platform/ios/docs/guides/For Style Authors.md b/platform/ios/docs/guides/For Style Authors.md index 51cd87a7668..8db1bd33108 100644 --- a/platform/ios/docs/guides/For Style Authors.md +++ b/platform/ios/docs/guides/For Style Authors.md @@ -345,7 +345,6 @@ In style specification | Method, function, or predicate type | Format string syn `concat` | `stringByAppendingString:` | `downcase` | `lowercase:` | `lowercase('DOWNTOWN')` `upcase` | `uppercase:` | `uppercase('Elysian Fields')` - `rgb` | `+[UIColor colorWithRed:green:blue:alpha:]` | `rgba` | `+[UIColor colorWithRed:green:blue:alpha:]` | `to-rgba` | |