|
@@ -67,6 +67,7 @@ import * as tdsy from "@/views/cockpit/js/tdsy";
|
|
|
import * as turf from "@turf/turf";
|
|
|
let gwtype;
|
|
|
let query_click = null;
|
|
|
+let manager_layer_png = null;
|
|
|
|
|
|
export default {
|
|
|
name: "clickQuery",
|
|
@@ -172,6 +173,10 @@ export default {
|
|
|
this.$nextTick((res) => {
|
|
|
query_click = new Cesium.CustomDataSource("query_click");
|
|
|
viewer.dataSources.add(query_click);
|
|
|
+
|
|
|
+ manager_layer_png = new Cesium.CustomDataSource("manager_layer_png");
|
|
|
+ viewer.dataSources.add(manager_layer_png);
|
|
|
+
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
@@ -428,56 +433,58 @@ export default {
|
|
|
}
|
|
|
|
|
|
// 结果高亮
|
|
|
- const outputCoords = this.convertCoordinates(e.features[0].geometry.points);
|
|
|
-
|
|
|
- outputCoords.push(outputCoords[0])
|
|
|
-
|
|
|
- let f = { "type": "Polygon", "coordinates": [outputCoords] };
|
|
|
- let result = turf.buffer(f, 1 / 99999, {
|
|
|
- units: "kilometers",
|
|
|
- });
|
|
|
-
|
|
|
- let positions = [];
|
|
|
- const twoDArray = result.geometry.coordinates[0];
|
|
|
- const oneDArray = twoDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
|
|
|
|
|
|
- positions = oneDArray;
|
|
|
-
|
|
|
-
|
|
|
- if (this.isArray2D(oneDArray)) {
|
|
|
- const oneDArray2 = oneDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
|
|
|
- positions = oneDArray2;
|
|
|
-
|
|
|
- } else {
|
|
|
-
|
|
|
- }
|
|
|
- query_click.entities.add({
|
|
|
- polygon: {
|
|
|
- // 获取指定属性(positions,holes(图形内需要挖空的区域))
|
|
|
- hierarchy: {
|
|
|
- positions: Cesium.Cartesian3.fromDegreesArray(positions)
|
|
|
- },
|
|
|
- // 边框
|
|
|
- outline: false,
|
|
|
- // 边框颜色
|
|
|
- outlineColor: Cesium.Color.RED,
|
|
|
- // 边框尺寸
|
|
|
- outlineWidth: 10,
|
|
|
- // 填充的颜色,withAlpha透明度
|
|
|
- material: Cesium.Color.RED,
|
|
|
-
|
|
|
- // 是否被提供的材质填充
|
|
|
- fill: true,
|
|
|
- // 恒定高度
|
|
|
- height: 1.1,
|
|
|
- // 显示在距相机的距离处的属性,多少区间内是可以显示的
|
|
|
- // distanceDisplayCondition: new Cesium.DistanceDisplayCondition(1000, 10000000),
|
|
|
- // 是否显示
|
|
|
- show: true,
|
|
|
- // 顺序,仅当`clampToGround`为true并且支持地形上的折线时才有效。
|
|
|
- zIndex: 10
|
|
|
- }
|
|
|
- });
|
|
|
+ this.highlightResultsPng(xy.lng, xy.lat);
|
|
|
+ // const outputCoords = this.convertCoordinates(e.features[0].geometry.points);
|
|
|
+
|
|
|
+ // outputCoords.push(outputCoords[0])
|
|
|
+
|
|
|
+ // let f = { "type": "Polygon", "coordinates": [outputCoords] };
|
|
|
+ // let result = turf.buffer(f, 1 / 99999, {
|
|
|
+ // units: "kilometers",
|
|
|
+ // });
|
|
|
+
|
|
|
+ // let positions = [];
|
|
|
+ // const twoDArray = result.geometry.coordinates[0];
|
|
|
+ // const oneDArray = twoDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
|
|
|
+
|
|
|
+ // positions = oneDArray;
|
|
|
+
|
|
|
+
|
|
|
+ // if (this.isArray2D(oneDArray)) {
|
|
|
+ // const oneDArray2 = oneDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
|
|
|
+ // positions = oneDArray2;
|
|
|
+
|
|
|
+ // } else {
|
|
|
+
|
|
|
+ // }
|
|
|
+ // query_click.entities.add({
|
|
|
+ // polygon: {
|
|
|
+ // // 获取指定属性(positions,holes(图形内需要挖空的区域))
|
|
|
+ // hierarchy: {
|
|
|
+ // positions: Cesium.Cartesian3.fromDegreesArray(positions)
|
|
|
+ // },
|
|
|
+ // // 边框
|
|
|
+ // outline: false,
|
|
|
+ // // 边框颜色
|
|
|
+ // outlineColor: Cesium.Color.RED,
|
|
|
+ // // 边框尺寸
|
|
|
+ // outlineWidth: 10,
|
|
|
+ // // 填充的颜色,withAlpha透明度
|
|
|
+ // material: Cesium.Color.RED,
|
|
|
+
|
|
|
+ // // 是否被提供的材质填充
|
|
|
+ // fill: true,
|
|
|
+ // // 恒定高度
|
|
|
+ // height: 1.1,
|
|
|
+ // // 显示在距相机的距离处的属性,多少区间内是可以显示的
|
|
|
+ // // distanceDisplayCondition: new Cesium.DistanceDisplayCondition(1000, 10000000),
|
|
|
+ // // 是否显示
|
|
|
+ // show: true,
|
|
|
+ // // 顺序,仅当`clampToGround`为true并且支持地形上的折线时才有效。
|
|
|
+ // zIndex: 10
|
|
|
+ // }
|
|
|
+ // });
|
|
|
|
|
|
|
|
|
if (e && e.totalCount > 0) {
|
|
@@ -627,6 +634,22 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ highlightResultsPng(longitude, latitude) {
|
|
|
+ manager_layer_png.entities.add({
|
|
|
+ name: "manager_layer_png",
|
|
|
+ position: Cesium.Cartesian3.fromDegrees(longitude, latitude, 40),
|
|
|
+ billboard: {
|
|
|
+ // 图像地址,URI或Canvas的属性
|
|
|
+ image: "./static/images/overview/go.png",
|
|
|
+ height: 34,
|
|
|
+ width: 36,
|
|
|
+ scale: 1.0,
|
|
|
+ zIndex: 2,
|
|
|
+ show: true
|
|
|
+ },
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
addLayerList(label) {
|
|
|
if (this.layerList.findIndex((a) => a.label == label) >= 0) return;
|
|
|
let layers = store.state.vectorlayerlist.filter(
|
|
@@ -791,6 +814,13 @@ export default {
|
|
|
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ // 图标
|
|
|
+ var entities = manager_layer_png.entities.values;
|
|
|
+ for (var i = entities.length - 1; i >= 0; i--) {
|
|
|
+ manager_layer_png.entities.remove(entities[i]);
|
|
|
+ }
|
|
|
},
|
|
|
//地图数据查询事件
|
|
|
changleQueryItem(item) {
|