From 290aa4c2bcd83c584e0b10cab76131c069bf64b7 Mon Sep 17 00:00:00 2001 From: 少年 <1392120328@qq.com> Date: 星期三, 13 三月 2024 10:44:25 +0800 Subject: [PATCH] youhua --- src/utils/map2.js | 23 ++++++++++++++++++++++- 1 files changed, 22 insertions(+), 1 deletions(-) diff --git a/src/utils/map2.js b/src/utils/map2.js index 2cb9b64..baeefb1 100644 --- a/src/utils/map2.js +++ b/src/utils/map2.js @@ -2245,6 +2245,7 @@ //openlayer 鍦板浘鐐瑰嚮浜嬩欢 export function setClick(state) { function handleClick(e) { + console.log(e,'鍦板浘鐐瑰嚮') store.setLayerPanelShow(false); // 鍦熷湴绠$悊 if (store.tdglInfo.flag) { @@ -2481,4 +2482,24 @@ zoom: 15, duration: 1500 }) -} \ No newline at end of file +} + +//鐩戝惉鍦板浘鍙屽嚮浜嬩欢 + +export function touchClick() { + let dom = document.getElementById('openlayerContainer'); + dom.addEventListener('touchstart', onTouchStart); + function onTouchStart(e) { + let len = e.touches.length; + if (len === 2) { + window.mapapi.getView().animate({ + center: window.mapapi.getView().getCenter(), + zoom: window.mapapi.getView().getZoom() - 1, + duration: 1000, + }); + } + } +} + + + -- Gitblit v1.9.3