|
|
|
|
@ -159,6 +159,7 @@ export default { |
|
|
|
|
// }) |
|
|
|
|
this.markList.push(marker); |
|
|
|
|
let sContent = `<div style="font-size:0.14rem;line-height:0.22rem;padding:0 0.05rem 0 0.15rem;"> |
|
|
|
|
<div id="close_${deviceId}" style="display:inline-block;color:#fff;font-size:0.16rem;font-weight:bold;width:0.18rem;line-height:0.18rem;cursor:pointer;text-align:center;float:right;">x</div> |
|
|
|
|
<div style="display:flex;align-items:center;margin-bottom:0.15rem;font-style: italic;font-size:0.2rem;font-family: FZSK;"> |
|
|
|
|
<div style="color: #ffffff;margin-right:0.1rem;">${carNo}</div> |
|
|
|
|
<div style="display:inline-block;color:${res.Data.SbcStatus == 3 ? "#ffffff" : "#062766"};background:${res.Data.SbcStatus == 3 ? "#1dd58e !important" : "#9ab3c6 !important"};width:0.65rem;text-align:center;border-radius:100px;font-size:0.16rem;padding:0.04rem 0;">${this.locationStatus[res.Data.SbcStatus]}</div> |
|
|
|
|
@ -174,58 +175,13 @@ export default { |
|
|
|
|
document.getElementById('btnPath_' + deviceId).addEventListener('click', () => { |
|
|
|
|
this.queryPath(deviceId) |
|
|
|
|
}) |
|
|
|
|
document.getElementById('close_' + deviceId).addEventListener('click', () => { |
|
|
|
|
this.baiduMap.closeInfoWindow(); |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
marker.addEventListener('click', () => { |
|
|
|
|
this.openInfo(infoWindow, pt); |
|
|
|
|
}); |
|
|
|
|
//最后一个调用点聚合 |
|
|
|
|
// if (index == this.carList.length - 1) { |
|
|
|
|
// console.log('点聚合') |
|
|
|
|
// let clusterLayer = new mapvgl.ClusterLayer({ |
|
|
|
|
// // minSize: 1, // 聚合点显示的最小直径 |
|
|
|
|
// // maxSize: 15, // 聚合点显示的最大直径 |
|
|
|
|
// // clusterRadius: 150, // 聚合范围半径 |
|
|
|
|
// // gradient: { 0: 'blue', 0.5: 'green', 1.0: 'red' }, // 聚合点颜色梯度 |
|
|
|
|
// // maxZoom: 19, // 聚合的最大级别,当地图放大级别高于此值将不再聚合 |
|
|
|
|
// // minZoom: 5, // 聚合的最小级别,当地图放大级别低于此值将不再聚合 |
|
|
|
|
// // // 是否显示文字 |
|
|
|
|
// // showText: true, |
|
|
|
|
// // // 开始聚合的最少点数,点数多于此值才会被聚合 |
|
|
|
|
// minPoints: 1, |
|
|
|
|
// // 设置非聚合的点的icon |
|
|
|
|
// iconOptions: { |
|
|
|
|
// width: 25, |
|
|
|
|
// height: 25, |
|
|
|
|
// icon: require("@/assets/images/car.png"), |
|
|
|
|
// }, |
|
|
|
|
// enablePicked: true, |
|
|
|
|
// onClick: (e) => { |
|
|
|
|
// if (e.dataItem) { |
|
|
|
|
// // 可通过dataItem下面的children属性拿到被聚合的所有点 |
|
|
|
|
// console.log(e.dataItem); |
|
|
|
|
// if (e.dataItem.children == undefined) { |
|
|
|
|
// let obj = e.dataItem.objdata; |
|
|
|
|
// let lng = obj.resData.BaiduLng; |
|
|
|
|
// let lat = obj.resData.BaiduLat; |
|
|
|
|
// let pt = new BMap.Point(lng, lat); |
|
|
|
|
// let sContent = `<div style="padding:0 10px 10px;font-size:14px;line-height:22px;"> |
|
|
|
|
// <div>车牌号:${obj.carNo}</div> |
|
|
|
|
// <div>设备位置:${obj.res2Data}</div> |
|
|
|
|
// <div>最后定位时间:${obj.resData.GPSTimeStamp.replace("T", " ")}</div> |
|
|
|
|
// <div>状态:${this.locationStatus[obj.resData.SbcStatus]}</div> |
|
|
|
|
// <div>时速:${obj.resData.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_${obj.deviceId}">行车轨迹</div> |
|
|
|
|
// </div>`; |
|
|
|
|
// this.openWindow(sContent, pt, obj.deviceId); |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// }, |
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
// this.view.addLayer(clusterLayer); |
|
|
|
|
// clusterLayer.setData(this.viewData); |
|
|
|
|
|
|
|
|
|
// } |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|