增加轨迹高亮控件逻辑
This commit is contained in:
parent
20444e9243
commit
9302be89c5
|
|
@ -478,6 +478,10 @@ export default {
|
||||||
},
|
},
|
||||||
// 添加高亮图层
|
// 添加高亮图层
|
||||||
addHighlightLayer(voyageName, i) {
|
addHighlightLayer(voyageName, i) {
|
||||||
|
Vue.config.maps["dataSearch"].setPaintProperty(`vector-${voyageName}-line`, "line-width", 4);
|
||||||
|
this.dataList[i].highlight = true;
|
||||||
|
return;
|
||||||
|
|
||||||
this.clearHighlight()
|
this.clearHighlight()
|
||||||
const highlightLayer = new Cesium.WebMapTileServiceImageryProvider({
|
const highlightLayer = new Cesium.WebMapTileServiceImageryProvider({
|
||||||
url: `${this.CesiumHostAddr}geoserver/gwc/service/wmts/rest/dsds:${voyageName}-highlight/{TileMatrixSet}/{TileMatrixSet}:{TileMatrix}/{TileRow}/{TileCol}?format=image/png`,
|
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) {
|
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 })
|
this.dataList.map(item => { item.highlight = false })
|
||||||
// 移除地图上的高亮图层
|
// 移除地图上的高亮图层
|
||||||
if (this.highlightLayer) {
|
if (this.highlightLayer) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue