|
@@ -1,70 +1,141 @@
|
|
|
<template>
|
|
|
- <div class="ZTGlobal" style="width: 100%; padding: 1rem 1rem 0rem 1rem; color: white">
|
|
|
- <el-row :gutter="5" style="border: 1px dashed #02a7f0; padding: 0.5rem; color: #ffffff">
|
|
|
+ <div
|
|
|
+ class="ZTGlobal"
|
|
|
+ style="width: 100%; padding: 1rem 1rem 0rem 1rem; color: white"
|
|
|
+ >
|
|
|
+ <el-row
|
|
|
+ :gutter="5"
|
|
|
+ style="border: 1px dashed #02a7f0; padding: 0.5rem; color: #ffffff"
|
|
|
+ >
|
|
|
定点分析:
|
|
|
<el-row :gutter="5">
|
|
|
观察者高度(米):
|
|
|
- <el-input-number size="small" label="观察者高度:" min="0" max="50" :step="0.5" precision="1"
|
|
|
- v-model="personH"></el-input-number>
|
|
|
- <el-col :span="8"><el-button size="mini" type="default" @click="addGCD">添加观察点</el-button>
|
|
|
+ <el-input-number
|
|
|
+ size="small"
|
|
|
+ label="观察者高度:"
|
|
|
+ min="0"
|
|
|
+ max="50"
|
|
|
+ :step="0.5"
|
|
|
+ precision="1"
|
|
|
+ v-model="personH"
|
|
|
+ ></el-input-number>
|
|
|
+ <el-col :span="8"
|
|
|
+ ><el-button size="mini" type="default" @click="addGCD"
|
|
|
+ >添加观察点</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
- <el-col :span="8"><el-button size="mini" type="default" @click="addTagget">添加目标点</el-button>
|
|
|
+ <el-col :span="8"
|
|
|
+ ><el-button size="mini" type="default" @click="addTagget"
|
|
|
+ >添加目标点</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
<el-col :span="7">
|
|
|
- <el-button size="mini" type="default" @click="changeView">切换视角</el-button>
|
|
|
+ <el-button size="mini" type="default" @click="changeView"
|
|
|
+ >切换视角</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
绿线为可见区域,红线为不可见区域
|
|
|
</el-row>
|
|
|
- <el-row :gutter="5" style="border: 1px dashed #02a7f0; padding: 0.5rem; color: #ffffff">
|
|
|
+ <el-row
|
|
|
+ :gutter="5"
|
|
|
+ style="border: 1px dashed #02a7f0; padding: 0.5rem; color: #ffffff"
|
|
|
+ >
|
|
|
环视分析:
|
|
|
<el-row :gutter="5">
|
|
|
- <el-col :span="8"><el-button size="mini" type="default" @click="addCirclePoint">添加环视点</el-button>
|
|
|
+ <el-col :span="8"
|
|
|
+ ><el-button size="mini" type="default" @click="addCirclePoint"
|
|
|
+ >添加环视点</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row :gutter="5">
|
|
|
<el-col :span="10"> 环视角度(度): </el-col>
|
|
|
<el-col :span="10">
|
|
|
- <el-input-number size="mini" v-model="circlePitch" min="0" max="90"
|
|
|
- @change="circlePitchChange"></el-input-number></el-col>
|
|
|
+ <el-input-number
|
|
|
+ size="mini"
|
|
|
+ v-model="circlePitch"
|
|
|
+ min="0"
|
|
|
+ max="90"
|
|
|
+ @change="circlePitchChange"
|
|
|
+ ></el-input-number
|
|
|
+ ></el-col>
|
|
|
</el-row>
|
|
|
<el-row :gutter="5">
|
|
|
<el-col :span="10"> 环视高度(米):</el-col>
|
|
|
<el-col :span="10">
|
|
|
- <el-input-number size="mini" v-model="circleH" min="0" max="5000" @change="circlePitchChange"></el-input-number>
|
|
|
+ <el-input-number
|
|
|
+ size="mini"
|
|
|
+ v-model="circleH"
|
|
|
+ min="0"
|
|
|
+ max="5000"
|
|
|
+ @change="circlePitchChange"
|
|
|
+ ></el-input-number>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
- <el-col :span="8"><el-button ref="flyCrile" size="mini" type="default" @click="targetRing()">{{ flyCircleText
|
|
|
- }}</el-button>
|
|
|
+ <el-col :span="8"
|
|
|
+ ><el-button
|
|
|
+ ref="flyCrile"
|
|
|
+ size="mini"
|
|
|
+ type="default"
|
|
|
+ @click="targetRing()"
|
|
|
+ >{{ flyCircleText }}</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-row>
|
|
|
- <el-row :gutter="5" style="border: 1px dashed #02a7f0; padding: 0.5rem; color: #ffffff">
|
|
|
+ <el-row
|
|
|
+ :gutter="5"
|
|
|
+ style="border: 1px dashed #02a7f0; padding: 0.5rem; color: #ffffff"
|
|
|
+ >
|
|
|
沿线飞行:
|
|
|
<el-row :gutter="2">
|
|
|
- <el-col :span="8"><el-button size="mini" type="default" @click="addPolyline">绘制线</el-button>
|
|
|
+ <el-col :span="8"
|
|
|
+ ><el-button size="mini" type="default" @click="addPolyline"
|
|
|
+ >绘制线</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
- <el-col :span="8"><el-button size="mini" type="default" @click="startPolylineFly">飞行</el-button>
|
|
|
+ <el-col :span="8"
|
|
|
+ ><el-button size="mini" type="default" @click="startPolylineFly"
|
|
|
+ >飞行</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
- <el-col :span="8"><el-button size="mini" type="default" @click="stopPolylineFly">停止飞行</el-button>
|
|
|
+ <el-col :span="8"
|
|
|
+ ><el-button size="mini" type="default" @click="stopPolylineFly"
|
|
|
+ >停止飞行</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row :gutter="2">
|
|
|
飞行高度(米):
|
|
|
- <el-input-number size="small" label="飞行高度:" min="0" max="2000" v-model="flyH"
|
|
|
- @change="flyChange"></el-input-number>
|
|
|
+ <el-input-number
|
|
|
+ size="small"
|
|
|
+ label="飞行高度:"
|
|
|
+ min="0"
|
|
|
+ max="2000"
|
|
|
+ v-model="flyH"
|
|
|
+ @change="flyChange"
|
|
|
+ ></el-input-number>
|
|
|
</el-row>
|
|
|
<el-row :gutter="2">
|
|
|
飞行速度(km/h):
|
|
|
- <el-input-number size="small" label="飞行速度:" min="0" max="120" v-model="flySpeed"
|
|
|
- @change="flyChange"></el-input-number>
|
|
|
+ <el-input-number
|
|
|
+ size="small"
|
|
|
+ label="飞行速度:"
|
|
|
+ min="0"
|
|
|
+ max="120"
|
|
|
+ v-model="flySpeed"
|
|
|
+ @change="flyChange"
|
|
|
+ ></el-input-number>
|
|
|
</el-row>
|
|
|
</el-row>
|
|
|
<el-row> </el-row>
|
|
|
<el-row :gutter="5">
|
|
|
<el-col :span="8">
|
|
|
- <el-button size="mini" type="default" @click="clearScope">清除</el-button>
|
|
|
+ <el-button size="mini" type="default" @click="clearScope"
|
|
|
+ >清除</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
@@ -81,7 +152,6 @@ let handlerPoint = null; //绘制线
|
|
|
var sightline;
|
|
|
var flyManager;
|
|
|
|
|
|
-
|
|
|
var points = [];
|
|
|
export default {
|
|
|
data() {
|
|
@@ -139,7 +209,6 @@ export default {
|
|
|
sightline.build();
|
|
|
handlerPoint = new Cesium.DrawHandler(viewer, Cesium.DrawMode.Point);
|
|
|
scene.undergroundMode = false;
|
|
|
-
|
|
|
},
|
|
|
methods: {
|
|
|
/**
|
|
@@ -195,7 +264,6 @@ export default {
|
|
|
* 输入点
|
|
|
*/
|
|
|
setInput() {
|
|
|
-
|
|
|
var that = this;
|
|
|
that.changCount = 0;
|
|
|
handlerPoint = new Cesium.DrawHandler(viewer, Cesium.DrawMode.Point);
|
|
@@ -244,13 +312,14 @@ export default {
|
|
|
show: true,
|
|
|
text: "观察点",
|
|
|
font: "15px sans-serif",
|
|
|
- pixelOffset: new Cesium.Cartesian2(60, -100), //文字偏移
|
|
|
+ pixelOffset: new Cesium.Cartesian2(0, -20), //文字偏移
|
|
|
fillColor: Cesium.Color.RED,
|
|
|
// backgroundColor:new Cesium.Color(0, 0, 0, 1),
|
|
|
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(
|
|
|
0,
|
|
|
1500
|
|
|
), //达到一定高度隐藏
|
|
|
+ disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
|
|
},
|
|
|
});
|
|
|
// that.points.push(entity)
|
|
@@ -294,13 +363,14 @@ export default {
|
|
|
show: true,
|
|
|
text: "目标点",
|
|
|
font: "15px sans-serif",
|
|
|
- pixelOffset: new Cesium.Cartesian2(60, -20), //文字偏移
|
|
|
+ pixelOffset: new Cesium.Cartesian2(0, -20), //文字偏移
|
|
|
fillColor: Cesium.Color.WHITE,
|
|
|
// backgroundColor:new Cesium.Color(0, 0, 0, 1),
|
|
|
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(
|
|
|
0,
|
|
|
1500
|
|
|
), //达到一定高度隐藏
|
|
|
+ disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
|
|
},
|
|
|
});
|
|
|
points.push(labelentity);
|
|
@@ -335,13 +405,14 @@ export default {
|
|
|
show: true,
|
|
|
text: "环视点",
|
|
|
font: "15px sans-serif",
|
|
|
- pixelOffset: new Cesium.Cartesian2(60, -20), //文字偏移
|
|
|
+ pixelOffset: new Cesium.Cartesian2(0, -20), //文字偏移
|
|
|
fillColor: Cesium.Color.WHITE,
|
|
|
// backgroundColor:new Cesium.Color(0, 0, 0, 1),
|
|
|
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(
|
|
|
0,
|
|
|
1500
|
|
|
), //达到一定高度隐藏
|
|
|
+ disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
|
|
},
|
|
|
});
|
|
|
points.push(labelentity);
|
|
@@ -382,8 +453,6 @@ export default {
|
|
|
sightline._currentTargetPoint[1],
|
|
|
sightline._currentTargetPoint[2],
|
|
|
];
|
|
|
-
|
|
|
-
|
|
|
} else {
|
|
|
point1 = [
|
|
|
sightline._currentTargetPoint[0],
|
|
@@ -395,7 +464,6 @@ export default {
|
|
|
sightline.viewPosition[1],
|
|
|
sightline.viewPosition[2],
|
|
|
];
|
|
|
-
|
|
|
}
|
|
|
var positionA = Cesium.Cartesian3.fromDegrees(
|
|
|
point1[0],
|
|
@@ -450,7 +518,7 @@ export default {
|
|
|
scene.camera.stopFlyCircle();
|
|
|
this.flyCircleText = "环视漫游";
|
|
|
this.changCount = 0;
|
|
|
- scene.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)
|
|
|
+ scene.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
|
|
|
},
|
|
|
/**
|
|
|
* 目标点环视
|
|
@@ -472,7 +540,10 @@ export default {
|
|
|
// roll: 0.0, // default value
|
|
|
// },
|
|
|
// });
|
|
|
- scene.camera.lookAt(position, new Cesium.HeadingPitchRange(0, that.circlePitch * -1, that.circleH));
|
|
|
+ scene.camera.lookAt(
|
|
|
+ position,
|
|
|
+ new Cesium.HeadingPitchRange(0, that.circlePitch * -1, that.circleH)
|
|
|
+ );
|
|
|
scene.camera.flyCircle(position);
|
|
|
|
|
|
// scene.camera.setView({
|
|
@@ -494,7 +565,7 @@ export default {
|
|
|
} else {
|
|
|
that.flyCircleText = "环视漫游";
|
|
|
scene.camera.stopFlyCircle();
|
|
|
- scene.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)
|
|
|
+ scene.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -523,7 +594,6 @@ export default {
|
|
|
* 绘制飞行线
|
|
|
*/
|
|
|
addPolyline() {
|
|
|
-
|
|
|
var that = this;
|
|
|
that.clearScope();
|
|
|
that.lineFylPoints = [];
|
|
@@ -536,7 +606,10 @@ export default {
|
|
|
var positions = result.object.positions;
|
|
|
for (var i = 0; i < positions.length; i++) {
|
|
|
if (i < positions.length - 1)
|
|
|
- that.lineLength += that.getLineLentByPoints(positions[i], positions[i + 1])
|
|
|
+ that.lineLength += that.getLineLentByPoints(
|
|
|
+ positions[i],
|
|
|
+ positions[i + 1]
|
|
|
+ );
|
|
|
|
|
|
var cartographic = that.Cartesian2toDegrees(positions[i]);
|
|
|
that.lineFylPoints.push(cartographic);
|
|
@@ -644,7 +717,7 @@ export default {
|
|
|
routes.routes[0].isFlyLoop = true;
|
|
|
flyManager = new Cesium.FlyManager({
|
|
|
scene: scene,
|
|
|
- routes: routes
|
|
|
+ routes: routes,
|
|
|
});
|
|
|
|
|
|
//初始化飞行管理
|
|
@@ -665,8 +738,13 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
getLineLentByPoints(point1, point2) {
|
|
|
- var d2L = Math.sqrt((point2.y - point1.y) * (point2.y - point1.y) + (point2.x - point1.x) * (point2.x - point1.x))
|
|
|
- var d3L = Math.sqrt((point2.z - point1.z) * (point2.z - point1.z) + d2L * d2L)
|
|
|
+ var d2L = Math.sqrt(
|
|
|
+ (point2.y - point1.y) * (point2.y - point1.y) +
|
|
|
+ (point2.x - point1.x) * (point2.x - point1.x)
|
|
|
+ );
|
|
|
+ var d3L = Math.sqrt(
|
|
|
+ (point2.z - point1.z) * (point2.z - point1.z) + d2L * d2L
|
|
|
+ );
|
|
|
return d3L;
|
|
|
},
|
|
|
flyChange() {
|
|
@@ -678,9 +756,9 @@ export default {
|
|
|
that.lineFylPoints[index][0],
|
|
|
that.lineFylPoints[index][1],
|
|
|
that.lineFylPoints[index][2] + that.flyH - that.flyHOld
|
|
|
- )
|
|
|
- })
|
|
|
- that.flyHOld = that.flyH
|
|
|
+ );
|
|
|
+ });
|
|
|
+ that.flyHOld = that.flyH;
|
|
|
flyManager && flyManager.play();
|
|
|
},
|
|
|
/**
|
|
@@ -690,7 +768,6 @@ export default {
|
|
|
// var allStops = flyManager.getAllRouteStops();
|
|
|
// flyManager.viewToStop(allStops[allStops.length - 1]);
|
|
|
flyManager && flyManager.stop();
|
|
|
-
|
|
|
},
|
|
|
},
|
|
|
beforeDestroy() {
|