Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

tooltip for great circle checkbox. measure button styles for mobile

Jason Kent486a5c296a07
diff --git a/web/css/measure.css b/web/css/measure.css
index 4b7cc5146..99c657269 100644
--- a/web/css/measure.css
+++ b/web/css/measure.css
@@ -4,6 +4,7 @@
right: 10px;
padding: 6px 10px;
}
+
.modal-dialog.toolbar-modal.measure-tool-modal {
top: unset;
right: 10px;
@@ -25,6 +26,16 @@
}
}
+@media (max-width: 740px) {
+ .wv-measure-button {
+ bottom: 10px;
+ }
+ .modal-dialog.toolbar-modal.measure-tool-modal {
+ bottom: 55px;
+ margin: 0;
+ }
+}
+
.measure-unit-toggle {
border-bottom: 1px solid rgba(255, 255, 255, 0.25);
padding: 6px 5px 6px 27px;
diff --git a/web/js/components/measure-tool/measure-menu.js b/web/js/components/measure-tool/measure-menu.js
index f637d3c4d..e39291def 100644
--- a/web/js/components/measure-tool/measure-menu.js
+++ b/web/js/components/measure-tool/measure-menu.js
@@ -5,7 +5,7 @@ import { onToggle } from '../../modules/modal/actions';
import IconList from '../util/list';
import { changeUnits, useGreatCircle } from '../../modules/measure/actions';
import { Form, FormGroup, Label, Input, Tooltip } from 'reactstrap';
-import AlertUtil from '../util/alert';
+// import AlertUtil from '../util/alert';
// import googleTagManager from 'googleTagManager';
const OPTIONS_ARRAY = [
@@ -33,8 +33,8 @@ class MeasureMenu extends Component {
constructor(props) {
super(props);
this.state = {
+ showAlert: false,
tooltipOpen: false,
- units: props.units,
useGreatCircleMeasurements: props.useGreatCircleMeasurements
};
this.tooltipToggle = this.tooltipToggle.bind(this);
@@ -43,6 +43,11 @@ class MeasureMenu extends Component {
triggerEvent(eventName) {
const { map, onCloseModal } = this.props;
map.ui.events.trigger(eventName);
+ if (eventName !== 'measure-clear') {
+ this.setState({
+ showAlert: true
+ });
+ }
onCloseModal();
}
@@ -64,17 +69,19 @@ class MeasureMenu extends Component {
}
render() {
- const { clickType } = this.props;
- const isMobile = clickType === 'touchstart';
+ // // const { clickType } = this.props;
+ // // const { showAlert } = this.state;
+ // const isMobile = true; // clickType === 'touchend';
+
return (
<>
- {isMobile && <AlertUtil
+ {/* {isMobile && <AlertUtil
isOpen={true}
timeout={15000}
iconClassName=' '
title='Measure Tool'
message='Tap to add a point. Double tap to complete.'
- />}
+ />} */}
<Form>
<FormGroup check>
@@ -83,9 +90,9 @@ class MeasureMenu extends Component {
id="great-circle-toggle"
type="checkbox"
onChange={this.useGreatCircle.bind(this)}
- defaultChecked={this.state.useGreatCircleMeasurements}
+ defaultChecked={this.props.useGreatCircleMeasurements}
/>
- {' '} Use Great circle <i id="great-circle-info" className="fas fa-info-circle"></i>
+ {' '} Use Great Circle <i id="great-circle-info" className="fas fa-info-circle"></i>
</Label>
<Tooltip
placement="top"
@@ -97,14 +104,15 @@ class MeasureMenu extends Component {
</Tooltip>
</FormGroup>
<div className="measure-unit-toggle custom-control custom-switch">
- <label htmlFor="unit-toggle">km</label>
<input
id="unit-toggle"
className="custom-control-input"
type="checkbox"
onChange={this.unitToggle.bind(this)}
- defaultChecked={this.state.units === 'mi'}/>
- <label className="custom-control-label" htmlFor="unit-toggle">mi</label>
+ defaultChecked={this.props.units === 'mi'}/>
+ <label className="custom-control-label" htmlFor="unit-toggle">
+ {this.props.units}
+ </label>
</div>
</Form>