| | |
| | | var distance_half = 111319.5; |
| | | var pointPrimitives = null; |
| | | var time_mars = $('.mars-pannel') |
| | | |
| | | |
| | | window.onload = function () { |
| | | |
| | | var drag = document.querySelectorAll('.search') |
| | | |
| | | for (var i = 0; i < drag.length; i++) { |
| | | (function (j) { |
| | | drag[j].onmousedown = function runs (e) { |
| | | |
| | | |
| | | var e = e || window.event; |
| | | var diffX = e.clientX - drag[j].offsetLeft; |
| | | var diffY = e.clientY - drag[j].offsetTop; |
| | | |
| | | |
| | | if (typeof drag.setCapture != 'undefined') { |
| | | drag.setCapture(); |
| | | } |
| | | // pauseEvent(e); |
| | | |
| | | // function pauseEvent (e) { |
| | | // if (e.stopPropagation) e.stopPropagation() |
| | | // if (e.preventDefault) e.preventDefault(); |
| | | // e.cancelBubble = true; |
| | | // e.returnValue = false; |
| | | // return false; |
| | | // } |
| | | |
| | | document.onmousemove = function (e) { |
| | | var e = e || window.event; |
| | | var left = e.clientX - diffX; |
| | | var top = e.clientY - diffY; |
| | | |
| | | if (left < 0) { |
| | | left = 0; |
| | | } else if (left > window.innerWidth - drag[j].offsetWidth) { |
| | | left = window.innerWidth - drag[j].offsetWidth; |
| | | } |
| | | if (top < 0) { |
| | | top = 0; |
| | | } else if (top > window.innerHeight - drag[j].offsetHeight) { |
| | | top = window.innerHeight - drag[j].offsetHeight; |
| | | } |
| | | |
| | | drag[j].style.left = left + 'px'; |
| | | drag[j].style.top = top + 'px'; |
| | | if (e.preventDefault) { |
| | | e.preventDefault(); |
| | | } |
| | | }; |
| | | document.onmouseup = function (e) { //当鼠标弹起来的时候不再移动 |
| | | this.onmousemove = null; |
| | | this.onmouseup = null; //预防鼠标弹起来后还会循环(即预防鼠标放上去的时候还会移动) |
| | | |
| | | //修复低版本ie bug |
| | | if (typeof drag[j].releaseCapture != 'undefined') { |
| | | drag[j].releaseCapture(); |
| | | } |
| | | |
| | | }; |
| | | }; |
| | | })(i) |
| | | |
| | | } |
| | | |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 页面初始执行的方法 |
| | | $(document).ready(function () { |
| | | request = haoutil.system.getRequest(); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // 测试socket.io |
| | | socket_.on("comm", (data) => { |
| | | console.log(data, "后端推送") |
| | | }) |
| | |
| | | |
| | | console.log(this.dou3, "dou3") |
| | | |
| | | var position_dou = new Cesium.CallbackProperty(function (time) { |
| | | return dou3.position |
| | | }, false) |
| | | console.log(position_dou, "position_dou") |
| | | var rectangularSensor = new mars3d.graphic.RectangularSensor({ |
| | | // position: [121.406729, 31.467183, 22], |
| | | // position: new Cesium.CallbackProperty(function (time) { |
| | | // return dou3.position |
| | | // }, false), |
| | | position: position_dou, |
| | | style: { |
| | | heading: 29, |
| | | pitch: 196, |
| | | roll: 98, |
| | | |
| | | radius: 10, // 传感器的半径 |
| | | xHalfAngleDegree: 24, // 传感器水平半角 |
| | | yHalfAngleDegree: 55, // 传感器垂直半角 |
| | | |
| | | color: "#00ffff", |
| | | opacity: 0.4, |
| | | lineColor: "#ffffff", // 线的颜色 |
| | | |
| | | showSectorSegmentLines: false, |
| | | showIntersection: false, |
| | | showDomeSurfaces: false, |
| | | showDomeLines: false, |
| | | showLateralSurfaces: false, |
| | | showScanPlane: true, // 是否显示扫描面 |
| | | scanPlaneColor: "#00ffff", |
| | | scanPlaneOpacity: 0.9, |
| | | scanPlaneMode: "vertical", // 扫描面模式 垂直vertical/水平horizontal |
| | | scanPlaneRate: 3, // 扫描速率, |
| | | depthTest: true |
| | | } |
| | | }) |
| | | graphicLayer.addGraphic(rectangularSensor) |
| | | |
| | | |
| | | |