收藏
回答

卫星地图下polylines无法展示?

<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>
回答关注问题邀请回答
收藏

2 个回答

  • 小黎
    小黎
    01-20
    :polylines="testPolylines"
    

    polylines换成polyline呢

    01-20
    有用
    回复 1
    • 蓝.T.
      蓝.T.
      02-06
      好像可以的,谢谢
      02-06
      回复
  • 智能回答 智能回答 本次回答由AI生成
    01-20
    有用
    回复 1
    • 蓝.T.
      蓝.T.
      02-06
      什么机型都不行啊
      02-06
      回复
登录 后发表内容