mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Maps] fix Unable to apply styles to vector tiles (#124289)
* [Maps] fix Unable to apply styles to vector tiles * eslint and tslint * fix jest test
This commit is contained in:
parent
9397661d05
commit
221a9915b3
2 changed files with 17 additions and 1 deletions
|
@ -50,6 +50,9 @@ describe('renderLegendDetailRow', () => {
|
|||
supportsFieldMetaFromEs: () => {
|
||||
return true;
|
||||
},
|
||||
supportsFieldMetaFromLocalData: () => {
|
||||
return true;
|
||||
},
|
||||
} as unknown as IField;
|
||||
const sizeProp = new DynamicSizeProperty(
|
||||
{ minSize: 0, maxSize: 10, fieldMetaOptions: { isEnabled: true } },
|
||||
|
|
|
@ -295,7 +295,20 @@ export class DynamicStyleProperty<T>
|
|||
}
|
||||
|
||||
getFieldMetaOptions() {
|
||||
return _.get(this.getOptions(), 'fieldMetaOptions', { isEnabled: true });
|
||||
const fieldMetaOptions = _.get(this.getOptions(), 'fieldMetaOptions', { isEnabled: true });
|
||||
|
||||
// In 8.0, UI changed to not allow setting isEnabled to false when fieldMeta from local not supported
|
||||
// Saved objects created prior to 8.0 may have a configuration where
|
||||
// fieldMetaOptions.isEnabled is false and the field does not support fieldMeta from local.
|
||||
// In these cases, force isEnabled to true
|
||||
// The exact case that spawned this fix is with ES_SEARCH sources and 8.0 where vector tiles switched
|
||||
// from vector tiles generated via Kibana server to vector tiles generated via Elasticsearch.
|
||||
// Kibana vector tiles supported fieldMeta from local while Elasticsearch vector tiles do not support fieldMeta from local.
|
||||
if (this._field && !this._field.supportsFieldMetaFromLocalData()) {
|
||||
fieldMetaOptions.isEnabled = true;
|
||||
}
|
||||
|
||||
return fieldMetaOptions;
|
||||
}
|
||||
|
||||
getDataMappingFunction() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue