Skip to content

Commit

Permalink
[Maps] fix line and polygon label regression (elastic#101085)
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Jun 1, 2021
1 parent 1a2e46b commit 317b27b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion x-pack/plugins/maps/public/classes/util/mb_filter_expressions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,14 @@ export function getPointFilterExpression(hasJoins: boolean): unknown[] {
}

export function getCentroidFilterExpression(hasJoins: boolean): unknown[] {
return getFilterExpression(['==', ['get', KBN_IS_CENTROID_FEATURE], true], hasJoins);
const filters: unknown[] = [
EXCLUDE_TOO_MANY_FEATURES_BOX,
['==', ['get', KBN_IS_CENTROID_FEATURE], true],
];

if (hasJoins) {
filters.push(['==', ['get', FEATURE_VISIBLE_PROPERTY_NAME], true]);
}

return ['all', ...filters];
}

0 comments on commit 317b27b

Please sign in to comment.