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:
Young Hahn
2016-06-10 23:05:15 -04:00
committed by GitHub
parent a8df0feb54
commit ecd4aa1439
22 changed files with 107 additions and 65 deletions

View File

@@ -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':