<map
:style="{height: `${windowHeight}px`}"
:longitude="map.centerPoint[0]"
:latitude="map.centerPoint[1]"
:markers="map.markers"
/>
map.markers = [
{
id: 0,
longitude: startAddress.location.coordinates[0],
latitude: startAddress.location.coordinates[1],
iconPath: "/static/images/green-dot.png",
title: "起点",
width: 20,
height: 20,
label: {
content: startAddress.locationName
}
},
{
id: 1,
longitude: endAddress.location.coordinates[0],
latitude: endAddress.location.coordinates[1],
iconPath: "/static/images/green-dot.png",
title: "终点",
width: 20,
height: 20,
label: {
content: endAddress.locationName
}
}
];
map没有被正常显示,但是label里的内容会被重新渲染到map上
1***@qq.com (作者)
经过我长时间的测试,一单map组件加载完毕,再用任务方式更新markers都无法正常更新,除非重新渲染一下map组件
2022-02-02 17:08