Skip to content

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

hide layer size legend with nullish label (#1836)

jagerts7b95c236fe19
diff --git a/src/components/map/map-legend.js b/src/components/map/map-legend.js
index 1ec3acd77..dfd92cbc4 100644
--- a/src/components/map/map-legend.js
+++ b/src/components/map/map-legend.js
@@ -78,17 +78,16 @@ export const VisualChannelMetric = ({name}) => {
};
/** @type {typeof import('./map-legend').LayerSizeLegend} */
-export const LayerSizeLegend = ({label, name}) => (
- <div className="legend--layer_size-schema">
- <p>
- <span className="legend--layer_by">
- <FormattedMessage id={label} />
- </span>
- <span className="legend--layer_by"> by </span>
- </p>
- <VisualChannelMetric name={name} />
- </div>
-);
+export const LayerSizeLegend = ({label, name}) =>
+ label ? (
+ (<div className="legend--layer_size-schema">
+ <p>
+ <span className="legend--layer_by">{label ? <FormattedMessage id={label} /> : null}</span>
+ <span className="legend--layer_by"> by </span>
+ </p>
+ <VisualChannelMetric name={name} />
+ </div>)
+ ) : null;
const SINGLE_COLOR_DOMAIN = [''];