Interactive interface for browsing global, full-resolution satellite imagery
prevent cross-tile duplicates #2144
Benjamin King08648e7eb506
diff --git a/web/js/modules/vector-styles/selectors.js b/web/js/modules/vector-styles/selectors.jsindex c8ce0dc82..2c678724e 100644--- a/web/js/modules/vector-styles/selectors.js+++ b/web/js/modules/vector-styles/selectors.js@@ -1,7 +1,8 @@import {get as lodashGet,isUndefined as lodashIsUndefined,- each as lodashEach+ each as lodashEach,+ find as lodashFind} from 'lodash';import {getLayers@@ -126,7 +127,6 @@ export function setStyleFunction(def, vectorStyleId, vectorStyles, layer, state,// Apply mapbox-gl stylesstyleFunction = stylefunction(layer, glStyle, vectorStyleId);// Filter Orbit Tracks- console.log('lol')if (glStyle.name === 'Orbit Tracks') {// Filter time by 5 minslayer.setStyle(function (feature, resolution) {@@ -143,7 +143,11 @@ export function setStyleFunction(def, vectorStyleId, vectorStyles, layer, state,const selectedFeatures = interactionsObject.features;layer.setStyle(function (feature, resolution) {- const selectedFeature = selectedFeatures.includes(feature.ol_uid);+ const data = state.config.vectorData[def.vectorData.id];+ const properties = data.mvt_properties;+ const titleKey = lodashFind(properties, { Function: 'Identify' })['Identifier'];+ const id = feature.getProperties()[titleKey];+ const selectedFeature = selectedFeatures.includes(id);if (selectedFeature) {return selectedStyleFunction(feature, styleFunction(feature, resolution));} else {diff --git a/web/js/modules/vector-styles/util.js b/web/js/modules/vector-styles/util.jsindex 54732dedb..96e67dc91 100644--- a/web/js/modules/vector-styles/util.js+++ b/web/js/modules/vector-styles/util.js@@ -98,7 +98,6 @@ export function onMapClickGetVectorFeatures(e, map, store) {const state = store.getState();const lastSelection = state.vectorStyles.selected;const config = state.config;- // const vectorStyles = config.vectorStyles;map.forEachFeatureAtPixel(e.pixel, function (feature, layer) {const def = lodashGet(layer, 'wv.def');if (!def) return;@@ -111,16 +110,17 @@ export function onMapClickGetVectorFeatures(e, map, store) {const data = config.vectorData[vectorDataId];const properties = data.mvt_properties;const titleKey = lodashFind(properties, { Function: 'Identify' })['Identifier'];-+ const title = features[titleKey];+ if (selected[layerId].includes(title)) returnconst obj = {legend: properties,features: features,id: vectorDataId,title: def.title || def.id,- featureTitle: features[titleKey]+ featureTitle: title};metaArray.push(obj);- selected[layerId].push(feature.ol_uid);+ selected[layerId].push(title);}});if (Object.entries(selected).length || Object.entries(lastSelection).length) {