From ffa44dff73d3834115dc619f2a0043ac288dd32b Mon Sep 17 00:00:00 2001
From: 少年 <1392120328@qq.com>
Date: 星期二, 06 二月 2024 18:04:12 +0800
Subject: [PATCH] 11

---
 src/utils/map2.js |   63 ++++---------------------------
 1 files changed, 8 insertions(+), 55 deletions(-)

diff --git a/src/utils/map2.js b/src/utils/map2.js
index e7cef48..cbe393c 100644
--- a/src/utils/map2.js
+++ b/src/utils/map2.js
@@ -8,7 +8,7 @@
 import Vue from 'vue';
 import axios from "axios";
 import _GLOBAL from '@/assets/GLOBAL2';
-import poiLayer from '@/components/poplayer/main';
+import poiLayer2 from '@/components/poplayer/main2';
 import store from "@/utils/store2";
 import { Message } from 'element-ui';
 let tdglLine, qiyexinxi, qysl, ydbm, ydlx, cyfx, crzt, ydmj, crnx, crnf, rjl, jzxg, jzmd;
@@ -16,7 +16,7 @@
 var clickEvent;
 
 window.tdglLine = tdglLine
-let PoiLayerConstructor = Vue.extend(poiLayer);
+let PoiLayerConstructor = Vue.extend(poiLayer2);
 /**鏍稿績鍖� */
 export function loadHXQ() {
     let urls = window.gisBaseUrl + "/gisserver/wmsserver/YZ_BJ60";
@@ -2234,19 +2234,6 @@
 
 //openlayer 鍦板浘鐐瑰嚮浜嬩欢
 export function setClick(state) {
-    console.log('setClick');
-    let ponitPanel = document.getElementById('ponitPanel');
-    let overlay = new ol.Overlay({
-        element: ponitPanel,
-        autoPan: {
-            animation: {
-                duration: 250,
-            },
-        },
-    });
-    window.map.addOverlay(overlay);
-
-    // let _clickCallback = callback;
     function handleClick(e) {
         console.log(e.coordinate);
         // 鍦熷湴绠$悊
@@ -2351,7 +2338,7 @@
                                         rjl,
                                         jzxg,
                                         jzmd,
-                                        lon:e.coordinate[0],
+                                        lon: e.coordinate[0],
                                         lat: e.coordinate[1],
                                     }
                                 }
@@ -2367,12 +2354,8 @@
             return;
         }
 
-
         window.map.forEachFeatureAtPixel(e.pixel, function (feature) {
-            // console.log(feature, '111111')
             if (feature && feature.values_.desc) {
-                ponitPanel.style.display = 'block'
-
                 let obj = feature.values_.desc
                 objdata = {
                     POITYPE: "POINT",
@@ -2382,23 +2365,10 @@
                     lat: obj.lat
                 }
 
-
-                ponitPanel.innerHTML = `
-                       <div class="ponitPanel-name">
-                         <span>鍚嶇О锛�</span>
-                         <span>${objdata.name}</span>
-                       </div>
-                     <div class="ponitPanel-value"> 
-                        <span>鍦板潃锛�</span>
-                       <span>${objdata.address}</span>
-                    </div>`
-
-                setTimeout(() => {
-                    overlay.setPosition(e.coordinate);
-                }, 0)
-
-                // store.setPoplayerShowAction(true);
-                // store.setPoplayerListAction(objdata);
+                store.setTdglShow(false);
+                store.setTdlgInfo({});
+                store.setdwShow(true);
+                store.setdwInfo(objdata);
                 // if (window.instance) {
                 //     window.instance.$destroy();
                 // }
@@ -2421,26 +2391,9 @@
 
 
 export function flyToPoint(posisitons) {
-    // let zoom = window.map.getView().getZoom();
-    // if (zoom >= 16) {
-    //     zoom = 12
-    // }
-    // let duration = 2000;
     window.map.getView().animate({
         center: posisitons,
-        zoom: 12,
+        zoom: 15,
         duration: 1500
     })
-    // window.map.getView().animate(
-    //     //鍔ㄧ敾寮�濮嬫椂
-    //     {
-    //         zoom: zoom > 16 ? zoom - 0.01 : zoom + 0.01,
-    //         duration: duration / 2,
-    //     },
-    //     //鍔ㄧ敾缁撴潫鏃�
-    //     {
-    //         zoom: zoom >= 16 ? 16 : zoom + 4,
-    //         duration: duration / 2,
-    //     }
-    // );
 }
\ No newline at end of file

--
Gitblit v1.9.3