<template>
<view>
<map
style="width: 100vw; height: 100vh;"
:latitude="31.218854"
:longitude="121.582008"
:scale="16"
:enable-satellite="true"
:enable-3D="true"
:polylines="testPolylines"
>
</map>
</view>
</template>
<script>
export default {
data() {
return {
// 直接写死一条线,跨度大一点,确保能看到
testPolylines: [{
points: [
{ latitude: 31.218854, longitude: 121.582008 }, // 起点
{ latitude: 31.220000, longitude: 121.590000 } // 终点(稍微远一点)
],
color: "#FF0000", // 纯红色
width: 6, // 宽度10
dottedLine: false,
zIndex: 999, // 层级最高
level: 'abovebuildings' // 压在建筑物上面
}]
}
}
}
</script>

:polylines="testPolylines"polylines换成polyline呢