|
@@ -1,72 +1,139 @@
|
|
|
<template>
|
|
|
- <div class="ZTGlobal" style="width: 100%; padding: 1rem 1rem 0rem 1rem; color: white">
|
|
|
-
|
|
|
- <el-row :gutter="5" style="border: 1px solid #06c4f3;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 solid #06c4f3; 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 solid #06c4f3; padding: 0.5rem;color: #ffffff;">
|
|
|
+ <el-row
|
|
|
+ :gutter="5"
|
|
|
+ style="border: 1px solid #06c4f3; 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-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-col>
|
|
|
- <el-col :span="10">
|
|
|
- <el-input-number size="mini" v-model="circleH" min="0" max="5000" @change="circleHChange"></el-input-number>
|
|
|
+ <el-input-number
|
|
|
+ size="mini"
|
|
|
+ v-model="circleH"
|
|
|
+ min="0"
|
|
|
+ max="5000"
|
|
|
+ @change="circleHChange"
|
|
|
+ ></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 solid #06c4f3; padding: 0.5rem;color: #ffffff;">
|
|
|
+ <el-row
|
|
|
+ :gutter="5"
|
|
|
+ style="border: 1px solid #06c4f3; 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"></el-input-number>
|
|
|
+ <el-input-number
|
|
|
+ size="small"
|
|
|
+ label="飞行高度:"
|
|
|
+ min="0"
|
|
|
+ max="2000"
|
|
|
+ v-model="flyH"
|
|
|
+ ></el-input-number>
|
|
|
</el-row>
|
|
|
<el-row :gutter="2">
|
|
|
飞行速度(km/h):
|
|
|
- <el-input-number size="small" label="飞行速度:" min="0" max="120" v-model="flySpeed"></el-input-number>
|
|
|
+ <el-input-number
|
|
|
+ size="small"
|
|
|
+ label="飞行速度:"
|
|
|
+ min="0"
|
|
|
+ max="120"
|
|
|
+ v-model="flySpeed"
|
|
|
+ ></el-input-number>
|
|
|
</el-row>
|
|
|
</el-row>
|
|
|
- <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>
|
|
@@ -83,11 +150,12 @@ import {
|
|
|
let handlerPoint = null; //绘制线
|
|
|
var sightline;
|
|
|
var flyManager;
|
|
|
+var points = [];
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
tooltip: createTooltip(document.body),
|
|
|
- points: [],
|
|
|
+ // points: [],
|
|
|
addViewFlag: false, //当前点击状态是否是 添加观察点
|
|
|
addTargetFlag: false, //当前点击状态是否是 添加目标点,
|
|
|
|
|
@@ -103,7 +171,7 @@ export default {
|
|
|
circleH: 500,
|
|
|
flyH: 20,
|
|
|
flySpeed: 50,
|
|
|
- lineFylPoints: []
|
|
|
+ lineFylPoints: [],
|
|
|
};
|
|
|
},
|
|
|
props: {
|
|
@@ -147,7 +215,7 @@ export default {
|
|
|
that.addViewFlag = true;
|
|
|
that.addTargetFlag = false;
|
|
|
|
|
|
- that.addCircleFlag = false
|
|
|
+ that.addCircleFlag = false;
|
|
|
|
|
|
that.isFrom2To = true;
|
|
|
if (handlerPoint) handlerPoint.clear();
|
|
@@ -171,7 +239,7 @@ export default {
|
|
|
let that = this;
|
|
|
that.addViewFlag = false;
|
|
|
that.addTargetFlag = true;
|
|
|
- that.addCircleFlag = false
|
|
|
+ that.addCircleFlag = false;
|
|
|
that.setInput();
|
|
|
},
|
|
|
/**
|
|
@@ -181,7 +249,7 @@ export default {
|
|
|
let that = this;
|
|
|
that.addViewFlag = false;
|
|
|
that.addTargetFlag = false;
|
|
|
- that.addCircleFlag = true
|
|
|
+ that.addCircleFlag = true;
|
|
|
that.setInput();
|
|
|
},
|
|
|
/**
|
|
@@ -205,9 +273,9 @@ export default {
|
|
|
cartographic[2] += that.personH;
|
|
|
sightline.viewPosition = cartographic;
|
|
|
that.addViewFlag = false;
|
|
|
- viewer.entities.removeById('gcPoint');
|
|
|
+ viewer.entities.removeById("gcPoint");
|
|
|
var labelentity = new Cesium.Entity({
|
|
|
- id: 'gcPoint',
|
|
|
+ id: "gcPoint",
|
|
|
position: Cesium.Cartesian3.fromDegrees(
|
|
|
cartographic[0],
|
|
|
cartographic[1],
|
|
@@ -246,7 +314,7 @@ export default {
|
|
|
// that.points.push(entity)
|
|
|
// viewer.entities.add(entity);
|
|
|
that.gcPoint = cartographic;
|
|
|
- that.points.push(labelentity);
|
|
|
+ points.push(labelentity);
|
|
|
viewer.entities.add(labelentity);
|
|
|
} else if (that.addTargetFlag) {
|
|
|
//添加目标点
|
|
@@ -255,9 +323,9 @@ export default {
|
|
|
position: cartographic,
|
|
|
name: "目标点",
|
|
|
});
|
|
|
- viewer.entities.removeById('targetPoint');
|
|
|
+ viewer.entities.removeById("targetPoint");
|
|
|
var labelentity = new Cesium.Entity({
|
|
|
- id: 'targetPoint',
|
|
|
+ id: "targetPoint",
|
|
|
position: position,
|
|
|
point: {
|
|
|
// 点的大小(像素)
|
|
@@ -289,17 +357,16 @@ export default {
|
|
|
), //达到一定高度隐藏
|
|
|
},
|
|
|
});
|
|
|
- that.points.push(labelentity);
|
|
|
+ points.push(labelentity);
|
|
|
viewer.entities.add(labelentity);
|
|
|
that.addTargetFlag = false;
|
|
|
that.targetPoint = cartographic;
|
|
|
sightline.build();
|
|
|
that.ComputationalPerspective();
|
|
|
- }
|
|
|
- else if (that.addCircleFlag) {
|
|
|
- viewer.entities.removeById('circlePoint');
|
|
|
+ } else if (that.addCircleFlag) {
|
|
|
+ viewer.entities.removeById("circlePoint");
|
|
|
var labelentity = new Cesium.Entity({
|
|
|
- id: 'circlePoint',
|
|
|
+ id: "circlePoint",
|
|
|
position: position,
|
|
|
point: {
|
|
|
// 点的大小(像素)
|
|
@@ -331,7 +398,7 @@ export default {
|
|
|
), //达到一定高度隐藏
|
|
|
},
|
|
|
});
|
|
|
- that.points.push(labelentity);
|
|
|
+ points.push(labelentity);
|
|
|
viewer.entities.add(labelentity);
|
|
|
that.addCircleFlag = false;
|
|
|
that.circlPoint = cartographic;
|
|
@@ -347,9 +414,14 @@ export default {
|
|
|
ComputationalPerspective() {
|
|
|
var point1;
|
|
|
var point2;
|
|
|
- debugger
|
|
|
- if (sightline.viewPosition[0] == 0 || sightline.viewPosition[1] == 0 || sightline._currentTargetPoint[0] == 0 || sightline._currentTargetPoint[1] == 0) {
|
|
|
- this.$message.warning("请添加观察点或目标点")
|
|
|
+ debugger;
|
|
|
+ if (
|
|
|
+ sightline.viewPosition[0] == 0 ||
|
|
|
+ sightline.viewPosition[1] == 0 ||
|
|
|
+ sightline._currentTargetPoint[0] == 0 ||
|
|
|
+ sightline._currentTargetPoint[1] == 0
|
|
|
+ ) {
|
|
|
+ this.$message.warning("请添加观察点或目标点");
|
|
|
return;
|
|
|
}
|
|
|
if (this.isFrom2To) {
|
|
@@ -417,51 +489,52 @@ export default {
|
|
|
*/
|
|
|
clearScope() {
|
|
|
viewer.entities.removeAll();
|
|
|
- this.points = [];
|
|
|
+ points = [];
|
|
|
sightline.removeAllTargetPoint();
|
|
|
if (handlerPoint) {
|
|
|
handlerPoint.clear();
|
|
|
handlerPoint.deactivate();
|
|
|
}
|
|
|
this.tooltip.setVisible(false);
|
|
|
- if (flyManager)
|
|
|
- flyManager.stop();
|
|
|
+ if (flyManager) flyManager.stop();
|
|
|
flyManager = null;
|
|
|
this.lineFylPoints = [];
|
|
|
scene.camera.stopFlyCircle();
|
|
|
- this.flyCircleText = '环视漫游'
|
|
|
+ this.flyCircleText = "环视漫游";
|
|
|
},
|
|
|
/**
|
|
|
* 目标点环视
|
|
|
*/
|
|
|
targetRing() {
|
|
|
- var that = this
|
|
|
+ var that = this;
|
|
|
that.flyCircleLoop = !that.flyCircleLoop;
|
|
|
if (that.circlPoint) {
|
|
|
- var position = Cesium.Cartesian3.fromDegrees(that.circlPoint[0], that.circlPoint[1], that.circlPoint[2] + 1000)
|
|
|
+ var position = Cesium.Cartesian3.fromDegrees(
|
|
|
+ that.circlPoint[0],
|
|
|
+ that.circlPoint[1],
|
|
|
+ that.circlPoint[2] + 1000
|
|
|
+ );
|
|
|
// scene.camera.zoomIn(500)
|
|
|
scene.camera.setView({
|
|
|
destination: position,
|
|
|
orientation: {
|
|
|
heading: Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)
|
|
|
- pitch: Cesium.Math.toRadians(that.circlePitch * -1), // default value (looking down)
|
|
|
- roll: 0.0 // default value
|
|
|
- }
|
|
|
- })
|
|
|
- scene.camera.flyCircle(position)
|
|
|
- scene.camera.speedRatio = 0.2
|
|
|
- }
|
|
|
- else {
|
|
|
- that.$message.warning('请添加环视点!');
|
|
|
+ pitch: Cesium.Math.toRadians(that.circlePitch * -1), // default value (looking down)
|
|
|
+ roll: 0.0, // default value
|
|
|
+ },
|
|
|
+ });
|
|
|
+ scene.camera.flyCircle(position);
|
|
|
+ scene.camera.speedRatio = 0.2;
|
|
|
+ } else {
|
|
|
+ that.$message.warning("请添加环视点!");
|
|
|
return;
|
|
|
}
|
|
|
// scene.camera.flyCircleLoop = that.flyCircleLoop;
|
|
|
if (that.flyCircleLoop == true) {
|
|
|
- that.flyCircleText = '停止环视'
|
|
|
- }
|
|
|
- else {
|
|
|
- that.flyCircleText = '环视漫游'
|
|
|
- scene.camera.stopFlyCircle()
|
|
|
+ that.flyCircleText = "停止环视";
|
|
|
+ } else {
|
|
|
+ that.flyCircleText = "环视漫游";
|
|
|
+ scene.camera.stopFlyCircle();
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
@@ -469,39 +542,46 @@ export default {
|
|
|
*/
|
|
|
circleHChange() {
|
|
|
scene.camera.setView({
|
|
|
- destination: Cesium.Cartesian3.fromDegrees(this.circlPoint[0], this.circlPoint[1], this.circlPoint[2] + Number(this.circleH)),
|
|
|
+ destination: Cesium.Cartesian3.fromDegrees(
|
|
|
+ this.circlPoint[0],
|
|
|
+ this.circlPoint[1],
|
|
|
+ this.circlPoint[2] + Number(this.circleH)
|
|
|
+ ),
|
|
|
orientation: {
|
|
|
heading: Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)
|
|
|
- pitch: Cesium.Math.toRadians(this.circlePitch * -1), // default value (looking down)
|
|
|
- roll: 0.0 // default value
|
|
|
- }
|
|
|
- })
|
|
|
+ pitch: Cesium.Math.toRadians(this.circlePitch * -1), // default value (looking down)
|
|
|
+ roll: 0.0, // default value
|
|
|
+ },
|
|
|
+ });
|
|
|
},
|
|
|
/**
|
|
|
* 修改环视角度
|
|
|
*/
|
|
|
circlePitchChange() {
|
|
|
scene.camera.setView({
|
|
|
- destination: Cesium.Cartesian3.fromDegrees(this.circlPoint[0], this.circlPoint[1], this.circlPoint[2] + Number(this.circleH)),
|
|
|
+ destination: Cesium.Cartesian3.fromDegrees(
|
|
|
+ this.circlPoint[0],
|
|
|
+ this.circlPoint[1],
|
|
|
+ this.circlPoint[2] + Number(this.circleH)
|
|
|
+ ),
|
|
|
orientation: {
|
|
|
heading: Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)
|
|
|
- pitch: Cesium.Math.toRadians(this.circlePitch * -1), // default value (looking down)
|
|
|
- roll: 0.0 // default value
|
|
|
- }
|
|
|
- })
|
|
|
+ pitch: Cesium.Math.toRadians(this.circlePitch * -1), // default value (looking down)
|
|
|
+ roll: 0.0, // default value
|
|
|
+ },
|
|
|
+ });
|
|
|
},
|
|
|
/**
|
|
|
* 绘制飞行线
|
|
|
*/
|
|
|
addPolyline() {
|
|
|
var that = this;
|
|
|
- that.lineFylPoints = []
|
|
|
- if (handlerPoint)
|
|
|
- handlerPoint.clear()
|
|
|
+ that.lineFylPoints = [];
|
|
|
+ if (handlerPoint) handlerPoint.clear();
|
|
|
handlerPoint = new Cesium.DrawHandler(viewer, Cesium.DrawMode.Line);
|
|
|
handlerPoint.activate();
|
|
|
handlerPoint.drawEvt.addEventListener(function (result) {
|
|
|
- debugger
|
|
|
+ debugger;
|
|
|
var positions = result.object.positions;
|
|
|
for (var i = 0; i < positions.length; i++) {
|
|
|
var cartographic = that.Cartesian2toDegrees(positions[i]);
|
|
@@ -509,7 +589,7 @@ export default {
|
|
|
}
|
|
|
//将获取的点的位置转化成经纬度
|
|
|
handlerPoint.deactivate();
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
/**
|
|
|
* 开始沿线飞行
|
|
@@ -517,86 +597,99 @@ export default {
|
|
|
startPolylineFly() {
|
|
|
var that = this;
|
|
|
if (that.lineFylPoints == null || that.lineFylPoints.length == 0) {
|
|
|
- that.$message.warning('请绘制飞行路线!');
|
|
|
+ that.$message.warning("请绘制飞行路线!");
|
|
|
return;
|
|
|
}
|
|
|
- debugger
|
|
|
+ debugger;
|
|
|
var speed = Number(that.flySpeed) / 3.6;
|
|
|
- var xml = '<?xml version="1.0" encoding="UTF-8"?>' +
|
|
|
+ var xml =
|
|
|
+ '<?xml version="1.0" encoding="UTF-8"?>' +
|
|
|
'<SceneRoute xmlns = "https://www.supermap.com/ugc60" >' +
|
|
|
- '<route name="飞行路线_1" speed="' + speed + '" lineType="0" showroutestop="False" showrouteline="False" altitudefree="False" headingfree="False" tiltfree="False" flycircle="False" alongline="True">' +
|
|
|
- '<style>' +
|
|
|
- '<geostyle3d>' +
|
|
|
- '<linecolor>RGBA(147,112,219,255)</linecolor>' +
|
|
|
- '<linewidth>2</linewidth>' +
|
|
|
- '<altitudeMode>Absolute</altitudeMode>' +
|
|
|
- '<bottomAltitude>0.00</bottomAltitude>' +
|
|
|
- '</geostyle3d>' +
|
|
|
- '</style>'
|
|
|
+ '<route name="飞行路线_1" speed="' +
|
|
|
+ speed +
|
|
|
+ '" lineType="0" showroutestop="False" showrouteline="False" altitudefree="False" headingfree="False" tiltfree="False" flycircle="False" alongline="True">' +
|
|
|
+ "<style>" +
|
|
|
+ "<geostyle3d>" +
|
|
|
+ "<linecolor>RGBA(147,112,219,255)</linecolor>" +
|
|
|
+ "<linewidth>2</linewidth>" +
|
|
|
+ "<altitudeMode>Absolute</altitudeMode>" +
|
|
|
+ "<bottomAltitude>0.00</bottomAltitude>" +
|
|
|
+ "</geostyle3d>" +
|
|
|
+ "</style>";
|
|
|
that.lineFylPoints.forEach((point, index) => {
|
|
|
- xml += '<routestop name="Stop+' + (index + 1) + '" speed="0" excluded="False" viewType="camera">' +
|
|
|
- '<camera>' +
|
|
|
- '<longitude>' + point[0] + '</longitude>' +
|
|
|
- '<latitude>' + point[1] + '</latitude>' +
|
|
|
- '<altitude>' + (point[2] + that.flyH) + '</altitude>' +
|
|
|
- '<heading>0</heading>' +
|
|
|
- '<tilt>78.531727283418646834</tilt>' +
|
|
|
- '<altitudeMode>Absolute</altitudeMode>' +
|
|
|
- '</camera>' +
|
|
|
- '<style>' +
|
|
|
- '<geostyle3d>' +
|
|
|
- '<icon />' +
|
|
|
- '<markersize>4.8</markersize>' +
|
|
|
- '<markericonscale>1</markericonscale>' +
|
|
|
- '<markercolor>RGBA(255,255,255,255)</markercolor>' +
|
|
|
- '</geostyle3d>' +
|
|
|
- '</style>' +
|
|
|
- '<setting>' +
|
|
|
- '<turnTime>1.5</turnTime>' +
|
|
|
- '<turnSlowly>False</turnSlowly>' +
|
|
|
- '<stopPlayMode>StopPause</stopPlayMode>' +
|
|
|
- '<autoPlay>False</autoPlay>' +
|
|
|
- '<pauseTime>0</pauseTime>' +
|
|
|
- '<angularSpeed>1</angularSpeed>' +
|
|
|
- ' </setting>' +
|
|
|
- '</routestop>';
|
|
|
- })
|
|
|
- xml += '</route>'
|
|
|
- xml += '</SceneRoute >'
|
|
|
+ xml +=
|
|
|
+ '<routestop name="Stop+' +
|
|
|
+ (index + 1) +
|
|
|
+ '" speed="0" excluded="False" viewType="camera">' +
|
|
|
+ "<camera>" +
|
|
|
+ "<longitude>" +
|
|
|
+ point[0] +
|
|
|
+ "</longitude>" +
|
|
|
+ "<latitude>" +
|
|
|
+ point[1] +
|
|
|
+ "</latitude>" +
|
|
|
+ "<altitude>" +
|
|
|
+ (point[2] + that.flyH) +
|
|
|
+ "</altitude>" +
|
|
|
+ "<heading>0</heading>" +
|
|
|
+ "<tilt>78.531727283418646834</tilt>" +
|
|
|
+ "<altitudeMode>Absolute</altitudeMode>" +
|
|
|
+ "</camera>" +
|
|
|
+ "<style>" +
|
|
|
+ "<geostyle3d>" +
|
|
|
+ "<icon />" +
|
|
|
+ "<markersize>4.8</markersize>" +
|
|
|
+ "<markericonscale>1</markericonscale>" +
|
|
|
+ "<markercolor>RGBA(255,255,255,255)</markercolor>" +
|
|
|
+ "</geostyle3d>" +
|
|
|
+ "</style>" +
|
|
|
+ "<setting>" +
|
|
|
+ "<turnTime>1.5</turnTime>" +
|
|
|
+ "<turnSlowly>False</turnSlowly>" +
|
|
|
+ "<stopPlayMode>StopPause</stopPlayMode>" +
|
|
|
+ "<autoPlay>False</autoPlay>" +
|
|
|
+ "<pauseTime>0</pauseTime>" +
|
|
|
+ "<angularSpeed>1</angularSpeed>" +
|
|
|
+ " </setting>" +
|
|
|
+ "</routestop>";
|
|
|
+ });
|
|
|
+ xml += "</route>";
|
|
|
+ xml += "</SceneRoute >";
|
|
|
var routes = new Cesium.RouteCollection(viewer.entities);
|
|
|
routes.fromXML(xml);
|
|
|
//初始化飞行管理
|
|
|
flyManager = new Cesium.FlyManager({
|
|
|
scene: scene,
|
|
|
- routes: routes
|
|
|
+ routes: routes,
|
|
|
});
|
|
|
//注册站点到达事件
|
|
|
flyManager.stopArrived.addEventListener(function (routeStop) {
|
|
|
routeStop.waitTime = 1; // 在每个站点处停留1s
|
|
|
});
|
|
|
- flyManager.readyPromise.then(function () { // 飞行路线就绪
|
|
|
+ flyManager.readyPromise.then(function () {
|
|
|
+ // 飞行路线就绪
|
|
|
var currentRoute = flyManager.currentRoute;
|
|
|
- console.log(currentRoute.totalDuration + "秒")
|
|
|
+ console.log(currentRoute.totalDuration + "秒");
|
|
|
currentRoute.isLineVisible = false;
|
|
|
currentRoute.isStopVisible = false;
|
|
|
//生成飞行文件中的所有站点列表
|
|
|
// var allStops = flyManager.getAllRouteStops();
|
|
|
flyManager && flyManager.play();
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
/**
|
|
|
* 停止沿线飞行
|
|
|
*/
|
|
|
stopPolylineFly() {
|
|
|
var allStops = flyManager.getAllRouteStops();
|
|
|
- flyManager.viewToStop(allStops[allStops.length - 1])
|
|
|
+ flyManager.viewToStop(allStops[allStops.length - 1]);
|
|
|
flyManager && flyManager.stop();
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
this.clearScope();
|
|
|
},
|
|
|
-}
|
|
|
+};
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
|
@import "@/../../zt.scss";
|