Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

add minheight in sidebar layer for vector layers with clickable features, change to use tooltip with vector hand, break out of feature mouseover if no palette

Ed Plato5f6c07b23478
diff --git a/web/js/containers/sidebar/layer-row.js b/web/js/containers/sidebar/layer-row.js
index 4bcaf6e81..eefdf5ebf 100644
--- a/web/js/containers/sidebar/layer-row.js
+++ b/web/js/containers/sidebar/layer-row.js
@@ -186,19 +186,25 @@ function LayerRow (props) {
};
const renderVectorIcon = () => {
- const clasNames = hasClickableFeature
+ const classNames = hasClickableFeature
? 'layer-pointer-icon'
: 'layer-pointer-icon disabled';
const title = hasClickableFeature
- ? 'You can click the features of this layer to see metadata associated with the feature.'
+ ? 'You can click the features of this layer to see associated metadata.'
: 'Zoom in further to click features.';
+ const layerVectorBtnId = `layer-vector-hand-btn-${encodedLayerId}`;
return (
- <div title={title} className={runningObject ? `${clasNames} running` : clasNames} onClick={openVectorAlertModal}>
- {' '}
- <FontAwesomeIcon
- icon="hand-pointer"
- fixedWidth
- />
+ <div
+ id={layerVectorBtnId}
+ aria-label={title}
+ className={runningObject ? `${classNames} running` : classNames}
+ onMouseDown={stopPropagation}
+ onClick={openVectorAlertModal}
+ >
+ <UncontrolledTooltip placement="top" target={layerVectorBtnId}>
+ {title}
+ </UncontrolledTooltip>
+ <FontAwesomeIcon icon="hand-pointer" fixedWidth />
</div>
);
};
@@ -260,7 +266,7 @@ function LayerRow (props) {
<Zot zot={zot} layer={layer.id} isMobile={isMobile} />
<div className="layer-main">
- <div className="layer-info">
+ <div className="layer-info" style={{ minHeight: isVectorLayer ? '60px' : '40px' }}>
<div className="layer-buttons">
{showButtons && renderControls()}
</div>
diff --git a/web/js/map/runningdata.js b/web/js/map/runningdata.js
index 2bf9d48dc..3244b4cf5 100644
--- a/web/js/map/runningdata.js
+++ b/web/js/map/runningdata.js
@@ -52,13 +52,16 @@ export default function MapRunningData(models, compareUi, store) {
const isWrapped = proj.id === 'geographic' && (def.wrapadjacentdays || def.wrapX);
const isRenderedFeature = isWrapped ? lon > -250 || lon < 250 || lat > -90 || lat < 90 : true;
if (!isRenderedFeature || !isFromActiveCompareRegion(pixels, layer.wv, state.compare, swipeOffset)) return;
- let color;
+
+ const hasPalette = !lodashIsEmpty(def.palette);
+ if (!hasPalette) return;
const identifier = def.palette.styleProperty;
const layerId = def.id;
const paletteLegends = getPalette(layerId, undefined, undefined, state);
const { legend } = paletteLegends;
if (!identifier && legend.colors.length > 1) return;
+ let color;
if (identifier) {
const properties = feature.getProperties();
const value = properties[identifier] || def.palette.unclassified;