Browse Source

修正了手机端显示范围

xicheng79 3 years ago
parent
commit
ea0815f279
1 changed files with 7 additions and 4 deletions
  1. 7 4
      src/components/map.vue

+ 7 - 4
src/components/map.vue

@@ -216,11 +216,14 @@ export default {
      */
     initMap: function () {
       // PNG范围
-      let leftTop = [104.134737921, 30.6924231322]
-      let rightBottom = [104.155317192, 30.6466570878]
+      let leftTop = [11592187.449797414, 3592590.200040145]
+      let rightBottom = [11594508.118271504, 3587434.465393465]
+      // 经纬度
+      // let leftTop = [104.13439162531515, 30.690273107307597]
+      // let rightBottom = [104.15523854491164, 30.650437034690334]
       rightBottom = this.getExtentFromPNG(leftTop, rightBottom)
-      leftTop = olProj.fromLonLat(leftTop)
-      rightBottom = olProj.fromLonLat(rightBottom)
+      // leftTop = olProj.fromLonLat(leftTop)
+      // rightBottom = olProj.fromLonLat(rightBottom)
       // 根据设备的不同设置地图范围
       const MOBILE = [leftTop[0], rightBottom[1], rightBottom[0], leftTop[1]]
       // const PC = [11591064, 3589994, 11595665, 3592078]