Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

[Bug] fix undefined in the tooltip (Aggregation layers) (#1521)

Igor Dykhta5deed4157e9b
diff --git a/src/layers/aggregation-layer.js b/src/layers/aggregation-layer.js
index d74c7475b..aae2b9a04 100644
--- a/src/layers/aggregation-layer.js
+++ b/src/layers/aggregation-layer.js
@@ -121,10 +121,11 @@ export default class AggregationLayer extends Layer {
getVisualChannelDescription(key) {
// e.g. label: Color, measure: Average of ETA
const {range, field, defaultMeasure, aggregation} = this.visualChannels[key];
+ const fieldConfig = this.config[field];
return {
label: this.visConfigSettings[range].label,
- measure: this.config[field]
- ? `${this.config.visConfig[aggregation]} of ${this.config[field].displayName}`
+ measure: fieldConfig
+ ? `${this.config.visConfig[aggregation]} of ${fieldConfig.displayName || fieldConfig.name}`
: defaultMeasure
};
}