From 3fa17bb755f38086737ef0503c1c2c23c6060d23 Mon Sep 17 00:00:00 2001 From: baol Date: Mon, 6 Nov 2023 16:29:26 +0800 Subject: [PATCH] refactor --- .../ClimateReconDataAssim/ImageLayer.jsx | 8 +++----- .../ClimateReconDataAssim/ResultPanel.jsx | 2 +- .../ClimateReconDataAssim/index.jsx | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/catalog/IntegrationAndOnlineCalc/ClimateReconDataAssim/ImageLayer.jsx b/src/components/catalog/IntegrationAndOnlineCalc/ClimateReconDataAssim/ImageLayer.jsx index df89c32..83be244 100644 --- a/src/components/catalog/IntegrationAndOnlineCalc/ClimateReconDataAssim/ImageLayer.jsx +++ b/src/components/catalog/IntegrationAndOnlineCalc/ClimateReconDataAssim/ImageLayer.jsx @@ -3,27 +3,25 @@ import { ImageryLayer } from "resium"; import { WebMapServiceImageryProvider } from "cesium"; const url = "http://analysis.tpdc.ac.cn/gs/geoserver/phitrellis/wms"; -const name = "phitrellis:4_5_heatmap_htmp"; export default function ImageLayer({ yearRange }) { const tempProvider = useMemo( () => new WebMapServiceImageryProvider({ url: url, - layers: name, + layers: yearRange, parameters: { service: "WMS", format: "image/png", transparent: true, }, }), - [name, url] + [yearRange, url] ); - return null; return ( { - setYearRange(e.target.value.split(" ~ ")); + setYearRange(e.target.value.split(" ~ ").join("-")); }); setTimeout(() => { diff --git a/src/components/catalog/IntegrationAndOnlineCalc/ClimateReconDataAssim/index.jsx b/src/components/catalog/IntegrationAndOnlineCalc/ClimateReconDataAssim/index.jsx index 8fc93eb..e3b33e0 100644 --- a/src/components/catalog/IntegrationAndOnlineCalc/ClimateReconDataAssim/index.jsx +++ b/src/components/catalog/IntegrationAndOnlineCalc/ClimateReconDataAssim/index.jsx @@ -10,7 +10,7 @@ import styles from "./index.module.less"; function ClimateReconDataAssim() { const [showResult, setShowResult] = useState(false); const [yearRange, setYearRange] = useState([]); - + console.log(yearRange); return (