From 30fe4cd9c36002c112c5025dcf05819034f71233 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期一, 29 五月 2023 10:27:09 +0800
Subject: [PATCH] 补充瓦片下载功能-wu

---
 src/views/Tools/LayerTree.vue |   36 +++++++++++++++++++++++++++++++++++-
 1 files changed, 35 insertions(+), 1 deletions(-)

diff --git a/src/views/Tools/LayerTree.vue b/src/views/Tools/LayerTree.vue
index b9439d4..93094ac 100644
--- a/src/views/Tools/LayerTree.vue
+++ b/src/views/Tools/LayerTree.vue
@@ -76,6 +76,11 @@
            v-show="shwoHistogram">
         <i class="el-icon-tickets"></i>&nbsp;&nbsp;閽诲瓟鏌辩姸鍥�
       </div>
+      <div class="edit"
+           v-show="shwoTileDown"
+           @click="tileDownload()">
+        <i class="el-icon-download"></i>&nbsp;&nbsp;鐡︾墖涓嬭浇
+      </div>
     </el-card>
   </div>
 </template>
@@ -98,6 +103,7 @@
       shwoHistogram: false, // 閽诲瓟鏌辩姸鍥�
       showLocal: false, // 瀹氫綅
       showOpacity: false, // 涓嶉�忔槑搴�
+      shwoTileDown: false, // 鐡︾墖涓嬭浇
       menuVisible: false, // 鑿滃崟
       levelArray: [ // 楂樼▼鏁扮粍
         0, 40000000, 20000000, 10000000, 5000000, 2000000, 1000000, 500000,
@@ -245,7 +251,8 @@
       this.shwoHistogram = this.showProp && object.enName == "s_explorationpoint"; // 閽诲瓟鏌辩姸鍥�
       this.showLocal = ["Tileset", "3DML", "Mpt", "TMS", "DOM", "DEM"].indexOf(object.serveType) > -1; // 瀹氫綅
       this.showOpacity = ["Tileset", "3DML"].indexOf(object.serveType) > -1; // 涓嶉�忔槑搴�
-      this.menuVisible = this.showProp || this.shwoHistogram || this.showLocal || this.showOpacity; // 鑿滃崟
+      this.shwoTileDown = ["TMS", "DOM"].indexOf(object.serveType) > -1 && object.pubid; // 鐡︾墖涓嬭浇
+      this.menuVisible = this.showProp || this.shwoHistogram || this.showLocal || this.showOpacity || this.shwoTileDown; // 鑿滃崟
 
       this.$refs.card.$el.style.left = event.pageX + 20 + "px";
       this.$refs.card.$el.style.top = event.pageY + "px";
@@ -313,6 +320,33 @@
 
       return this.levelArray[this.levelArray.length - 1];
     },
+    // 鐡︾墖涓嬭浇
+    tileDownload () {
+      this.rmListener();
+
+      var that = this;
+      sgworld.Creator.createSimpleGraphic(
+        "rectangle", {},
+        function (entity) {
+          that.getTileRectangle(entity);
+          sgworld.Creator.SimpleGraphic.clear();
+        }
+      );
+    },
+    // 鑾峰彇鐡︾墖鍥涜嚦鑼冨洿
+    getTileRectangle (res) {
+      var value = res.rectangle.coordinates.getValue();
+      var val = {
+        pubid: this.currentData.pubid,
+        pwd: "",
+        title: "",
+        xmax: Cesium.Math.toDegrees(value.east),
+        xmin: Cesium.Math.toDegrees(value.west),
+        ymax: Cesium.Math.toDegrees(value.north),
+        ymin: Cesium.Math.toDegrees(value.south)
+      }
+      this.$bus.$emit("titleDown", val);
+    },
     // 鍥惧眰閫変腑浜嬩欢
     handleCheckChange (data, checked) {
       if (this.isBusy) return;

--
Gitblit v1.9.3