Interactive interface for browsing global, full-resolution satellite imagery
prevent animate of vector tiles #3059
Benjamin Kinga3660ce3dc52
diff --git a/web/js/map/layerbuilder.js b/web/js/map/layerbuilder.jsindex 174cdba98..5e111d01c 100644--- a/web/js/map/layerbuilder.js+++ b/web/js/map/layerbuilder.js@@ -382,7 +382,7 @@ export default function mapLayerBuilder(models, config, cache, ui, store) {* @param {object} attributes*/const createLayerVector = function(def, options, day, state, attributes) {- const { proj, compare } = state;+ const { proj, compare, animation } = state;let date;let gridExtent;let matrixIds;@@ -391,6 +391,7 @@ export default function mapLayerBuilder(models, config, cache, ui, store) {const selectedProj = proj.selected;const activeDateStr = compare.isCompareA ? 'selected' : 'selectedB';const source = config.sources[def.source];+ const animationIsPlaying = animation.isPlaying;gridExtent = selectedProj.maxExtent;layerExtent = gridExtent;start = [selectedProj.maxExtent[0], selectedProj.maxExtent[3]];@@ -465,7 +466,7 @@ export default function mapLayerBuilder(models, config, cache, ui, store) {layer.wrap = day;layer.wv = attributes;layer.isVector = true;- if (breakPointLayerDef) {+ if (breakPointLayerDef && !animationIsPlaying) {const newDef = { ...def, ...breakPointLayerDef };const wmsLayer = createLayerWMS(newDef, options, day, state);const layerGroup = new OlLayerGroup({@@ -473,7 +474,14 @@ export default function mapLayerBuilder(models, config, cache, ui, store) {});wmsLayer.wv = attributes;return layerGroup;+ } if (breakPointResolution && animationIsPlaying) {+ delete breakPointLayerDef.projections[proj.id].resolutionBreakPoint;+ const newDef = { ...def, ...breakPointLayerDef };+ const wmsLayer = createLayerWMS(newDef, options, day, state);+ wmsLayer.wv = attributes;+ return wmsLayer;}+return layer;};diff --git a/web/js/map/ui.js b/web/js/map/ui.jsindex 6d075c65e..3acf42192 100644--- a/web/js/map/ui.js+++ b/web/js/map/ui.js@@ -45,7 +45,7 @@ import {getLayers,isRenderable as isRenderableLayer,} from '../modules/layers/selectors';-+import { EXIT_ANIMATION, STOP_ANIMATION } from '../modules/animation/constants';import {CLEAR_ROTATE, RENDERED, UPDATE_MAP_UI, FITTED_TO_LEADING_EXTENT, REFRESH_ROTATE,} from '../modules/map/constants';@@ -53,6 +53,7 @@ import { getLeadingExtent } from '../modules/map/util';import { updateVectorSelection } from '../modules/vector-styles/util';import { faIconPlusSVGDomEl, faIconMinusSVGDomEl } from './fa-map-icons';+import { hasVectorLayers } from '../modules/layers/util';export default function mapui(models, config, store, ui) {const id = 'wv-map';@@ -150,13 +151,23 @@ export default function mapui(models, config, store, ui) {self.selectedVectors = newSelection;return;}+ case STOP_ANIMATION:+ case EXIT_ANIMATION:+ return onStopAnimation();case SELECT_DATE:return updateDate();default:break;}};-+ const onStopAnimation = function() {+ const { compare, layers } = store.getState();+ const activeLayerStr = compare.activeString;+ const hasActiveVectors = hasVectorLayers(layers[activeLayerStr]);+ if (hasActiveVectors) {+ reloadLayers();+ }+ };/** Sets up map listeners*