diff --git a/x-pack/plugins/maps/public/classes/util/mb_filter_expressions.ts b/x-pack/plugins/maps/public/classes/util/mb_filter_expressions.ts index c798f05df9813..f5df741759cb3 100644 --- a/x-pack/plugins/maps/public/classes/util/mb_filter_expressions.ts +++ b/x-pack/plugins/maps/public/classes/util/mb_filter_expressions.ts @@ -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]; }