Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Merge branch 'develop' of https://github.com/nasa-gibs/worldview into orbit-tracks-2279-2021-merge

Ben70cec5f5a9b9
diff --cc .eslintignore
index b9c8d5f61,f52ad534d..11aa11719
--- a/.eslintignore
+++ b/.eslintignore
@@@ -10,5 -10,5 +10,6 @@@ web/ext/
web/dist/*
web/build/*
test/*
- web/js/edsc/*
- /tasks/temp
++/tasks/temp/*
+ web/js/lib/*
+
diff --cc config/default/common/config/wv.json/layers/reference/orbits/OrbitTracks_NOAA-20_Ascending.json
index 45a672788,e0374ed51..fb99c00d0
--- a/config/default/common/config/wv.json/layers/reference/orbits/OrbitTracks_NOAA-20_Ascending.json
+++ b/config/default/common/config/wv.json/layers/reference/orbits/OrbitTracks_NOAA-20_Ascending.json
@@@ -5,9 -5,10 +5,9 @@@
"title": "NOAA-20 - Orbit Track & Time",
"subtitle": "NOAA-20 / Space-Track.org",
"description": "reference/orbits/OrbitTracks_NOAA-20_Ascending",
- "tags": "JPSS-1 tracks day vector",
- "tags": "jpss jpss-1 tracks day",
++ "tags": "jpss jpss-1 tracks day vector",
"group": "overlays",
- "format": "image/png",
- "type": "wms",
+ "type": "vector",
"period": "daily",
"wrapadjacentdays": true,
"layergroup": "Orbital Track",
diff --cc config/default/common/config/wv.json/layers/reference/orbits/OrbitTracks_NOAA-20_Descending.json
index 60679d09d,20526662a..c38ce2c74
--- a/config/default/common/config/wv.json/layers/reference/orbits/OrbitTracks_NOAA-20_Descending.json
+++ b/config/default/common/config/wv.json/layers/reference/orbits/OrbitTracks_NOAA-20_Descending.json
@@@ -5,9 -5,10 +5,9 @@@
"title": "NOAA-20 - Orbit Track & Time",
"subtitle": "NOAA-20 / Space-Track.org",
"description": "reference/orbits/OrbitTracks_NOAA-20_Descending",
- "tags": "JPSS-1 tracks night vector",
- "tags": "jpss jpss-1 tracks night",
++ "tags": "jpss jpss-1 tracks night vector",
"group": "overlays",
- "format": "image/png",
- "type": "wms",
+ "type": "vector",
"period": "daily",
"layergroup": "Orbital Track",
"daynight": [
diff --cc package.json
index 794a43b87,606de339f..80f58d99e
--- a/package.json
+++ b/package.json
@@@ -65,9 -65,8 +65,8 @@@
"lint": "run-s lint:*",
"lint:css": "stylelint ./web/css/**/*.css",
"lint:js": "eslint . --quiet",
- "notes": "node ./tasks/releaseNotes.js",
"preinstall": "node tasks/checkNodeVersion.js",
- "postinstall": "npm run python",
+ "postinstall": "patch-package && npm run python",
"python": "run-script-os",
"python:darwin:linux": "bash -c 'tasks/pythonInstall.sh linux'",
"python:win32": "bash -c 'tasks/pythonInstall.sh'",
diff --cc web/js/components/vector-metadata/table.js
index 54e692fc0,8195abd34..a1eea26fa
--- a/web/js/components/vector-metadata/table.js
+++ b/web/js/components/vector-metadata/table.js
@@@ -32,13 -32,17 +32,17 @@@ export default class VectorMetaTable ex
</thead>
<tbody>
{metaLegend.map((properties, index) => {
- const featureId = properties.Identifier;
- const isIntegerToStyle = properties.Function !== 'Identify' && (properties.DataType === 'int');
- const value = properties.ValueMap
- ? properties.ValueMap[metaFeatures[featureId]]
- : isIntegerToStyle && metaFeatures[featureId] ? metaFeatures[featureId].toLocaleString('en')
- : metaFeatures[featureId] ? metaFeatures[featureId] : null;
+ const {
+ Function, ValueMap, DataType, Title, Identifier, Units, Description,
+ } = properties;
+
+ const isIntegerToStyle = Function !== 'Identify' && (DataType === 'int');
+ const value = ValueMap
+ ? ValueMap[metaFeatures[Identifier]]
+ : isIntegerToStyle ? metaFeatures[Identifier].toLocaleString('en')
- : metaFeatures[Identifier];
++ : metaFeatures[Identifier] ? metaFeatures[Identifier] : null;
const id = util.cleanId(String(`${title}-${metaIndex + index}`));
+
if (!value) return undefined;
return (
<tr key={`vector-row-${id}`}>
diff --cc web/js/containers/map-interactions/ol-vector-interactions.js
index 19de5328f,a42229113..29eae1319
--- a/web/js/containers/map-interactions/ol-vector-interactions.js
+++ b/web/js/containers/map-interactions/ol-vector-interactions.js
@@@ -84,23 -90,28 +92,31 @@@ export class VectorInteractions extend
const selected = clickObj.selected || {};
const offsetLeft = clickObj.offsetLeft || 10;
const offsetTop = clickObj.offsetTop || 100;
+ const isCoordinatesMarker = clickObj.isCoordinatesMarker || false;
+ const exceededLengthLimit = clickObj.exceededLengthLimit || false;
- const dialogId = isVectorModalOpen ? modalState.id : `vector_dialog${pixels[0]}${pixels[1]}`;
+ const dialogId = clickObj.modalShouldFollowClicks ? `vector_dialog${pixels[0]}${pixels[1]}` : isVectorModalOpen ? modalState.id : `vector_dialog${pixels[0]}${pixels[1]}`;
- if (isCoordinatesMarker) {
- return;
- }
+
- if (metaArray.length) {
- openVectorDialog(dialogId, metaArray, offsetLeft, offsetTop, isMobile);
- } else {
- const mapRes = map.getView().getResolution();
- const hasNonClickableVectorLayerType = hasNonClickableVectorLayer(activeLayers, mapRes, proj.id);
++ if (isCoordinatesMarker) return;
+
+ const mapRes = map.getView().getResolution();
+ const hasNonClickableVectorLayerType = hasNonClickableVectorLayer(activeLayers, mapRes, proj.id, isMobile);
+ if (metaArray.length) {
if (hasNonClickableVectorLayerType) {
- activateVectorAlert();
+ activateVectorZoomAlert();
+ } else {
+ openVectorDialog(dialogId, metaArray, offsetLeft, offsetTop, browser, isEmbedModeActive);
+ if (exceededLengthLimit) {
+ activateVectorExceededResultsAlert();
+ } else if (isVectorExceededAlertPresent) {
+ clearVectorExceededResultsAlert();
+ }
}
+ } else if (hasNonClickableVectorLayerType) {
+ activateVectorZoomAlert();
}
if (Object.entries(selected).length || (Object.entries(lastSelected).length && !isVectorModalOpen)) {
+ if (isMobile && hasNonClickableVectorLayerType) return;
selectVectorFeatures(selected);
} else if (isVectorModalOpen && !Object.entries(selected).length) {
onCloseModal();
diff --cc web/js/modules/vector-styles/selectors.js
index 6f0519bea,03d267c3d..d6d5f8e02
--- a/web/js/modules/vector-styles/selectors.js
+++ b/web/js/modules/vector-styles/selectors.js
@@@ -121,7 -119,11 +121,10 @@@ export function setStyleFunction(def, v
}
});
}
+ if (!layer) {
+ return null;
+ }
const layerArray = layer.getLayers ? layer.getLayers().getArray() : [layer];
-
lodashEach(layerArray, (layerInLayerGroup) => {
if (layerInLayerGroup.isWMS) return; // WMS breakpoint tile
layerInLayerGroup = layerInLayerGroup.getLayers ? lodashFind(layerInLayerGroup.getLayers().getArray(), 'isVector') : layerInLayerGroup;
diff --cc web/js/modules/vector-styles/util.js
index f2a20b98d,c3a957106..1e89009c1
--- a/web/js/modules/vector-styles/util.js
+++ b/web/js/modules/vector-styles/util.js
@@@ -201,21 -210,26 +201,33 @@@ function getModalOffset(dimensionProps
/**
* Get Organized data for each feature at pixel
* @param {Object} mapProps
- * @param Object*} config
+ * @param {Object} config
* @param {Object} compareState
+ * @param {Boolean} isMobile
*/
- function getModalContentsAtPixel(mapProps, config, compareState) {
+ function getModalContentsAtPixel(mapProps, config, compareState, isMobile) {
const metaArray = [];
const selected = {};
+ let exceededLengthLimit = false;
+ let isCoordinatesMarker = false;
const { pixels, map, swipeOffset } = mapProps;
+ let modalShouldFollowClicks = false;
+ const featureOptions = isMobile ? { hitTolerance: 5 } : {};
+ // max displayed results of features at pixel
+ const desktopLimit = 12;
+ const mobileLimit = 5;
+ const maxLimitOfResults = isMobile ? mobileLimit : desktopLimit;
map.forEachFeatureAtPixel(pixels, (feature, layer) => {
+ const lengthCheck = (arr) => arr.length >= maxLimitOfResults;
+ const featureId = feature.getId();
+ if (featureId === 'coordinates-map-marker') {
+ isCoordinatesMarker = true;
+ return;
+ }
+ if (lengthCheck(metaArray)) {
+ exceededLengthLimit = true;
+ return true;
+ }
const def = lodashGet(layer, 'wv.def');
if (!def) {
return;
@@@ -253,9 -268,9 +266,9 @@@
metaArray.push(obj);
selected[layerId].push(uniqueIdentifier);
}
- });
+ }, featureOptions);
return {
- selected, metaArray, isCoordinatesMarker, modalShouldFollowClicks,
- selected, metaArray, exceededLengthLimit,
++ selected, metaArray, exceededLengthLimit, isCoordinatesMarker, modalShouldFollowClicks,
};
}
/**
@@@ -281,15 -296,14 +294,16 @@@ export function onMapClickGetVectorFeat
const mapProps = { pixels, map, swipeOffset };
const { offsetLeft, offsetTop } = getModalOffset(modalOffsetProps);
const {
- selected, metaArray, isCoordinatesMarker, modalShouldFollowClicks,
- } = getModalContentsAtPixel(mapProps, config, compare);
- selected, metaArray, exceededLengthLimit,
++ selected, metaArray, exceededLengthLimit, isCoordinatesMarker, modalShouldFollowClicks,
+ } = getModalContentsAtPixel(mapProps, config, compare, isMobile);
return {
selected, // Object containing unique identifiers of selected features
metaArray, // Organized metadata for modal
offsetLeft, // Modal default offsetLeft
offsetTop, // Modal default offsetTop
+ isCoordinatesMarker,
+ modalShouldFollowClicks,
+ exceededLengthLimit,
};
}
export function updateVectorSelection(selectionObj, lastSelection, layers, type, state) {