Interactive interface for browsing global, full-resolution satellite imagery
#2437 show tooltip for single legend values on hover so user can tell which value they are hovering over on map
Jason Kentba05d8a1363d
diff --git a/web/js/components/sidebar/paletteLegend.js b/web/js/components/sidebar/paletteLegend.jsindex 8d765fb53..1ddbcff6b 100644--- a/web/js/components/sidebar/paletteLegend.js+++ b/web/js/components/sidebar/paletteLegend.js@@ -331,6 +331,9 @@ class PaletteLegend extends React.Component {const parentLayerId = isSubLayer ? parentLayer.id : '';const keyId = layer.id + '-' + legend.id + '-color-' + keyIndex + parentLayerId + layerGroupName;const keyLabel = activeKeyObj ? activeKeyObj.label : '';+ const tooltipText = singleKey+ ? layer.track ? trackLabel : legendTooltip+ : keyLabel;return (<React.Fragment key={keyId}>@@ -344,21 +347,22 @@ class PaletteLegend extends React.Component {dangerouslySetInnerHTML={{ __html: ' ' }}/>- {singleKey && !isSubLayer- ? (- <div className="wv-running-category-label-case">- <span className="wv-running-category-label">- {layer.track ? trackLabel : legend.title}- </span>- </div>- ) : (- <Tooltip- placement="bottom"- isOpen={isActiveKey}- target={keyId}>- {keyLabel}- </Tooltip>- )}+ {singleKey && !isSubLayer && (+ <div className="wv-running-category-label-case">+ <span className="wv-running-category-label">+ {layer.track ? trackLabel : legendTooltip}+ </span>+ </div>+ )}++ {(+ <Tooltip+ placement={singleKey ? 'right' : 'bottom'}+ isOpen={isActiveKey}+ target={keyId}>+ {tooltipText}+ </Tooltip>+ )}</React.Fragment>);})}