text-pitch-alignment (#5288)
* First pass at port of https://github.com/mapbox/mapbox-gl-js/pull/2668 * RotationAlignmentType => AlignmentType * Handle undefined default value for text-pitch-alignment and implement inheritance for this value from text-rotation-alignment * Update dependencies * Move handling fo undefined default value out of camelize functions
This commit is contained in:
@@ -21,8 +21,8 @@ global.propertyType = function (property) {
|
||||
if (/-translate-anchor$/.test(property.name)) {
|
||||
return 'TranslateAnchorType';
|
||||
}
|
||||
if (/-rotation-alignment$/.test(property.name)) {
|
||||
return 'RotationAlignmentType';
|
||||
if (/-(rotation|pitch)-alignment$/.test(property.name)) {
|
||||
return 'AlignmentType';
|
||||
}
|
||||
switch (property.type) {
|
||||
case 'boolean':
|
||||
@@ -57,7 +57,11 @@ global.defaultValue = function (property) {
|
||||
case 'string':
|
||||
return JSON.stringify(property.default || "");
|
||||
case 'enum':
|
||||
return `${propertyType(property)}::${camelize(property.default)}`;
|
||||
if (property.default === undefined) {
|
||||
return `${propertyType(property)}::Undefined`;
|
||||
} else {
|
||||
return `${propertyType(property)}::${camelize(property.default)}`;
|
||||
}
|
||||
case 'color':
|
||||
return `{{ ${parseCSSColor(property.default).join(', ')} }}`
|
||||
case 'array':
|
||||
|
||||
Reference in New Issue
Block a user