Commit baf10bc2 authored by xxx's avatar xxx

1

parent f7e46e64
......@@ -161,7 +161,70 @@ export default {
...options,
...this.options,
control: {
defaultContextMenu: false, //右键菜单
"homeButton": true,
"baseLayerPicker": true,
"sceneModePicker": false,
"vrButton": false,
"fullscreenButton": true,
"navigationHelpButton": true,
"animation": true,
"timeline": false,
"infoBox": false,
"geocoder": false,
"geocoderConfig": {
"key": [
"ae29a37307840c7ae4a785ac905927e0"
]
},
"selectionIndicator": false,
"defaultContextMenu": false,
"mouseDownView": true,
"compass": {
"bottom": "240px",
"right": "2px"
},
"distanceLegend": {
"left": "100px",
"bottom": "0px"
},
"locationBar": {
"fps": true,
"template": "<div>经度:{lng}</div> <div>纬度:{lat}</div><div>海拔:{alt}米</div> <div>层级:{level}</div><div>方向:{heading}度</div> <div>俯仰角:{pitch}度</div><div>视高:{cameraHeight}米</div>"
}
},
scene:{
"clock":{
currentTime: that.currentTime1(that.historyTrajectoryData[0].arrays[0][3]),
shouldAnimate: true
},
"center": {"lat":37.4900,"lng":122.04849,"alt":1000,"heading":360,"pitch":-90},
"scene3DOnly": false,
"shadows": false,
"removeDblClick": true,
"sceneMode": 2,
"showSun": true,
"showMoon": true,
"showSkyBox": true,
"showSkyAtmosphere": true,
"fog": true,
"fxaa": true,
"globe": {
"depthTestAgainstTerrain": false,
"baseColor": "#546a53",
"showGroundAtmosphere": true,
"enableLighting": false
},
"cameraController": {
"zoomFactor": 3.0,
"minimumZoomDistance": 100,
"maximumZoomDistance": 50000000,
"enableRotate": true,
"enableTranslate": true,
"enableTilt": true,
"enableZoom": true,
"enableCollisionDetection": true,
"minimumCollisionTerrainHeight": 15000
}
},
}
......@@ -206,12 +269,11 @@ export default {
let that = this;
var property = new Cesium.SampledPositionProperty();
var tempTime;
//起点
tempTime = map.clock.currentTime; //开始时间
property.addSample(tempTime, Cesium.Cartesian3.fromDegrees(positions[0][0],positions[0][1],positions[0][2]));
for(let i = 1;i < positions.length;i++){
tempTime = Cesium.JulianDate.addSeconds(tempTime, that.carPlaySpeed, new Cesium.JulianDate());
tempTime = Cesium.JulianDate.addSeconds(tempTime, (Date.parse(new Date(positions[i][3])) - Date.parse(new Date(positions[i-1][3]))) / 1000, new Cesium.JulianDate());
property.addSample(tempTime, Cesium.Cartesian3.fromDegrees(positions[i][0],positions[i][1],positions[i][2]));
}
......@@ -250,17 +312,6 @@ export default {
graphicLayer2.addGraphic(graphic); //还可以另外一种写法: graphic.addTo(graphicLayer)
},
getSampledPositionProperty(points){
let property = new Cesium.SampledPositionProperty();
let start = this.map.clock.currentTime;
let positions = mars3d.LatLngArray.toCartesians(points);
for (let i = 0; i < positions.length; i++) {
let time = Cesium.JulianDate.addSeconds(start, i * 20, new Cesium.JulianDate());
let position = positions[i];
property.addSample(time, position);
}
return property;
},
//停车区域
addDemoGraphic1(graphicLayer,x,y,alarmTime,time) {
const graphic = new mars3d.graphic.CircleEntity({
......@@ -457,6 +508,39 @@ export default {
s = Math.round(s * 10000) / 10;
return s
},
currentTime1(time){
var date = new Date(time);
var year = date.getFullYear(); //年 ,从 Date 对象以四位数字返回年份
var month = date.getMonth() + 1; //月 ,从 Date 对象返回月份 (0 ~ 11) ,date.getMonth()比实际月份少 1 个月
var day = date.getDate(); //日 ,从 Date 对象返回一个月中的某一天 (1 ~ 31)
var hours = date.getHours(); //小时 ,返回 Date 对象的小时 (0 ~ 23)
var minutes = date.getMinutes(); //分钟 ,返回 Date 对象的分钟 (0 ~ 59)
var seconds = date.getSeconds(); //秒 ,返回 Date 对象的秒数 (0 ~ 59)
//修改月份格式
if (month >= 1 && month <= 9) {
month = "0" + month;
}
//修改日期格式
if (day >= 0 && day <= 9) {
day = "0" + day;
}
//修改小时格式
if (hours >= 0 && hours <= 9) {
hours = "0" + hours;
}
//修改分钟格式
if (minutes >= 0 && minutes <= 9) {
minutes = "0" + minutes;
}
//修改秒格式
if (seconds >= 0 && seconds <= 9) {
seconds = "0" + seconds;
}
//获取当前系统时间 格式(yyyy-mm-dd hh:mm:ss)
let currentFormatDate = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
//console.log(currentFormatDate);
return currentFormatDate;
}
}
}
</script>
......@@ -478,7 +562,7 @@ export default {
}
.mars3d-container {
height: 100%;
width: 100vw;
width: 100%;
overflow: hidden;
}
......
......@@ -44,7 +44,7 @@
<br>
<el-form-item label="观看倍速" style="display: inline-block;">
<!-- <el-form-item label="观看倍速" style="display: inline-block;">
<el-select v-model="query.playSpeed" placeholder="请选择观看倍速" @change="changeSpeed()">
<el-option label="1倍" value="1"></el-option>
<el-option label="4倍" value="4"></el-option>
......@@ -52,7 +52,7 @@
<el-option label="16倍" value="16"></el-option>
<el-option label="32倍" value="32"></el-option>
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item label="" style="display: inline-block;">
<el-button type="primary" @click="trajectoryShow(true)" plain>显示所有轨迹</el-button>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment