Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

add proj gtm push & config verify #1576

Benjamin King97f4c5b04fcf
diff --git a/web/js/components/image-download/panel.js b/web/js/components/image-download/panel.js
index 86517e883..13f48bfb1 100644
--- a/web/js/components/image-download/panel.js
+++ b/web/js/components/image-download/panel.js
@@ -135,7 +135,6 @@ export default class ImageResSelection extends React.Component {
const width = dimensions.width;
const filetypeSelect = this._renderFileTypeSelect();
const worldfileSelect = this._renderWorldfileSelect();
- console.log(projection, lonlats, resolution);
return (
<div className="wv-re-pick-wrapper wv-image">
<div
diff --git a/web/js/containers/projection.js b/web/js/containers/projection.js
index 6d50187de..de574265b 100644
--- a/web/js/containers/projection.js
+++ b/web/js/containers/projection.js
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { changeProjection } from '../modules/projection/actions';
import IconList from '../components/util/list';
+import googleTagManager from 'googleTagManager';
const infoArray = [
{
@@ -27,9 +28,13 @@ const infoArray = [
class ProjectionList extends Component {
updateProjection(id) {
- const { updateProjection, models, config } = this.props;
- models.proj.select(id); // state migration crutch
- updateProjection(id, config);
+ const { updateProjection, models } = this.props;
+ models.proj.select(id); // migration crutch
+ updateProjection(id);
+ googleTagManager.pushEvent({
+ event: 'change_projection',
+ projection: id
+ });
}
render() {
const { projection } = this.props;
diff --git a/web/js/containers/toolbar.js b/web/js/containers/toolbar.js
index 7cfdd56b6..89011a7e5 100644
--- a/web/js/containers/toolbar.js
+++ b/web/js/containers/toolbar.js
@@ -49,7 +49,8 @@ class LinksContainer extends Component {
const {
openModal,
notificationType,
- notificationContentNumber
+ notificationContentNumber,
+ config
} = this.props;
const notificationClass = notificationType
? ' wv-status-' + notificationType
@@ -69,19 +70,23 @@ class LinksContainer extends Component {
>
<i className="fas fa-share-square fa-2x" />
</Button>
- <Button
- id="wv-proj-button"
- className="wv-toolbar-button"
- title="Switch projection"
- onClick={() =>
- openModal(
- 'TOOLBAR_PROJECTION',
- CUSTOM_MODAL_PROPS['TOOLBAR_PROJECTION']
- )
- }
- >
- <i className="fas fa-globe-asia fa-2x" />{' '}
- </Button>
+ {config.ui && config.ui.projections ? (
+ <Button
+ id="wv-proj-button"
+ className="wv-toolbar-button"
+ title="Switch projection"
+ onClick={() =>
+ openModal(
+ 'TOOLBAR_PROJECTION',
+ CUSTOM_MODAL_PROPS['TOOLBAR_PROJECTION']
+ )
+ }
+ >
+ <i className="fas fa-globe-asia fa-2x" />{' '}
+ </Button>
+ ) : (
+ ''
+ )}
<Button
id="wv-image-button"
className="wv-toolbar-button"
@@ -115,7 +120,8 @@ function mapStateToProps(state) {
return {
notificationType: type,
- notificationContentNumber: number
+ notificationContentNumber: number,
+ config: state.config
};
}
const mapDispatchToProps = dispatch => ({
@@ -130,5 +136,8 @@ export default connect(
)(LinksContainer);
LinksContainer.propTypes = {
- openModal: PropTypes.func
+ openModal: PropTypes.func,
+ notificationType: PropTypes.string,
+ notificationContentNumber: PropTypes.number,
+ config: PropTypes.object
};