|
@@ -106,6 +106,25 @@
|
|
|
createLeftClickDescription() {
|
|
|
let that = this;
|
|
|
that.handler.setInputAction(function (movement) {
|
|
|
+ let id = Cesium.defaultValue(that.viewer.scene.pick(movement.position).id, that.viewer.scene.pick(movement.position).primitive.id);
|
|
|
+ if("传感器" == id._type){
|
|
|
+ that.aac = setInterval(function (){
|
|
|
+ let color = "green";
|
|
|
+ let value = Math.random();
|
|
|
+ let up = "▲";
|
|
|
+ let down = "▼";
|
|
|
+ if(value>0.5){
|
|
|
+ color = "red";
|
|
|
+ value = value +""+ up;
|
|
|
+ }else{
|
|
|
+ value = value +""+ down;
|
|
|
+ }
|
|
|
+ let html = "<span style='color:"+color+"'>当前传感器数值:"+value+"</span>";
|
|
|
+ window.parent.frames[0].document.querySelector(".cesium-infoBox-description").innerHTML = html;
|
|
|
+ },1000);
|
|
|
+ }else{
|
|
|
+ clearInterval(that.aac);
|
|
|
+ }
|
|
|
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
|
|
},
|
|
|
/**
|
|
@@ -114,7 +133,6 @@
|
|
|
setMarkers_cgq(makerList){
|
|
|
let that = this;
|
|
|
that.handler = new Cesium.ScreenSpaceEventHandler(this.scene.canvas);
|
|
|
-
|
|
|
for (let i in makerList) {
|
|
|
let longitude = makerList[i].lng;
|
|
|
let latitude = makerList[i].lat;
|
|
@@ -131,33 +149,11 @@
|
|
|
description: makerList[i].bindPopupHtml,
|
|
|
click: makerList[i].click,
|
|
|
parameter: makerList[i].parameter,
|
|
|
+ type:"传感器",
|
|
|
});
|
|
|
}
|
|
|
that.viewer.scene.globe.depthTestAgainstTerrain=false;
|
|
|
- that.createLeftClickDescription_cgq();
|
|
|
- },
|
|
|
- /**
|
|
|
- *鼠标左击事件是原来的气泡(传感器)
|
|
|
- */
|
|
|
- createLeftClickDescription_cgq() {
|
|
|
- let that = this;
|
|
|
- clearInterval(that.aac);
|
|
|
- that.handler.setInputAction(function (movement) {
|
|
|
- that.aac = setInterval(function (){
|
|
|
- let color = "green";
|
|
|
- let value = Math.random();
|
|
|
- let up = "▲";
|
|
|
- let down = "▼";
|
|
|
- if(value>0.5){
|
|
|
- color = "red";
|
|
|
- value = value +""+ up;
|
|
|
- }else{
|
|
|
- value = value +""+ down;
|
|
|
- }
|
|
|
- let html = "<span style='color:"+color+"'>当前传感器数值:"+value+"</span>";
|
|
|
- window.parent.frames[0].document.querySelector(".cesium-infoBox-description").innerHTML = html;
|
|
|
- },1000);
|
|
|
- }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
|
|
+ that.createLeftClickDescription();
|
|
|
},
|
|
|
/**
|
|
|
*鼠标右击事件是原来的点击
|
|
@@ -189,87 +185,4 @@
|
|
|
<style lang="scss" scoped>
|
|
|
@import '@/assets/styles/base.scss';
|
|
|
|
|
|
- input[type=checkbox] {
|
|
|
- margin: 0px 4px 0 0px;
|
|
|
- }
|
|
|
-
|
|
|
- label {
|
|
|
- display: inline-block;
|
|
|
- }
|
|
|
-
|
|
|
- .param-container {
|
|
|
- border: none;
|
|
|
- }
|
|
|
-
|
|
|
- .titleBox {
|
|
|
- margin-bottom: 0px;
|
|
|
- }
|
|
|
-
|
|
|
- .sm-div-graphic {
|
|
|
- position: absolute;
|
|
|
- color: #fff;
|
|
|
- font-size: 14px;
|
|
|
- }
|
|
|
-
|
|
|
- #test .divpoint {
|
|
|
- background: url(../../public/SuperMap3D/examples/webgl/images/qipao1.png) no-repeat;
|
|
|
- background-size: cover;
|
|
|
- width: 128px;
|
|
|
- height: 216px;
|
|
|
- }
|
|
|
-
|
|
|
- #test3 .divpoint {
|
|
|
- background: url(../../public/SuperMap3D/examples/webgl/images/qipao1.png) no-repeat;
|
|
|
- background-size: cover;
|
|
|
- width: 230px;
|
|
|
- height: 150px;
|
|
|
- }
|
|
|
-
|
|
|
- #test .label-wrap {
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- align-content: center;
|
|
|
- height: 50px;
|
|
|
- }
|
|
|
-
|
|
|
- #test3 .label-wrap {
|
|
|
- padding-left: 100px;
|
|
|
- padding-top: 8px;
|
|
|
- box-sizing: border-box;
|
|
|
- }
|
|
|
-
|
|
|
- #test .pop-title {
|
|
|
- color: #fff;
|
|
|
- margin-top: 11px;
|
|
|
- margin-bottom: 4px;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- font-size: 18px;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- #test .data-li {
|
|
|
- font-size: 14px;
|
|
|
- margin-top: 15px;
|
|
|
- margin-bottom: 5px;
|
|
|
- }
|
|
|
-
|
|
|
- #test3 .data-li {
|
|
|
- font-size: 14px;
|
|
|
- margin-top: 6px;
|
|
|
- }
|
|
|
-
|
|
|
- #test2 .divpoint {
|
|
|
- background: url(../../public/SuperMap3D/examples/webgl/images/qipao1.png) no-repeat;
|
|
|
- background-size: cover;
|
|
|
- width: 116px;
|
|
|
- height: 120px;
|
|
|
- }
|
|
|
-
|
|
|
- #test2 .label-wrap {
|
|
|
- box-sizing: border-box;
|
|
|
- padding-top: 10px;
|
|
|
- padding-left: 51px;
|
|
|
- }
|
|
|
-
|
|
|
</style>
|