Add array support for icon-padding (#2845)
This commit is contained in:
@@ -56,6 +56,8 @@ function expressionType(property) {
|
||||
return 'StringType';
|
||||
case 'color':
|
||||
return `ColorType`;
|
||||
case 'padding':
|
||||
return `PaddingType`;
|
||||
case 'formatted':
|
||||
return `FormattedType`;
|
||||
case 'array':
|
||||
@@ -104,6 +106,8 @@ function evaluatedType(property) {
|
||||
return (isLightProperty(property) ? 'Light' : '') + `${camelize(property.name)}Type`;
|
||||
case 'color':
|
||||
return `Color`;
|
||||
case 'padding':
|
||||
return `Padding`;
|
||||
case 'array':
|
||||
if (property.length) {
|
||||
return `std::array<${evaluatedType({type: property.value, name: property.name})}, ${property.length}>`;
|
||||
@@ -248,6 +252,7 @@ function defaultValue(property) {
|
||||
return `{ ${color} }`;
|
||||
}
|
||||
case 'array':
|
||||
case 'padding':
|
||||
const defaults = (property.default || []).map((/** @type {any} **/ e) => defaultValue({ type: property.value, default: e }));
|
||||
if (property.length) {
|
||||
return `{{${defaults.join(', ')}}}`;
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
import referenceSpec from './style-spec-reference/v8.json' with { type: "json" };
|
||||
|
||||
// https://github.com/maplibre/maplibre-native/issues/2368
|
||||
referenceSpec['layout_symbol']['icon-padding']['type'] = 'number';
|
||||
// @ts-ignore
|
||||
referenceSpec['layout_symbol']['icon-padding']['default'] = 2;
|
||||
|
||||
// https://github.com/maplibre/maplibre-native/issues/2754
|
||||
referenceSpec['layout_symbol']['icon-padding']['property-type'] = 'data constant';
|
||||
|
||||
/** @type {any} */
|
||||
let modifiedReferenceSpec = referenceSpec;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user