From 9302be89c593a9aca80c8c4246083f229fbf9130 Mon Sep 17 00:00:00 2001 From: hym Date: Tue, 25 Nov 2025 21:11:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BD=A8=E8=BF=B9=E9=AB=98?= =?UTF-8?q?=E4=BA=AE=E6=8E=A7=E4=BB=B6=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/dataSearch.vue | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/views/dataSearch.vue b/src/views/dataSearch.vue index 966f792..7dea0c1 100644 --- a/src/views/dataSearch.vue +++ b/src/views/dataSearch.vue @@ -478,6 +478,10 @@ export default { }, // 添加高亮图层 addHighlightLayer(voyageName, i) { + Vue.config.maps["dataSearch"].setPaintProperty(`vector-${voyageName}-line`, "line-width", 4); + this.dataList[i].highlight = true; + return; + this.clearHighlight() const highlightLayer = new Cesium.WebMapTileServiceImageryProvider({ url: `${this.CesiumHostAddr}geoserver/gwc/service/wmts/rest/dsds:${voyageName}-highlight/{TileMatrixSet}/{TileMatrixSet}:{TileMatrix}/{TileRow}/{TileCol}?format=image/png`, @@ -493,6 +497,18 @@ export default { }, // 清除高亮 clearHighlight(voyageName, i) { + let lineWidthExpression = [ + "case", + ["boolean", ["feature-state", "hover"], false], + 4, + ["boolean", ["feature-state", "click"], false], + 2, + 1.8 + ]; + Vue.config.maps["dataSearch"].setPaintProperty(`vector-${voyageName}-line`, "line-width", lineWidthExpression); + this.dataList[i].highlight = false; + return; + this.dataList.map(item => { item.highlight = false }) // 移除地图上的高亮图层 if (this.highlightLayer) {