|
|
@ -20,7 +20,6 @@
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import MarsMap from "@/components/mars-map";
|
|
|
|
import MarsMap from "@/components/mars-map";
|
|
|
|
import grids from "@/components/grids.vue";
|
|
|
|
import grids from "@/components/grids.vue";
|
|
|
|
import { html } from "js-beautify";
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
const basePathUrl = window.basePathUrl || "";
|
|
|
|
const basePathUrl = window.basePathUrl || "";
|
|
|
@ -60,11 +59,34 @@ export default {
|
|
|
|
mounted() {},
|
|
|
|
mounted() {},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
mapLoad(map) {
|
|
|
|
mapLoad(map) {
|
|
|
|
let _this = this;
|
|
|
|
|
|
|
|
this.map = map;
|
|
|
|
this.map = map;
|
|
|
|
this.graphicLayer = new mars3d.layer.GraphicLayer();
|
|
|
|
this.graphicLayer = new mars3d.layer.GraphicLayer();
|
|
|
|
map.addLayer(this.graphicLayer);
|
|
|
|
map.addLayer(this.graphicLayer);
|
|
|
|
this.initTilesetLayer();
|
|
|
|
this.initTilesetLayer();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.createCar();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 加载姑苏区三维图层
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
initTilesetLayer() {
|
|
|
|
|
|
|
|
let _this = this;
|
|
|
|
|
|
|
|
// 添加参考三维模型;
|
|
|
|
|
|
|
|
let tiles3dLayer = new mars3d.layer.TilesetLayer({
|
|
|
|
|
|
|
|
name: "姑苏区建筑物",
|
|
|
|
|
|
|
|
url: "https://www.jichuanglanhai.com:88/3dtiles/yunkun/tileset.json",
|
|
|
|
|
|
|
|
maximumScreenSpaceError: 1,
|
|
|
|
|
|
|
|
style: {
|
|
|
|
|
|
|
|
color: {
|
|
|
|
|
|
|
|
conditions: [["true", `color("rgba(42, 160, 224, 1)")`]],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
this.map.addLayer(tiles3dLayer);
|
|
|
|
|
|
|
|
tiles3dLayer.on(mars3d.EventType.load, function (event) {
|
|
|
|
|
|
|
|
_this.createCar();
|
|
|
|
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 生成车辆实时点位
|
|
|
|
* 生成车辆实时点位
|
|
|
@ -74,52 +96,42 @@ export default {
|
|
|
|
for (let i = 0; i < 1; i++) {
|
|
|
|
for (let i = 0; i < 1; i++) {
|
|
|
|
const graphic = new mars3d.graphic.DivGraphic({
|
|
|
|
const graphic = new mars3d.graphic.DivGraphic({
|
|
|
|
id: "car" + i,
|
|
|
|
id: "car" + i,
|
|
|
|
position: [120.616912, 31.288775],
|
|
|
|
position: [120.590416, 31.275593],
|
|
|
|
style: {
|
|
|
|
style: {
|
|
|
|
html: `<div class="car${i} car-point" style="background:url( ${require(`@/assets/images/car-active.png`)});background-size: 100% 100%;transform:scale(1.3)">
|
|
|
|
className: `carIcon`,
|
|
|
|
|
|
|
|
html: `<div>
|
|
|
|
<div class="car-name">001号线_01_早送_守押001_苏E</div>
|
|
|
|
<div class="car-name">001号线_01_早送_守押001_苏E</div>
|
|
|
|
</div>`,
|
|
|
|
</div>`,
|
|
|
|
color: "#fff",
|
|
|
|
color: "#fff",
|
|
|
|
|
|
|
|
horizontalOrigin: Cesium.HorizontalOrigin.CENTER, //居中防止自定义位置偏差
|
|
|
|
horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
|
|
|
|
|
|
|
|
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
|
|
|
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
|
|
|
distanceDisplayCondition: false,
|
|
|
|
distanceDisplayCondition: false,
|
|
|
|
clampToGround: true,
|
|
|
|
clampToGround: true,
|
|
|
|
offsetX: -105,
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
attr: {
|
|
|
|
attr: {
|
|
|
|
index: i,
|
|
|
|
index: i,
|
|
|
|
id: "car" + i,
|
|
|
|
id: "car" + i,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
popup: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
type: "html",
|
|
|
|
|
|
|
|
html: `<div class="diy-popup">弹窗</div>`,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
popupOptions: {
|
|
|
|
|
|
|
|
className: "carPopup",
|
|
|
|
|
|
|
|
offsetX: 300,
|
|
|
|
|
|
|
|
offsetY: -50,
|
|
|
|
|
|
|
|
closeButton: false,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
graphic.openPopup();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// graphic.on(mars3d.EventType.click, function (event) {
|
|
|
|
|
|
|
|
// _this.updateBg(event.target._id, "car-active");
|
|
|
|
|
|
|
|
// event.target.options.attr = {
|
|
|
|
|
|
|
|
// ...event.target.options.attr,
|
|
|
|
|
|
|
|
// ...{ highlight: true },
|
|
|
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.graphicLayer.addGraphic(graphic);
|
|
|
|
this.graphicLayer.addGraphic(graphic);
|
|
|
|
|
|
|
|
// //绑定弹窗
|
|
|
|
|
|
|
|
this.bindPopup(graphic);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
|
|
graphic.openPopup();
|
|
|
|
|
|
|
|
graphic.openHighlight(
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
className: `carIconActive`,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
false
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const circleGraphic = new mars3d.graphic.CircleEntity({
|
|
|
|
const circleGraphic = new mars3d.graphic.CircleEntity({
|
|
|
|
id: `circle1`,
|
|
|
|
id: `circle1`,
|
|
|
|
position: new mars3d.LngLatPoint(120.616912, 31.288775),
|
|
|
|
position: new mars3d.LngLatPoint(120.590416, 31.275593),
|
|
|
|
style: {
|
|
|
|
style: {
|
|
|
|
radius: 150,
|
|
|
|
radius: 150,
|
|
|
|
materialType: mars3d.MaterialType.CircleWave,
|
|
|
|
materialType: mars3d.MaterialType.CircleWave,
|
|
|
@ -132,7 +144,7 @@ export default {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.graphicLayer.addGraphic(circleGraphic);
|
|
|
|
this.graphicLayer.addGraphic(circleGraphic);
|
|
|
|
|
|
|
|
|
|
|
|
this.map.flyToPoint([120.616912, 31.288775], {
|
|
|
|
this.map.flyToPoint([120.590416, 31.275593], {
|
|
|
|
radius: 798.9,
|
|
|
|
radius: 798.9,
|
|
|
|
heading: 357.9,
|
|
|
|
heading: 357.9,
|
|
|
|
pitch: -31.6,
|
|
|
|
pitch: -31.6,
|
|
|
@ -147,17 +159,63 @@ export default {
|
|
|
|
// }, interval * 1000);
|
|
|
|
// }, interval * 1000);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
updateBg(id, imageName) {
|
|
|
|
bindPopup(fixedRoute) {
|
|
|
|
const className = document.getElementsByClassName(id)[0];
|
|
|
|
fixedRoute.bindPopup(
|
|
|
|
className.style.background = `url( ${require(`@/assets/images/${imageName}.png`)})`;
|
|
|
|
`<div class="diy-popup">
|
|
|
|
className.style.backgroundSize = "100% 100%";
|
|
|
|
<div class="popup-title">001号线_01_早送_守押<br/>
|
|
|
|
if (imageName == "car-active") {
|
|
|
|
001_苏E12345
|
|
|
|
className.style.transform = "scale(1.2)";
|
|
|
|
</div>
|
|
|
|
} else {
|
|
|
|
<div class="popup-item">
|
|
|
|
className.style.transform = "";
|
|
|
|
<div class="popup-lable">线路类型:</div>
|
|
|
|
}
|
|
|
|
<div class="popup-value">押运线路</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="sub-title">装备信息</div>
|
|
|
|
|
|
|
|
<div class="popup-grid">
|
|
|
|
|
|
|
|
<div class="popup-item">
|
|
|
|
|
|
|
|
<div class="popup-lable">车牌号码:</div>
|
|
|
|
|
|
|
|
<div class="popup-value">苏E12345(守押001)</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="popup-item">
|
|
|
|
|
|
|
|
<div class="popup-lable">枪支:</div>
|
|
|
|
|
|
|
|
<div class="popup-value">枪支1478(97-x)</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="popup-item">
|
|
|
|
|
|
|
|
<div class="popup-lable">枪支:</div>
|
|
|
|
|
|
|
|
<div class="popup-value">枪支1480(97-x)</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="popup-item">
|
|
|
|
|
|
|
|
<div class="popup-lable">弹夹:</div>
|
|
|
|
|
|
|
|
<div class="popup-value">弹夹585</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="sub-title">人员信息</div>
|
|
|
|
|
|
|
|
<div class="popup-grid">
|
|
|
|
|
|
|
|
<div class="popup-item">
|
|
|
|
|
|
|
|
<div class="popup-lable">车长:</div>
|
|
|
|
|
|
|
|
<div class="popup-value">张宏伟</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="popup-item">
|
|
|
|
|
|
|
|
<div class="popup-lable">驾驶员:</div>
|
|
|
|
|
|
|
|
<div class="popup-value">陈贵华</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="popup-item">
|
|
|
|
|
|
|
|
<div class="popup-lable">押运员:</div>
|
|
|
|
|
|
|
|
<div class="popup-value">王昌文</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="popup-item">
|
|
|
|
|
|
|
|
<div class="popup-lable">押运员:</div>
|
|
|
|
|
|
|
|
<div class="popup-value">李名</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>`,
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
className: "carPopup",
|
|
|
|
|
|
|
|
offsetX: 250,
|
|
|
|
|
|
|
|
offsetY: -50,
|
|
|
|
|
|
|
|
closeButton: false,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 改变位置
|
|
|
|
// 改变位置
|
|
|
|
changePosition(time) {
|
|
|
|
changePosition(time) {
|
|
|
|
let _this = this;
|
|
|
|
let _this = this;
|
|
|
@ -177,28 +235,6 @@ export default {
|
|
|
|
random(min, max) {
|
|
|
|
random(min, max) {
|
|
|
|
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
|
|
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 加载姑苏区三维图层
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
initTilesetLayer() {
|
|
|
|
|
|
|
|
let _this = this;
|
|
|
|
|
|
|
|
// 添加参考三维模型;
|
|
|
|
|
|
|
|
let tiles3dLayer = new mars3d.layer.TilesetLayer({
|
|
|
|
|
|
|
|
name: "姑苏区建筑物",
|
|
|
|
|
|
|
|
url: this.baseUrl,
|
|
|
|
|
|
|
|
maximumScreenSpaceError: 1,
|
|
|
|
|
|
|
|
style: {
|
|
|
|
|
|
|
|
color: {
|
|
|
|
|
|
|
|
conditions: [["true", `color("rgba(42, 160, 224, 1)")`]],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
this.map.addLayer(tiles3dLayer);
|
|
|
|
|
|
|
|
tiles3dLayer.on(mars3d.EventType.load, function (event) {
|
|
|
|
|
|
|
|
_this.createCar();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
chkShadows(val) {
|
|
|
|
chkShadows(val) {
|
|
|
|
let _this = this;
|
|
|
|
let _this = this;
|
|
|
|
this.map.viewer.shadows = val;
|
|
|
|
this.map.viewer.shadows = val;
|
|
|
@ -215,11 +251,11 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.container-top {
|
|
|
|
.container-top {
|
|
|
|
position: absolute;
|
|
|
|
position: fixed;
|
|
|
|
top: 23px;
|
|
|
|
top: 23px;
|
|
|
|
left: 50%;
|
|
|
|
left: 50%;
|
|
|
|
transform: translateX(-50%);
|
|
|
|
transform: translateX(-50%);
|
|
|
|
z-index: 50;
|
|
|
|
z-index: 2000;
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
justify-content: center;
|
|
|
|