Add support for text-variable-anchor-offset property (#2921)
Co-authored-by: Yingfang Wang <junew@microsoft.com> Co-authored-by: Alexey Kon <48697757+random3940@users.noreply.github.com>
This commit is contained in:
8
scripts/generate-style-code.mjs
Executable file → Normal file
8
scripts/generate-style-code.mjs
Executable file → Normal file
@@ -33,7 +33,7 @@ function isLightProperty(property) {
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {any} property
|
||||
* @param {any} property
|
||||
*/
|
||||
function isOverridable(property) {
|
||||
return ['text-color'].includes(property.name);
|
||||
@@ -58,6 +58,8 @@ function expressionType(property) {
|
||||
return `ColorType`;
|
||||
case 'padding':
|
||||
return `PaddingType`;
|
||||
case 'variableAnchorOffsetCollection':
|
||||
return `VariableAnchorOffsetCollectionType`;
|
||||
case 'formatted':
|
||||
return `FormattedType`;
|
||||
case 'array':
|
||||
@@ -72,6 +74,9 @@ function expressionType(property) {
|
||||
* @returns {string}
|
||||
*/
|
||||
function evaluatedType(property) {
|
||||
if (/text-variable-anchor-offset/.test(property.name)) {
|
||||
return 'VariableAnchorOffsetCollection';
|
||||
}
|
||||
if (/-translate-anchor$/.test(property.name)) {
|
||||
return 'TranslateAnchorType';
|
||||
}
|
||||
@@ -232,6 +237,7 @@ function defaultValue(property) {
|
||||
case 'formatted':
|
||||
case 'string':
|
||||
case 'resolvedImage':
|
||||
case 'variableAnchorOffsetCollection':
|
||||
return property.default ? `{${JSON.stringify(property.default)}}` : '{}';
|
||||
case 'enum':
|
||||
if (property.default === undefined) {
|
||||
|
||||
@@ -6,9 +6,6 @@ let modifiedReferenceSpec = referenceSpec;
|
||||
// https://github.com/maplibre/maplibre-native/issues/250
|
||||
delete modifiedReferenceSpec['layout_symbol']['text-rotation-alignment']["values"]['viewport-glyph']
|
||||
|
||||
// https://github.com/maplibre/maplibre-native/issues/2358
|
||||
delete modifiedReferenceSpec['layout_symbol']['text-variable-anchor-offset'];
|
||||
|
||||
// https://github.com/maplibre/maplibre-native/issues/251
|
||||
delete modifiedReferenceSpec['layout_symbol']['icon-overlap'];
|
||||
delete modifiedReferenceSpec['layout_symbol']['text-overlap'];
|
||||
@@ -193,4 +190,4 @@ modifiedReferenceSpec["paint_location-indicator"] = {
|
||||
}
|
||||
};
|
||||
|
||||
export default modifiedReferenceSpec;
|
||||
export default modifiedReferenceSpec;
|
||||
|
||||
Reference in New Issue
Block a user