From edba1eb33a06bfb9b64e9d6d2e3de8bc49eca333 Mon Sep 17 00:00:00 2001 From: lixuliang <lixuliang_hd@126.com> Date: 星期三, 13 三月 2024 10:47:52 +0800 Subject: [PATCH] 20240313 --- src/components/viewer2.vue | 74 +++++++++++++++++++----------------- 1 files changed, 39 insertions(+), 35 deletions(-) diff --git a/src/components/viewer2.vue b/src/components/viewer2.vue index 36f3865..ea35086 100644 --- a/src/components/viewer2.vue +++ b/src/components/viewer2.vue @@ -57,7 +57,7 @@ </template> <script> import store from "@/utils/store2.js"; -import { setClick, leftClick } from "@/utils/map2.js"; +import { setClick, leftClick,touchClick } from "@/utils/map2.js"; import _GLOBAL from "@/assets/GLOBAL2"; // import { leftClick, loadLayer } from "@/utils/map.js"; import leftBottom from "@/components/leftMenu/bottom2.vue"; @@ -259,25 +259,29 @@ view: new ol.View({ center: [116.505348, 39.795592], projection: "EPSG:4326", - zoom: 12, - minZoom: 9.5, + zoom: 15, + minZoom: 12, + maxZoom: 18, enableRotation: false, }), }); window.mapapi = map; + // 鍔犺浇褰卞儚搴曞浘 + // addImageLayer(); + // 鍔犺浇楂樺痉娉ㄨ + // addAnnotationLayer(); + // 鍔犺浇鐭㈤噺鍦板浘 + loadBaseMap(); - addImageLayer(); - addAnnotationLayer(); addHxLayer(); addYzLayer(); setClick(true); + touchClick(); getCurrentPosition(); listenDirection(); - - // leftClick() window.layerOpen = function (name, options) { @@ -336,34 +340,34 @@ }, methods: { clicktoclose() { - clearTimeout(this.timer); - this.timer = setTimeout(() => { - this.count++; - if (this.count == 2) { - // console.log("鍗曞嚮浜嬩欢"); - // 鍏抽棴鎵�鏈夊脊绐� - //this.$refs.menu.closeall(); - // 娓呴櫎瀹氫綅涓殑浣嶇疆鏍囪 - //this.$refs.menu.clearFlyPoint(); - } else { - // 鎵ц鏀惧ぇ鎿嶄綔 - // console.log("鍙屽嚮"); - // Viewer.camera.zoomIn(); - // console.log(window.clickPOI); - // let p = sgworld.Navigate.getDegrees(); - // console.log(p); - // Viewer.camera.flyTo({ - // destination: Cesium.Cartesian3.fromDegrees( - // window.clickPOI.lon, - // window.clickPOI.lat, - // p.height / 1.8 - // ), - // duration: 1.0, - // }); - } - this.count = 0; - }, 300); - this.count++; + // clearTimeout(this.timer); + // this.timer = setTimeout(() => { + // this.count++; + // if (this.count == 2) { + // // console.log("鍗曞嚮浜嬩欢"); + // // 鍏抽棴鎵�鏈夊脊绐� + // //this.$refs.menu.closeall(); + // // 娓呴櫎瀹氫綅涓殑浣嶇疆鏍囪 + // //this.$refs.menu.clearFlyPoint(); + // } else { + // // 鎵ц鏀惧ぇ鎿嶄綔 + // // console.log("鍙屽嚮"); + // // Viewer.camera.zoomIn(); + // // console.log(window.clickPOI); + // // let p = sgworld.Navigate.getDegrees(); + // // console.log(p); + // // Viewer.camera.flyTo({ + // // destination: Cesium.Cartesian3.fromDegrees( + // // window.clickPOI.lon, + // // window.clickPOI.lat, + // // p.height / 1.8 + // // ), + // // duration: 1.0, + // // }); + // } + // this.count = 0; + // }, 300); + // this.count++; }, datafromchild(data) { for (var i in data) { -- Gitblit v1.9.3