|
|
@ -46,7 +46,7 @@ export default { |
|
|
|
this.aMapIns = new this.AMap.Map(this.$refs.mapContainerRef, { |
|
|
|
resizeEnable: true, //是否监控地图容器尺寸变化 |
|
|
|
mapStyle: "amap://styles/blue", |
|
|
|
zoom: 9, |
|
|
|
zoom: 7, |
|
|
|
center: [116.629514, 35.794168], |
|
|
|
}); |
|
|
|
|
|
|
@ -105,7 +105,7 @@ export default { |
|
|
|
}); |
|
|
|
|
|
|
|
//画线 |
|
|
|
function drawingLine(AMap, datas, borderWeight = 1,strokeWeight = 0, olColor = "#00B3CC") { |
|
|
|
function drawingLine(AMap, datas, borderWeight = 1, strokeWeight = 0, olColor = "#00B3CC") { |
|
|
|
return new AMap.Polyline({ |
|
|
|
path: datas, |
|
|
|
isOutline: true, |
|
|
@ -126,7 +126,7 @@ export default { |
|
|
|
|
|
|
|
//画车道 |
|
|
|
// let jhPolyline; |
|
|
|
function drawJHPath(AMap, lczPointList,borderWeight = 1,strokeWeight = 60) { |
|
|
|
function drawJHPath(AMap, lczPointList, borderWeight = 1, strokeWeight = 60) { |
|
|
|
return new AMap.Polyline({ |
|
|
|
path: lczPointList, // 设置线覆盖物路径 |
|
|
|
showDir: true, |
|
|
@ -146,47 +146,47 @@ export default { |
|
|
|
|
|
|
|
//画车道线 |
|
|
|
function createCanvas() { |
|
|
|
let canvasDir = document.createElement('canvas') |
|
|
|
let width = 150; |
|
|
|
let height = 150; |
|
|
|
|
|
|
|
canvasDir.width = width; |
|
|
|
canvasDir.height = height; |
|
|
|
var context = canvasDir.getContext('2d'); |
|
|
|
context.strokeStyle = '#C4C6C7'; |
|
|
|
context.lineJoin = 'round'; |
|
|
|
context.lineWidth = 5; |
|
|
|
|
|
|
|
//左边实线 |
|
|
|
// context.moveTo(5, 0); |
|
|
|
// context.lineTo(5, height); |
|
|
|
//左边虚线 |
|
|
|
context.moveTo(35, 0); |
|
|
|
context.lineTo(35, 50); |
|
|
|
context.moveTo(35, 100); |
|
|
|
context.lineTo(35, 150); |
|
|
|
//中间虚线 |
|
|
|
context.moveTo(75, 20); |
|
|
|
context.lineTo(75, 70); |
|
|
|
context.moveTo(75, 120); |
|
|
|
context.lineTo(75, 170); |
|
|
|
//右边虚线 |
|
|
|
context.moveTo(115, 0); |
|
|
|
context.lineTo(115, 50); |
|
|
|
context.moveTo(115, 100); |
|
|
|
context.lineTo(115, 150); |
|
|
|
//最右侧实线 |
|
|
|
// context.moveTo(width - 5, 0); |
|
|
|
// context.lineTo(width - 5, height); |
|
|
|
|
|
|
|
context.stroke(); |
|
|
|
|
|
|
|
// 绘制一个填充矩形 |
|
|
|
// context.fillStyle = "red"; |
|
|
|
// context.fillRect(0, 0, width, height); |
|
|
|
|
|
|
|
return canvasDir; |
|
|
|
} |
|
|
|
let canvasDir = document.createElement('canvas') |
|
|
|
let width = 150; |
|
|
|
let height = 150; |
|
|
|
|
|
|
|
canvasDir.width = width; |
|
|
|
canvasDir.height = height; |
|
|
|
var context = canvasDir.getContext('2d'); |
|
|
|
context.strokeStyle = '#C4C6C7'; |
|
|
|
context.lineJoin = 'round'; |
|
|
|
context.lineWidth = 5; |
|
|
|
|
|
|
|
//左边实线 |
|
|
|
// context.moveTo(5, 0); |
|
|
|
// context.lineTo(5, height); |
|
|
|
//左边虚线 |
|
|
|
context.moveTo(35, 0); |
|
|
|
context.lineTo(35, 50); |
|
|
|
context.moveTo(35, 100); |
|
|
|
context.lineTo(35, 150); |
|
|
|
//中间虚线 |
|
|
|
context.moveTo(75, 20); |
|
|
|
context.lineTo(75, 70); |
|
|
|
context.moveTo(75, 120); |
|
|
|
context.lineTo(75, 170); |
|
|
|
//右边虚线 |
|
|
|
context.moveTo(115, 0); |
|
|
|
context.lineTo(115, 50); |
|
|
|
context.moveTo(115, 100); |
|
|
|
context.lineTo(115, 150); |
|
|
|
//最右侧实线 |
|
|
|
// context.moveTo(width - 5, 0); |
|
|
|
// context.lineTo(width - 5, height); |
|
|
|
|
|
|
|
context.stroke(); |
|
|
|
|
|
|
|
// 绘制一个填充矩形 |
|
|
|
// context.fillStyle = "red"; |
|
|
|
// context.fillRect(0, 0, width, height); |
|
|
|
|
|
|
|
return canvasDir; |
|
|
|
} |
|
|
|
|
|
|
|
// this.aMapIns.enableAutoResize(); |
|
|
|
}, |
|
|
|