|
|
|
|
@ -147,13 +147,58 @@ export default { |
|
|
|
|
// this.baiduMap.setMaxZoom(12) |
|
|
|
|
// this.baiduMap.disableDragging(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// var bound = new BMapGL.Bounds(new BMapGL.Point(112.360565,25.638301), new BMapGL.Point(112.376986,25.627551)); |
|
|
|
|
// 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) |
|
|
|
|
// ], { |
|
|
|
|
// // strokeOpacity: 0, |
|
|
|
|
// // fillOpacity: 0 |
|
|
|
|
// })) |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
BMapGLLib.AreaRestriction.setBounds(this.baiduMap, bound); |
|
|
|
|
} catch (e) { |
|
|
|
|
console.log(e) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 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); |
|
|
|
|
// } |
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
// var opts = { type: BMAP_NAVIGATION_CONTROL_SMALL } |
|
|
|
|
// this.baiduMap.addControl(new BMapGL.NavigationControl(opts)); |
|
|
|
|
// this.baiduMap.setMapStyleV2({ style: 'midnight' }); |
|
|
|
|
|
|
|
|
|
var bdary = new BMapGL.Boundary(); |
|
|
|
|
// this.baiduMap.setMapStyleV2({ |
|
|
|
|
// styleJson: styleJson |
|
|
|
|
// }) |
|
|
|
|
@ -193,9 +238,10 @@ export default { |
|
|
|
|
// // this.baiduMap.addOverlay(ply); //添加覆盖物 |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
this.baiduMap.centerAndZoom(point, 10); |
|
|
|
|
this.baiduMap.setTilt(50); |
|
|
|
|
this.baiduMap.enableScrollWheelZoom(); |
|
|
|
|
|
|
|
|
|
this.baiduMap.setTilt(40); |
|
|
|
|
|
|
|
|
|
var bdary = new BMapGL.Boundary(); |
|
|
|
|
bdary.get('郴州市嘉禾县', (rs) => { |
|
|
|
|
var count = rs.boundaries.length; //行政区域的点有多少个 |
|
|
|
|
var pointArray = []; |
|
|
|
|
@ -219,7 +265,7 @@ export default { |
|
|
|
|
this.baiduMap.addOverlay(prism); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.baiduMap.enableScrollWheelZoom(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.baiduMap.setMapStyleV2({ styleJson: styleJson }); |
|
|
|
|
this.baiduMap.removeEventListener('tilesloaded', this.handleEvent); |
|
|
|
|
|