<template>
<view class="map">
<map style="width: 100%; height: 100%" ref="map" :latitude="latitude" :longitude="longitude" :polyline="polyline" :markers="markers">
<view class="tips">
<view class="txt">全程4站/9分钟 预计10:51到达下车站</view>
</view>
</map>
<!-- <view class="mask" @click="goBusDetail"></view> -->
</view>
</template>
<script>
let markers = points.filter(i => i.flag == 1 || i.flag == 2 || i.flag == 3)
this.markers = markers.map((v, index) => {
let options = {
id: index + 1,
iconPath: '/static/images/approachPoint.png', // 替换为你的图标路径
width: 12,
height: 12
}
return {
latitude: v.latitude,
longitude: v.longitude,
anchor: { x: 0.5, y: 0.5 }, <--------------------------
...options
}
})
}
},
}
</script>
4***@qq.com
- 发布:2024-06-11 16:31
- 更新:2024-06-12 11:13
- 阅读:89
2 个回复
g***@163.com
你好可以交流一下 qq1375858873
沈工
https://ext.dcloud.net.cn/plugin?id=18122 我写的可以参考下,有疑惑加wx:shenhl-0321