Skip to content

Commit 2069fcd

Browse files
fix test
1 parent a14e3f0 commit 2069fcd

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

x-pack/plugins/maps/public/classes/layers/create_tile_map_layer_descriptor.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
import {
1515
AGG_TYPE,
1616
COLOR_MAP_TYPE,
17+
DEFAULT_PERCENTILE,
1718
FIELD_ORIGIN,
1819
GRID_RESOLUTION,
1920
RENDER_AS,
@@ -61,14 +62,16 @@ export function createAggDescriptor(
6162

6263
if (!aggType || aggType === AGG_TYPE.COUNT || !metricFieldName) {
6364
return { type: AGG_TYPE.COUNT };
64-
} else if (aggType === AGG_TYPE.PERCENTILE) {
65-
return { type: aggType, field: metricFieldName, percentile: 50 };
65+
}
66+
67+
if (isHeatmap(mapType)) {
68+
return isMetricCountable(aggType)
69+
? { type: aggType, field: metricFieldName }
70+
: { type: AGG_TYPE.COUNT };
6671
} else {
67-
if (isHeatmap(mapType) && isMetricCountable(aggType)) {
68-
return { type: AGG_TYPE.COUNT };
69-
} else {
70-
return { type: aggType, field: metricFieldName };
71-
}
72+
return aggType === AGG_TYPE.PERCENTILE
73+
? { type: aggType, field: metricFieldName, percentile: DEFAULT_PERCENTILE }
74+
: { type: aggType, field: metricFieldName };
7275
}
7376
}
7477

0 commit comments

Comments
 (0)