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) {