From 9a22cd930ed374ee89af1c94225c924d4dcad778 Mon Sep 17 00:00:00 2001 From: jn517618 Date: Thu, 11 Jan 2024 10:58:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/pathMap.vue | 61 +++++-------------- 1 file changed, 14 insertions(+), 47 deletions(-) diff --git a/src/views/energySourcesProvince/component/pathMap.vue b/src/views/energySourcesProvince/component/pathMap.vue index c551c84..bed542a 100644 --- a/src/views/energySourcesProvince/component/pathMap.vue +++ b/src/views/energySourcesProvince/component/pathMap.vue @@ -147,20 +147,20 @@ export default { // this.baiduMap.setMaxZoom(12) // this.baiduMap.disableDragging(); - var bound = new BMapGL.Bounds(new BMapGL.Point(112.415542, 25.582733), new BMapGL.Point(112.415542, 25.582733)); - this.baiduMap.enableScrollWheelZoom(); - this.baiduMap.addOverlay(new BMapGL.Polygon([ - new BMapGL.Point(bound.sw.lng, bound.sw.lat), - new BMapGL.Point(bound.sw.lng, bound.ne.lat), - new BMapGL.Point(bound.ne.lng, bound.ne.lat), - new BMapGL.Point(bound.ne.lng, bound.sw.lat) - ])) - - try { - BMapGLLib.AreaRestriction.setBounds(map, bound); - } catch (e) { - alert(e); - } + // var bound = new BMapGL.Bounds(new BMapGL.Point(112.415542, 25.582733), new BMapGL.Point(112.415542, 25.582733)); + // this.baiduMap.enableScrollWheelZoom(); + // this.baiduMap.addOverlay(new BMapGL.Polygon([ + // new BMapGL.Point(bound.sw.lng, bound.sw.lat), + // new BMapGL.Point(bound.sw.lng, bound.ne.lat), + // new BMapGL.Point(bound.ne.lng, bound.ne.lat), + // new BMapGL.Point(bound.ne.lng, bound.sw.lat) + // ])) + + // try { + // BMapGLLib.AreaRestriction.setBounds(map, bound); + // } catch (e) { + // alert(e); + // } // var opts = { type: BMAP_NAVIGATION_CONTROL_SMALL } // this.baiduMap.addControl(new BMapGL.NavigationControl(opts)); // this.baiduMap.setMapStyleV2({ style: 'midnight' }); @@ -233,39 +233,6 @@ export default { }) this.baiduMap.enableScrollWheelZoom(); - - // bdary.get('郴州市嘉禾县', (rs) => { - // // 绘制行政区 - // for (var i = 0; i < rs.boundaries.length; i++) { - // var path = []; - // var xyArr = rs.boundaries[i].split(';'); - // var ptArr = []; - // for (var j = 0; j < xyArr.length; j++) { - // var tmp = xyArr[j].split(','); - // var pt = new BMapGL.Point(tmp[0], tmp[1]); - // ptArr.push(pt); - // } - // var mapmask = new BMapGL.MapMask(ptArr, { - // isBuildingMask: true, - // isPoiMask: true, - // isMapMask: true, - // showRegion: 'inside', - // topFillColor: '#5679ea', - // topFillOpacity: 0.5, - // sideFillColor: '#5679ea', - // sideFillOpacity: 0.9 - // }); - // this.baiduMap.addOverlay(mapmask); - // var border = new BMapGL.Polyline(ptArr, { - // strokeColor: '#4ca7a2', - // strokeWeight: 3, - // strokeOpacity: 1 - // }); - // this.baiduMap.addOverlay(border); - // } - // }); - - this.baiduMap.setMapStyleV2({ styleJson: styleJson }); this.baiduMap.removeEventListener('tilesloaded', this.handleEvent); this.baiduMap.addEventListener('tilesloaded', this.handleEvent);