浏览代码

修正了手机端显示范围

xicheng79 3 年之前
父节点
当前提交
ea0815f279
共有 1 个文件被更改,包括 7 次插入4 次删除
  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]