diff --git a/ui/src/Components/Visualizer/Visualizer.jsx b/ui/src/Components/Visualizer/Visualizer.jsx index 6b79cfd6..072e2a47 100644 --- a/ui/src/Components/Visualizer/Visualizer.jsx +++ b/ui/src/Components/Visualizer/Visualizer.jsx @@ -8,7 +8,6 @@ import Labels from "./Labels"; import { AppContext } from "../../AppContext"; import PropType from "prop-types"; import { convertDateToString } from "../../util/conversion"; -import VisualizerImageryControls from "./VisualizerImageryControls" import "../../assets/css/visualizer.css"; import { getAzureMapsAuthOptions } from "../../util/azureMapsAuth"; import { shouldIgnoreShortcut } from "../keyboardShortcuts"; @@ -30,13 +29,6 @@ const Visualizer = ({ setModalComponent }) => { const zoomControlRef = useRef(null); const [swipeStateMobile, setSwipeStateMobile] = useState("post"); - const [imageryValues, setImageryValues] = useState({ - opacity: 1, - contrast: 0, - hueRotation: 0, - saturation: 0, - }); - // Visualizer data fetching function async function getVisualizerResults() { setIsLoading(true); @@ -397,60 +389,6 @@ const Visualizer = ({ setModalComponent }) => { } } - const updateImageryProperties = (key, value) => { - try { - - var preImageryRef = getLayerById(primaryMapRef, "preDisasterImagery"); - var postImageryRef = getLayerById(secondaryMapRef, "postDisasterImagery"); - - preImageryRef.setOptions({ - [key]: value, - }); - - postImageryRef.setOptions({ - [key]: value, - }); - - setImageryValues({ - ...imageryValues, - [key]: value, - }); - - } catch (error) { - console.error("Error updating imagery values:", error); - } - }; - - const resetImageryProperties = () => { - try { - - var preImageryRef = getLayerById(primaryMapRef, "preDisasterImagery"); - var postImageryRef = getLayerById(secondaryMapRef, "postDisasterImagery"); - - preImageryRef.setOptions({ - opacity: 1, - contrast: 0, - hueRotation: 0, - saturation: 0, - }); - - postImageryRef.setOptions({ - opacity: 1, - contrast: 0, - hueRotation: 0, - saturation: 0, - }); - - setImageryValues({ - opacity: 1, - contrast: 0, - hueRotation: 0, - saturation: 0, - }); - } catch (error) { - console.error("Error resetting imagery values:", error); - } - }; return ( @@ -467,13 +405,6 @@ const Visualizer = ({ setModalComponent }) => { setSwipeStateMobile={setSwipeStateMobile} swipeStateMobile={swipeStateMobile} /> - - ); }; diff --git a/ui/src/Components/Visualizer/VisualizerImageryControls.jsx b/ui/src/Components/Visualizer/VisualizerImageryControls.jsx deleted file mode 100644 index e1078220..00000000 --- a/ui/src/Components/Visualizer/VisualizerImageryControls.jsx +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -import { - Slider, - Button, - Field, - makeStyles, - tokens, -} from "@fluentui/react-components"; -import { FluentIcon } from "../../util/icons"; - -import PropTypes from "prop-types"; - -const useStyles = makeStyles({ - surface: { - color: tokens.colorNeutralForeground1, - backgroundColor: tokens.colorNeutralBackground1, - border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`, - boxShadow: tokens.shadow8, - }, -}); - -const VisualizerImageryControls = ({ updateImageryProperties, resetImageryProperties, imageryValues, visualizerResults}) => { - const styles = useStyles(); - - return ( - <> - {visualizerResults.projectName && ( -
-
-
- - Opacity - {Math.round(imageryValues.opacity * 100)}% - - } - > - updateImageryProperties("opacity", data.value)} - value={imageryValues.opacity} - /> - - - - Contrast - {imageryValues.contrast.toFixed(2)} - - } - > - updateImageryProperties("contrast", data.value)} - value={imageryValues.contrast} - /> - - - - Hue Rotation - {imageryValues.hueRotation}° - - } - > - updateImageryProperties("hueRotation", data.value)} - value={imageryValues.hueRotation} - /> - - - - Saturation - {imageryValues.saturation.toFixed(2)} - - } - > - updateImageryProperties("saturation", data.value)} - value={imageryValues.saturation} - /> - - - -
-
-
- )} - - ); -}; - -VisualizerImageryControls.propTypes = { - updateImageryProperties: PropTypes.func.isRequired, - resetImageryProperties: PropTypes.func.isRequired, - imageryValues: PropTypes.object.isRequired, - visualizerResults: PropTypes.object.isRequired, -}; - -export default VisualizerImageryControls;