1
0
forked from dyf/APP

常规小优化

This commit is contained in:
liub
2026-04-22 08:29:06 +08:00
parent 01ff9c7a05
commit 1f88de4710
22 changed files with 1682 additions and 392 deletions

View File

@ -79,16 +79,17 @@ export default {
this.latitude = lat;
this.longitude = lng;
// 创建标记点
console.log("devicePic=",marker)
this.covers = [{
id: marker.deviceImei, // 适配deviceId字段
latitude: lat,
longitude: lng,
iconPath: marker.devicePic || '/static/images/common/mapLocation.png',
width: 40,
height: 40,
iconPath: '/static/images/common/mapLocation.png',
width: 60,
height: 60,
anchor: {x: 0.5, y: 0.5}, // 锚点在中心
callout: {
content: `ID: ${marker.deviceImei}`
content: `${marker.deviceName}`
}
}];
@ -102,17 +103,18 @@ export default {
this.latitude = parseFloat(firstMarker.latitude);
this.longitude = parseFloat(firstMarker.longitude);
console.log("devicePic=",marker.devicePic)
// 转换所有有效标记点
this.covers = markers.map((marker, index) => ({
id: marker.deviceId || marker.id || marker.deviceImei || index + 1,
latitude: parseFloat(marker.latitude),
longitude: parseFloat(marker.longitude),
iconPath: marker.devicePic || '/static/images/common/device.png',
width: 40,
height: 40,
iconPath: '/static/images/common/mapLocation.png',
width: 60,
height: 60,
anchor: {x: 0.5, y: 0.5},
callout: {
content: `ID: ${marker.deviceImei}`,
content: `${marker.deviceName}`,
}
}));