Geomap: Only filter if there is a match (#110996)
This commit is contained in:
@@ -101,7 +101,9 @@ export function getLayerEditor(opts: LayerEditorOptions): NestedPanelOptions<Map
|
||||
// If `filterData` exists filter data feeding into location editor
|
||||
if (options.filterData) {
|
||||
const matcherFunc = getFrameMatchers(options.filterData);
|
||||
data = data.filter(matcherFunc);
|
||||
if (data.some(matcherFunc)) {
|
||||
data = data.filter(matcherFunc);
|
||||
}
|
||||
}
|
||||
|
||||
addLocationFields('Location', 'location.', builder, options.location, data);
|
||||
|
||||
@@ -26,10 +26,12 @@ export const applyLayerFilter = (
|
||||
let panelData = panelDataProps;
|
||||
if (options.filterData) {
|
||||
const matcherFunc = getFrameMatchers(options.filterData);
|
||||
panelData = {
|
||||
...panelData,
|
||||
series: panelData.series.filter(matcherFunc),
|
||||
};
|
||||
if (panelData.series.some(matcherFunc)) {
|
||||
panelData = {
|
||||
...panelData,
|
||||
series: panelData.series.filter(matcherFunc),
|
||||
};
|
||||
}
|
||||
}
|
||||
handler.update(panelData);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user