Ver código fonte

修改移动端地图

tml 5 meses atrás
pai
commit
1213ba86c8

+ 4 - 4
nngkxxdp/src/main/resources/static/naxsb/mobile/dqfwNewMobile.html

@@ -669,13 +669,13 @@
       } else if (id == 2) {
         this.loadheatMap('https://www.cqna.gov.cn/syygapi/naxsb/json/xjqcdzcyy.json', '106.74585,29.610364');
       } else if (id == 3) {
-        this.loadheatMap('https://www.cqna.gov.cn/syygapi/naxsb/json/cjlscxcyy.json', '106.620834,29.575306');
+        this.loadheatMap('https://www.cqna.gov.cn/syygapi/naxsb/json/cjlscxcyy.json', '106.650834,29.545306');
       } else if (id == 4) {
-        this.loadheatMap('https://www.cqna.gov.cn/syygapi/naxsb/json/npxqcyy.json', '106.496471,29.573469');
+        this.loadheatMap('https://www.cqna.gov.cn/syygapi/naxsb/json/npxqcyy.json', '106.520471,29.543469');
       } else if (id == 5) {
-        this.loadheatMap('https://www.cqna.gov.cn/syygapi/naxsb/json/ylcxg.json', '106.656781,29.572237');
+        this.loadheatMap('https://www.cqna.gov.cn/syygapi/naxsb/json/ylcxg.json', '106.696781,29.532237');
       } else if (id == 6) {
-        this.loadheatMap('https://www.cqna.gov.cn/syygapi/naxsb/json/dxkjy.json', '106.688802,29.654054');
+        this.loadheatMap('https://www.cqna.gov.cn/syygapi/naxsb/json/dxkjy.json', '106.728802,29.610054');
       }
 
     },

+ 21 - 51
nngkxxdp/src/main/resources/static/naxsb/mobile/tdcrlistMobile.html

@@ -20,7 +20,8 @@
     <!-- 引入组件库 -->
     <script src="https://www.cqna.gov.cn/syygapi/naxsb/js/index.js"></script>
     <script src="https://www.cqna.gov.cn/syygapi/naxsb/js/jquery-3.5.1.min.js"></script>
-    <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=7XivTux4H2e1ifKLjvEhxfuayDYxAluq">
+  <script type="text/javascript"
+    src="https://api.map.baidu.com/api?type=webgl&v=3.0&ak=7XivTux4H2e1ifKLjvEhxfuayDYxAluq">
     </script>
     <script src="https://www.cqna.gov.cn/syygapi/naxsb/js/jquery-3.5.1.min.js"></script>
     <script src="https://www.cqna.gov.cn/syygapi/naxsb/js/urljson.js"></script>
@@ -267,6 +268,10 @@
             color: #999999;
             flex-direction: column;
         }
+
+        #mapcontainer {
+            touch-action: none;
+        }
     </style>
 </head>
 
@@ -350,11 +355,6 @@
             this.getSellLand(id);
         },
         methods: {
-            goDeteil(id) {
-                if (id) {
-                    window.location.href = "ztcrdetailMobile.html?ztid=" + id;
-                }
-            },
             handleParkChange(data) {
                 this.currentPq = data.id;
                 this.inputValue = '';
@@ -435,18 +435,18 @@
                 fetch('https://www.cqna.gov.cn/syygapi/naxsb/js/najson.json')
                     .then(response => response.json())
                     .then(data => {
-                        let map = new BMap.Map("mapcontainer");
+                        let map = new BMapGL.Map("mapcontainer");
                         map.enableScrollWheelZoom();
                         map.enableDragging();
-                        map.centerAndZoom(new BMap.Point(106.665444, 29.53982), 12);
+                        map.centerAndZoom(new BMapGL.Point(106.665444, 29.53982), 12);
                         map.setMapType(BMAP_NORMAL_MAP);
                         var pointList = data.features[0].geometry.coordinates[0][0];
                         let result = [];
                         pointList.forEach(function (point) {
-                            result.push(new BMap.Point(point[0], point[1]));
+                            result.push(new BMapGL.Point(point[0], point[1]));
                         });
 
-                        let polygon = new BMap.Polygon(result, {
+                        let polygon = new BMapGL.Polygon(result, {
                             strokeColor: "#226cfb",
                             strokeWeight: 1.5,
                             strokeOpacity: 1,
@@ -459,14 +459,14 @@
 
                         if (that.yqMapAddr.addr) {
                             var points = that.yqMapAddr.addr;
-                            let pointList = points.split('@');
-                            let result = [];
-                            pointList.forEach(function (point) {
+                            let pointList1 = points.split('@');
+                            let result1 = [];
+                            pointList1.forEach(function (point) {
                                 let arr = point.split(',');
-                                result.push(new BMap.Point(arr[0], arr[1]));
+                                result1.push(new BMapGL.Point(arr[0], arr[1]));
                             });
 
-                            let polygon = new BMap.Polygon(result, {
+                            let polygon1 = new BMapGL.Polygon(result1, {
                                 strokeColor: "transparent",
                                 strokeWeight: 0,
                                 strokeOpacity: 1,
@@ -475,7 +475,7 @@
                                 fillOpacity: 0.5
                             });
 
-                            map.addOverlay(polygon);
+                            map.addOverlay(polygon1);
                         }
 
                         var allpoints = that.allpointList;
@@ -486,11 +486,11 @@
                                 let result = [];
                                 pointList.forEach(function (point) {
                                     let arr = point.split(',');
-                                    result.push(new BMap.Point(arr[0], arr[1]));
+                                    result.push(new BMapGL.Point(arr[0], arr[1]));
                                 });
                                 var color = polygonData.color;
 
-                                let polygon = new BMap.Polygon(result, {
+                                let polygon = new BMapGL.Polygon(result, {
                                     strokeColor: "transparent",
                                     strokeWeight: 0,
                                     strokeOpacity: 1,
@@ -508,50 +508,20 @@
                                 let result = [];
                                 pointList.forEach(function (point) {
                                     let arr = point.split(',');
-                                    result.push(new BMap.Point(arr[0], arr[1]));
+                                    result.push(new BMapGL.Point(arr[0], arr[1]));
                                 });
 
-                                let polygon = new BMap.Polygon(result, {
+                                let polygon = new BMapGL.Polygon(result, {
                                     strokeColor: "red",
                                     strokeWeight: 2,
                                     strokeOpacity: 1,
                                     strokeStyle: "solid",
                                     fillColor: "transparent",
-                                    fillOpacity: 0.3
+                                    fillOpacity: 0
                                 });
                                 map.addOverlay(polygon);
                                 var id = polygonData.id;
 
-
-                                var label = new BMap.Label(polygonData.landName, {
-                                    position: polygon.getBounds().getCenter(),
-                                    offset: new BMap.Size(0, 0)
-                                });
-                                label.setStyle({
-                                    color: "#186FF0",
-                                    fontSize: "15px",
-                                    height: "auto",
-                                    lineHeight: "20px",
-                                    fontFamily: "微软雅黑",
-                                    fontWeight: 'bold',
-                                    backgroundColor: 'transparent',
-                                    border: 'none',
-                                    textShadow: '0 0 4px #4B97F5',
-                                    textStrokeColor: "#4B97F5",
-                                    textStrokeWidth: "4px",
-                                });
-                                polygon.addEventListener("mouseover", function () {
-                                    map.addOverlay(label);
-                                    label.setStyle({ display: "block" });
-                                });
-
-
-                                polygon.addEventListener("mouseout", function () {
-
-                                    label.setStyle({ display: "none" });
-                                });
-
-
                                 polygon.addEventListener("click", function () {
                                     window.location.href = 'tdcrMobile.html?tdid=' + id;
                                 });