From 58b6c6918ebe148ae3e2a694b55691e174dd2198 Mon Sep 17 00:00:00 2001
From: fuchengshen <men883234@gmail.com>
Date: 星期五, 29 七月 2022 09:23:23 +0800
Subject: [PATCH] select div move

---
 public/hn3d/example/css/time_search.css |    2 
 public/hn3d/example/00_hn_new.html      |  114 ++++++++++++++++++++++++++++++++++++++------------------
 2 files changed, 78 insertions(+), 38 deletions(-)

diff --git a/public/hn3d/example/00_hn_new.html b/public/hn3d/example/00_hn_new.html
index 5e387ae..8872be3 100644
--- a/public/hn3d/example/00_hn_new.html
+++ b/public/hn3d/example/00_hn_new.html
@@ -178,6 +178,80 @@
     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; //棰勯槻榧犳爣寮硅捣鏉ュ悗杩樹細寰幆锛堝嵆棰勯槻榧犳爣鏀句笂鍘荤殑鏃跺�欒繕浼氱Щ鍔級
+
+              //淇浣庣増鏈琲e bug
+              if (typeof drag[j].releaseCapture != 'undefined') {
+                drag[j].releaseCapture();
+              }
+
+            };
+          };
+        })(i)
+
+      }
+
+    };
+
+
+
+
+
+
+
     // 椤甸潰鍒濆鎵ц鐨勬柟娉�
     $(document).ready(function () {
       request = haoutil.system.getRequest();
@@ -288,6 +362,9 @@
     }
 
 
+
+
+    // 娴嬭瘯socket.io
     socket_.on("comm", (data) => {
       console.log(data, "鍚庣鎺ㄩ��")
     })
@@ -636,43 +713,6 @@
 
       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)
 
 
 
diff --git a/public/hn3d/example/css/time_search.css b/public/hn3d/example/css/time_search.css
index 62c1966..911e271 100644
--- a/public/hn3d/example/css/time_search.css
+++ b/public/hn3d/example/css/time_search.css
@@ -4,7 +4,7 @@
   width: 400px;
   height: 110px;
   right: 100px;
-  top: 20px;
+  bottom: 50px;
   border: 1px solid rgba(12, 99, 133,0.5);
   padding: 10px;
   background-color: rgba(15, 97, 83, 0.5);

--
Gitblit v1.9.1