找了一下午也没找到这个方法怎么才能有效过(微信小程序开发)
wxml:
<map id="map" class="map" longitude="{
{lng}}" latitude="{
{lat}}" markers="{
{markers}}" polyline="{
{polyline}}" >
<cover-view bindtap="play">擦拭</cover-view>
</map>
js:
polyline: [{
points: pathArr,
color: '#3777FF', //线填充色
width: 8, //折线宽度
borderWidth: 5, //边线宽度
borderColor: '#FFF', //边线颜色
lineCap: 'round', //线端头方式
arrowLine: true,
id: 250, //路线id
}],
/此方法就是轨迹运动
this.setData({mapCtx:wx.createMapContext("map", this) })
// 缩放地图
this.data.mapCtx.includePoints({
points: pathArr, //路线
padding: [50]
})
//