Commit 1b3596ea authored by xxx's avatar xxx

1

parent c67ed13d
......@@ -130,6 +130,7 @@ export default {
array2.push(item.lon);
array2.push(item.lat);
array2.push(1000);
array2.push(new Date(item.time).toISOString());
array1.push(array2);
})
obj1.name = res.data.name;
......@@ -207,7 +208,7 @@ export default {
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());
property.addSample(tempTime, Cesium.Cartesian3.fromDegrees(positions[i][0],positions[i][1],positions[i][2],));
property.addSample(tempTime, Cesium.Cartesian3.fromDegrees(positions[i][0],positions[i][1],positions[i][2]));
}
var graphic = new mars3d.graphic.PathEntity({
......@@ -246,18 +247,18 @@ export default {
},
//车辆轨迹2
initPath(data,graphicLayer2,positions,truckName) {
initPath(graphicLayer2,positions,truckName) {
const property = new Cesium.SampledPositionProperty()
property.forwardExtrapolationType = Cesium.ExtrapolationType.HOLD
let start;
let stop;
for (let i = 0, len = data.length; i < len; i++) {
const item = data[i]
const lng = Number(item.x.toFixed(6)) // 经度
const lat = Number(item.y.toFixed(6)) // 纬度
const height = item.z // 高度
const time = item.time // 时间
for (let i = 0, len = positions.length; i < len; i++) {
const item = positions[i];
const lng = Number(item[0].toFixed(6)) // 经度
const lat = Number(item[1].toFixed(6)) // 纬度
const height = item[2] // 高度
const time = item[3] // 时间
let position = null
if (lng && lat) {
......@@ -271,21 +272,19 @@ export default {
property.addSample(juliaDate, position)
}
if (i === 0) {
if (i == 0) {
start = juliaDate
} else if (i === len - 1) {
} else if (i == len - 1) {
stop = juliaDate
}
}
// 设置时钟属性
map.clock.startTime = start.clone()
map.clock.stopTime = stop.clone()
map.clock.currentTime = start.clone()
map.clock.clockRange = Cesium.ClockRange.LOOP_STOP
map.clock.multiplier = 5
if (map.controls.timeline) {
map.controls.timeline.zoomTo(start, stop)
}
......
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