|
|
|
|
@ -51,9 +51,9 @@ export default { |
|
|
|
|
this.baiduMap.setMapStyleV2({ |
|
|
|
|
styleId: 'ec6ebc8ad35bcfbd56a424a29f325360'//'ef4f05652d24d0f23332710fbacad245'// |
|
|
|
|
}); |
|
|
|
|
this.view = new mapvgl.View({ |
|
|
|
|
map: this.baiduMap |
|
|
|
|
}); |
|
|
|
|
// this.view = new mapvgl.View({ |
|
|
|
|
// map: this.baiduMap |
|
|
|
|
// }); |
|
|
|
|
var bdary = new BMapGL.Boundary(); |
|
|
|
|
bdary.get("日照市莒县", rs => { |
|
|
|
|
var count = rs.boundaries.length; |
|
|
|
|
@ -84,11 +84,14 @@ export default { |
|
|
|
|
}) |
|
|
|
|
this.baiduMap.addEventListener('tilesloaded', () => { |
|
|
|
|
this.carList.map((item, index) => { |
|
|
|
|
this.markList.map(mark => { |
|
|
|
|
this.baiduMap.removeOverlay(mark); |
|
|
|
|
}) |
|
|
|
|
this.markList = []; |
|
|
|
|
this.queryLunz(item.deviceId, item.key, item.cardNo, index); |
|
|
|
|
}) |
|
|
|
|
this.setInterval = setInterval(() => { |
|
|
|
|
this.view.removeAllLayers(); |
|
|
|
|
// this.view.removeAllLayers(); |
|
|
|
|
this.markList.map(mark => { |
|
|
|
|
this.baiduMap.removeOverlay(mark); |
|
|
|
|
}) |
|
|
|
|
@ -102,6 +105,15 @@ export default { |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
//单个设备定位聚焦放大 |
|
|
|
|
queryDingwei(deviceId) { |
|
|
|
|
lunzApi.getCurrentDeviceInfoByIMEI(this.appKey, deviceId).then(res => { |
|
|
|
|
let lng = res.Data.BaiduLng; |
|
|
|
|
let lat = res.Data.BaiduLat; |
|
|
|
|
let pt = new BMapGL.Point(lng, lat); |
|
|
|
|
this.baiduMap.centerAndZoom(pt, 18); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//查询定位 |
|
|
|
|
queryLunz(deviceId, key, carNo, index) { |
|
|
|
|
// lunzApi.getCarUserSimpleByImei(this.appKey, deviceId).then(res1 => { |
|
|
|
|
@ -133,13 +145,13 @@ export default { |
|
|
|
|
<div>最后定位时间:${res.Data.GPSTimeStamp.replace("T", " ")}</div> |
|
|
|
|
<div>状态:${this.locationStatus[res.Data.SbcStatus]}</div> |
|
|
|
|
<div>时速:${res.Data.spd}km/h</div> |
|
|
|
|
<div style="display: inline-block;border: 1px solid #eee;border-radius: 3px;padding: 3px 8px;color: #0e94eb;cursor: pointer;" id="btnPath_${key}">行车轨迹</div> |
|
|
|
|
<div style="display: inline-block;border: 1px solid #eee;border-radius: 3px;padding: 3px 8px;color: #0e94eb;cursor: pointer;" id="btnPath_${deviceId}">行车轨迹</div> |
|
|
|
|
</div>`; |
|
|
|
|
let infoWindow = new BMapGL.InfoWindow(sContent); |
|
|
|
|
// marker添加点击事件 |
|
|
|
|
infoWindow.addEventListener('open', () => { |
|
|
|
|
document.getElementById('btnPath_' + key).addEventListener('click', () => { |
|
|
|
|
this.queryPath(key) |
|
|
|
|
document.getElementById('btnPath_' + deviceId).addEventListener('click', () => { |
|
|
|
|
this.queryPath(deviceId) |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
marker.addEventListener('click', () => { |
|
|
|
|
@ -221,6 +233,13 @@ export default { |
|
|
|
|
"MaxValue": 500 |
|
|
|
|
} |
|
|
|
|
lunzApi.getLocationsByImei(this.key, param).then(res => { |
|
|
|
|
if (res.Data == null) { |
|
|
|
|
this.$message({ |
|
|
|
|
message: '未查询到今日行车轨迹', |
|
|
|
|
type: 'warning' |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
let point = []; |
|
|
|
|
res.Data.map(item => { |
|
|
|
|
point.push(new BMapGL.Point(item.Lng, item.Lat)); |
|
|
|
|
@ -231,6 +250,8 @@ export default { |
|
|
|
|
} |
|
|
|
|
this.polyline = new BMapGL.Polyline(point, { strokeColor: '#F5533D', strokeWeight: 5, strokeOpacity: 1, }) |
|
|
|
|
this.baiduMap.addOverlay(this.polyline); |
|
|
|
|
this.baiduMap.centerAndZoom(point[0], 15); |
|
|
|
|
this.baiduMap.closeInfoWindow(); |
|
|
|
|
// this.polyline = new BMapGL.Polyline(point, { |
|
|
|
|
// strokeColor: '#F5533D', |
|
|
|
|
// strokeWeight: 5, |
|
|
|
|
|