From 4cad71a8ae281c74568ea8e9753faa6916837620 Mon Sep 17 00:00:00 2001 From: Mikhail Pozdnyakov Date: Thu, 28 Mar 2019 12:06:43 +0200 Subject: [Darwin] Improve documentation for enum array properties --- platform/darwin/scripts/generate-style-code.js | 5 +++++ platform/darwin/src/MGLSymbolStyleLayer.h | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js index 1e7b2a3973..2eabd0a92b 100755 --- a/platform/darwin/scripts/generate-style-code.js +++ b/platform/darwin/scripts/generate-style-code.js @@ -352,6 +352,9 @@ global.propertyDoc = function (propertyName, property, layerType, kind) { 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'; + } else if (property.type === 'array' && property.value === 'enum') { + doc += '* Constant array, whose each element is any of the following constant string values:\n'; + doc += Object.keys(property.values).map(value => ' * `' + value + '`: ' + property.values[value].doc).join('\n') + '\n'; } doc += '* Predefined functions, including mathematical and string operators\n' + '* Conditional expressions\n' + @@ -426,6 +429,8 @@ global.describeType = function (property) { return '`CGVector`'; case 'position': return '`MGLSphericalPosition`'; + case 'anchor': + return '`MGLTextAnchor` array'; default: return 'array'; } diff --git a/platform/darwin/src/MGLSymbolStyleLayer.h b/platform/darwin/src/MGLSymbolStyleLayer.h index ad792880e7..cf2c1466e7 100644 --- a/platform/darwin/src/MGLSymbolStyleLayer.h +++ b/platform/darwin/src/MGLSymbolStyleLayer.h @@ -1589,7 +1589,22 @@ MGL_EXPORT You can set this property to an expression containing any of the following: - * Constant array values + * Constant `MGLTextAnchor` array values + * Constant array, whose each element is any of the following constant string + values: + * `center`: The center of the text is placed closest to the anchor. + * `left`: The left side of the text is placed closest to the anchor. + * `right`: The right side of the text is placed closest to the anchor. + * `top`: The top of the text is placed closest to the anchor. + * `bottom`: The bottom of the text is placed closest to the anchor. + * `top-left`: The top left corner of the text is placed closest to the + anchor. + * `top-right`: The top right corner of the text is placed closest to the + anchor. + * `bottom-left`: The bottom left corner of the text is placed closest to the + anchor. + * `bottom-right`: The bottom right corner of the text is placed closest to + the anchor. * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables -- cgit v1.2.1