From 331f3d5bf0edee1946f65576e0c49d61b292a95d Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 08 Dec 2023 16:00:11 +0800
Subject: [PATCH] 禁止地图旋转

---
 src/store/modules/openlayerData.js |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/store/modules/openlayerData.js b/src/store/modules/openlayerData.js
index ec68be0..86a657a 100644
--- a/src/store/modules/openlayerData.js
+++ b/src/store/modules/openlayerData.js
@@ -33,6 +33,7 @@
 import OlSourceOSM from "ol/source/OSM.js";
 import OlLayerTile from "ol/layer/Tile.js";
 import OlMap from "ol/Map.js";
+import { defaults as defaultInteractions } from "ol/interaction";
 
 import XYZ from "ol/source/XYZ";
 
@@ -49,6 +50,9 @@
     },
     openlayers: {
       map2D: new OlMap({
+        interactions: defaultInteractions({
+          pinchRotate: false, // 移动端禁止地图旋转
+        }),
         layers: [
           /**
              *  new OlLayerTile({

--
Gitblit v1.9.3