Browse Source

增加图片

liuyuqi-dellpc 2 years ago
parent
commit
160d52b698
11 changed files with 47 additions and 45 deletions
  1. 0 0
      css/public.css
  2. BIN
      images/copy.png
  3. BIN
      images/map_bj1.gif
  4. BIN
      images/markers.png
  5. BIN
      images/popup_close.gif
  6. BIN
      images/popup_title.gif
  7. BIN
      images/searchbox.png
  8. BIN
      images/shad_h.png
  9. BIN
      images/shad_v.png
  10. 15 4
      index.html
  11. 32 41
      js/public.js

File diff suppressed because it is too large
+ 0 - 0
css/public.css


BIN
images/copy.png


BIN
images/map_bj1.gif


BIN
images/markers.png


BIN
images/popup_close.gif


BIN
images/popup_title.gif


BIN
images/searchbox.png


BIN
images/shad_h.png


BIN
images/shad_v.png


+ 15 - 4
index.html

@@ -27,11 +27,22 @@
                     class="searchTip" id="searchTip"></span>
             </div>
             <label class="pointLabel" for="pointLabel"><input type="checkbox" onfocus="this.blur()" id="pointLabel" />坐标反查</label>
-            <div style="width:400px;position:relative;float:right;">
-                <div style="color:#666;line-height:25px;">当前坐标点如下:</div>
+            <div style="width:500px;position:relative;float:right;">
+                <!-- <div style="color:#666;line-height:25px;">当前坐标点如下:</div> -->
+                <!-- <div class="pointContainer">
+                    <span>谷歌坐标(WGS84):</span>
+                    <span><input type="text" readonly id="googlePointInput" class="pointInput" />
+                        <input type="button" id="googleCopyButton" data-clipboard-target="#googlePointInput" class="button" /></span>
+                </div> -->
                 <div class="pointContainer">
-                    <input type="text" readonly id="pointInput" class="pointInput" />
-                    <input type="button" id="copyButton" data-clipboard-target="#pointInput" class="button" />
+                    <span>百度坐标  (BD09):</span>
+                    <span><input type="text" readonly id="pointInput" class="pointInput" />
+                        <input type="button" id="baiduCopyButton" data-clipboard-target="#pointInput" class="button" /></span>
+                </div>
+                <div class="pointContainer">
+                    <span>火星坐标(GCJ02):</span>
+                    <span><input type="text" readonly id="marsPointInput" class="pointInput" />
+                        <input type="button" id="marsCopyButton" data-clipboard-target="#marsPointInput" class="button" /></span>
                 </div>
                 <span id="copyMessage" style="width:60px;position:absolute;top:5px;right:190px;*right:160px;color:#f00;display:none"></span>
                 <div

+ 32 - 41
js/public.js

@@ -368,11 +368,34 @@ function initMap() {
     map.setDefaultCursor("default");
     map.setDraggingCursor("default")
 }
+
+callbackGoogle = function (data) {
+    if (data.status === 0) {
+        var value = data.points[0].lng + "," + data.points[0].lat;
+        Fe.G("googlePointInput").value = value;
+        Fe.G('googlePointInput').setAttribute('data-clipboard-text', value);
+    }
+}
+
+callbackMars = function (data) {
+    if (data.status === 0) {
+        var value = data.points[0].lng + "," + data.points[0].lat;
+        Fe.G("marsPointInput").value = value;
+        Fe.G('marsPointInput').setAttribute('data-clipboard-text', value);
+    }
+}
+
 function setInputPoint(a) {
     var value = a.lng + "," + a.lat;
+    var point = new BMap.Point(a.lng, a.lat);
+    var convertor = new BMap.Convertor();
+    // convertor.translate(point, 5,3, callbackGoogle);
+    convertor.translate(point, 5,3, callbackMars);
+
     Fe.G("pointInput").value = value;
     Fe.G('pointInput').setAttribute('data-clipboard-text', value);
 }
+
 function createMouseMoveLabel(c) {
     var a = map.pixelToPoint(new BMap.Pixel(0, 0));
     var b = c.lng + "," + c.lat;
@@ -715,7 +738,7 @@ function bindEvent() {
 }
 function addMarker(a) {
     var b = temp.pt[a];
-    var d = new BMap.Icon("Images/markers.png", new BMap.Size(23, 25), {
+    var d = new BMap.Icon("images/markers.png", new BMap.Size(23, 25), {
         offset: new BMap.Size(10, 25),
         imageOffset: new BMap.Size(0, 0 - a * 25),
         infoWindowAnchor: new BMap.Size(12, 0)
@@ -849,54 +872,22 @@ function showMessage(b) {
     1000)
 }
 function createCopyBt() {
-    // M.fe.copy({
-    //     copyBtnId: "copyPoint",
-    //     copytextId: "pointInput",
-    //     copyTag: "value",
-        // callback: function(d) {
-        //     var c = Fe.G("copyMessage");
-        //     c.style.display = "inline-block";
-        //     setTimeout(function() {
-        //         c.style.display = "none"
-        //     },
-        //     1000)
-        // }
-    // });
-    // var a = setInterval(function() {
-    //     if (Fe.G("ZeroClipboardMovie_1")) {
-    //         var c = getAbsPoint(Fe.G("copyButton"));
-    //         if (baidu.browser.ie == 8) {
-    //             baidu.dom.getParent(Fe.G("ZeroClipboardMovie_1")).style.top = (c.y + 25) + "px";
-    //             baidu.dom.getParent(Fe.G("ZeroClipboardMovie_1")).style.left = (c.x + 170) + "px"
-    //         } else {
-    //             if (baidu.browser.ie < 8) {
-    //                 baidu.dom.getParent(Fe.G("ZeroClipboardMovie_1")).style.top = (c.y - 10) + "px";
-    //                 baidu.dom.getParent(Fe.G("ZeroClipboardMovie_1")).style.left = (c.x + 10) + "px"
-    //             } else {
-    //                 baidu.dom.getParent(Fe.G("ZeroClipboardMovie_1")).style.top = (c.y + 6) + "px";
-    //                 baidu.dom.getParent(Fe.G("ZeroClipboardMovie_1")).style.left = (c.x + 11) + "px"
-    //             }
-    //         }
-    //         clearInterval(a)
-    //     }
-    // },
-    // 1000);
     if (!document.all) {
-        Fe.G("copyButton").style.top = "-9px";
-        Fe.G("copyButton").style.left = "5px"
+        Fe.G("baiduCopyButton").style.top = "-9px";
+        Fe.G("baiduCopyButton").style.left = "5px"
     }
     if (baidu.browser.ie >= 8) {
-        Fe.G("copyButton").style.top = "-22px";
-        Fe.G("copyButton").style.left = "5px"
+        Fe.G("baiduCopyButton").style.top = "-22px";
+        Fe.G("baiduCopyButton").style.left = "5px"
     }
     var b = navigator.userAgent.toLowerCase();
     if ((/mozilla/.test(b)) && (!/(compatible|webkit)/.test(b))) {
-        Fe.G("copyButton").style.top = "-22px";
-        Fe.G("copyButton").style.left = "5px"
+        Fe.G("baiduCopyButton").style.top = "-22px";
+        Fe.G("baiduCopyButton").style.left = "5px"
     }
 
     // 绑定复制功能
-    // Fe.G("copyButton").addEventListener('click', function() {
+    // Fe.G("baiduCopyButton").addEventListener('click', function() {
     //     console.log('-0-0-0-0-0-0')
     //     copyTextByCB();
     // });
@@ -915,7 +906,7 @@ function copyTextByCB() {
     }
 
     // var clipboard = new Clipboard('#copyPoint');
-    var clipboard = new Clipboard('#copyButton');
+    var clipboard = new Clipboard('#baiduCopyButton');
 
     clipboard.on('success', function(e) {
         e.clearSelection();

Some files were not shown because too many files changed in this diff