[Maps] pass getFieldFormatter to DynamicTextProperty (#53937)

* [Maps] pass getFieldFormatter to DynamicTextProperty

* remove files from another PR
This commit is contained in:
Nathan Reese 2020-01-03 14:19:19 -05:00 committed by GitHub
parent 8cc778a64a
commit ace50d8d2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -613,7 +613,13 @@ export class VectorStyle extends AbstractStyle {
return new StaticTextProperty(descriptor.options, VECTOR_STYLES.LABEL_TEXT);
} else if (descriptor.type === DynamicStyleProperty.type) {
const field = this._makeField(descriptor.options.field);
return new DynamicTextProperty(descriptor.options, VECTOR_STYLES.LABEL_TEXT, field);
return new DynamicTextProperty(
descriptor.options,
VECTOR_STYLES.LABEL_TEXT,
field,
this._getFieldMeta,
this._getFieldFormatter
);
} else {
throw new Error(`${descriptor} not implemented`);
}

View file

@ -168,5 +168,5 @@ export function canSkipFormattersUpdate({ prevDataRequest, nextMeta }) {
return false;
}
return !_.isEqual(prevMeta.fieldNames, nextMeta.fieldNames);
return _.isEqual(prevMeta.fieldNames, nextMeta.fieldNames);
}