Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

add subtitle to metadata tabs

Benjamin Kingb8251e373f62
diff --git a/web/js/containers/vector-dialog.js b/web/js/containers/vector-dialog.js
index 051175e93..8ded8171e 100644
--- a/web/js/containers/vector-dialog.js
+++ b/web/js/containers/vector-dialog.js
@@ -32,7 +32,9 @@ class VectorDialog extends React.Component {
for (const [key, value] of Object.entries(vectorMetaObject)) {
const stringLength = 20;
const title = value[0].title || key;
+ const { subTitle } = value[0];
const titleText = title.length > stringLength ? `${title.substring(0, stringLength)}...` : title;
+ const combinedTitles = subTitle ? `${title} - ${subTitle}` : title;
const index = i;
keyArray.push(key);
navArray.push(
@@ -41,7 +43,7 @@ class VectorDialog extends React.Component {
className="vector-meta-nav-item"
active={activeIndex === i}
>
- <NavLink onClick={() => this.updateIndex(index)} title={title}>
+ <NavLink onClick={() => this.updateIndex(index)} title={combinedTitles}>
{`${titleText} [${value.length}]`}
</NavLink>
</NavItem>,
diff --git a/web/js/modules/vector-styles/util.js b/web/js/modules/vector-styles/util.js
index 346161347..921193abd 100644
--- a/web/js/modules/vector-styles/util.js
+++ b/web/js/modules/vector-styles/util.js
@@ -241,11 +241,13 @@ function getModalContentsAtPixel(mapProps, config, compareState) {
const uniqueIdentifier = features[uniqueIdentifierKey];
const title = titleKey ? features[titleKey] : 'Unknown title';
if (selected[layerId].includes(uniqueIdentifier)) return;
+
const obj = {
legend: properties,
features,
id: layerId,
title: def.title || layerId,
+ subTitle: def.subtitle,
featureTitle: title,
};