Interactive interface for browsing global, full-resolution satellite imagery
Speed enhancements #2420
Benjamin King2d87bf5ce9a1
diff --git a/web/js/components/vector-metadata/table.js b/web/js/components/vector-metadata/table.jsindex 7cc2c94bb..e436c36c1 100644--- a/web/js/components/vector-metadata/table.js+++ b/web/js/components/vector-metadata/table.js@@ -76,7 +76,7 @@ export default class VectorMetaTable extends React.Component {}}VectorMetaTable.propTypes = {- id: PropTypes.string,+ id: PropTypes.number,metaArray: PropTypes.array,title: PropTypes.string};diff --git a/web/js/containers/map-interactions.js b/web/js/containers/map-interactions.jsindex f5538e4fd..74ce3bf4f 100644--- a/web/js/containers/map-interactions.js+++ b/web/js/containers/map-interactions.js@@ -6,13 +6,14 @@ import vectorDialog from './vector-dialog';import { onMapClickGetVectorFeatures } from '../modules/vector-styles/util';import { openCustomContent, onClose } from '../modules/modal/actions';import { selectVectorFeatures } from '../modules/vector-styles/actions';-import { groupBy as lodashGroupBy } from 'lodash';+import { groupBy as lodashGroupBy, debounce as lodashDebounce } from 'lodash';import { changeCursor } from '../modules/map/actions';export class MapInteractions extends React.Component {constructor(props) {super(props);this.mouseMove = this.mouseMove.bind(this);+ this.mouseMove = lodashDebounce(this.mouseMove.bind(this), 8);this.singleClick = this.singleClick.bind(this);this.registerMouseListeners();}@@ -75,7 +76,9 @@ export class MapInteractions extends React.Component {}const mapDispatchToProps = dispatch => ({selectVectorFeatures: (features) => {- dispatch(selectVectorFeatures(features));+ setTimeout(() => {+ dispatch(selectVectorFeatures(features));+ }, 1);},changeCursor: (bool) => {dispatch(changeCursor(bool));@@ -101,9 +104,11 @@ const mapDispatchToProps = dispatch => ({height: 300,offsetLeft,offsetTop,- timeout: 150,+ timeout: 0,onClose: () => {- dispatch(selectVectorFeatures({}));+ setTimeout(() => {+ dispatch(selectVectorFeatures({}));+ }, 1);}}));diff --git a/web/js/containers/vector-dialog.js b/web/js/containers/vector-dialog.jsindex 2d4fcc542..1a6511eab 100644--- a/web/js/containers/vector-dialog.js+++ b/web/js/containers/vector-dialog.js@@ -70,7 +70,7 @@ export default connect(null)(VectorDialog);VectorDialog.propTypes = {- dialogKey: PropTypes.string,+ dialogKey: PropTypes.number,modalHeight: PropTypes.number,toggleWithClose: PropTypes.func,vectorMetaArray: PropTypes.array,diff --git a/web/js/map/runningdata.js b/web/js/map/runningdata.jsindex 779f35baa..14dede92c 100644--- a/web/js/map/runningdata.js+++ b/web/js/map/runningdata.js@@ -68,7 +68,7 @@ export function MapRunningData(models, compareUi, store) {self.newPoint = function(coords, map) {const state = store.getState();var activeLayerObj = {};- const [lon, lat] = coord;+ const [lon, lat] = coords;if (!(lon < -180 || lon > 180 || lat < -90 || lat > 90)) {map.forEachFeatureAtPixel(coords, (feature, layer) => {if (!layer.wv || !layer.wv.def) return;