Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

rerender modal if new modal opens #2144

Benjamin Kinga55d15fe7d3a
diff --git a/web/js/app.js b/web/js/app.js
index 81c7d6a7a..0396f63d5 100644
--- a/web/js/app.js
+++ b/web/js/app.js
@@ -101,7 +101,7 @@ class App extends React.Component {
}
render() {
- const { isAnimationWidgetActive, isTourActive, locationKey, mapIsClickable } = this.props;
+ const { isAnimationWidgetActive, isTourActive, locationKey, mapIsClickable, modalId } = this.props;
const mapClasses = mapIsClickable ? 'wv-map' + ' cursor-pointer' : 'wv-map';
return (
@@ -124,7 +124,7 @@ class App extends React.Component {
</div>
<MeasureButton />
<OlCoordinates mouseEvents={this.props.mapMouseEvents} />
- <Modal />
+ <Modal key={modalId} />
<ErrorBoundary>
<Debug parameters={this.props.parameters} />
</ErrorBoundary>
@@ -185,7 +185,8 @@ function mapStateToProps(state, ownProps) {
models: ownProps.models,
mapMouseEvents: ownProps.mapMouseEvents,
locationKey: state.location.key,
- mapIsClickable: state.map.isClickable
+ mapIsClickable: state.map.isClickable,
+ modalId: state.modal.id
};
}
const mapDispatchToProps = dispatch => ({
diff --git a/web/js/components/map/ol-coordinates.js b/web/js/components/map/ol-coordinates.js
index c0bfcdc23..aa601d3b4 100644
--- a/web/js/components/map/ol-coordinates.js
+++ b/web/js/components/map/ol-coordinates.js
@@ -42,7 +42,7 @@ class OlCoordinates extends React.Component {
const metaArray = clickObj.metaArray || [];
const selected = clickObj.selected || {};
const offsetLeft = clickObj.offsetLeft || 10;
- const dialogId = 'vector_dialog' + pixels[0] + pixels[1];
+ const dialogId = 'vector_dialog';
const isVectorModalOpen = modalState.id.includes('vector_dialog') && modalState.isOpen;
if (metaArray.length) {
@@ -148,6 +148,7 @@ const mapDispatchToProps = dispatch => ({
width: 445,
height: 300,
offsetLeft,
+ timeout: 150,
onClose: () => {
dispatch(selectVectorFeatures({}));
}
diff --git a/web/js/modules/vector-styles/util.js b/web/js/modules/vector-styles/util.js
index cf19d6843..db32087b8 100644
--- a/web/js/modules/vector-styles/util.js
+++ b/web/js/modules/vector-styles/util.js
@@ -101,7 +101,6 @@ export function selectedStyleFunction(feature, styleArray) {
}
});
}
-export function getColor() { }
export function getConditionalColors(color) {
const array = Array.from(color);
array.shift();