使用map组件 polyline属性在地图上绘制路线,真机测试ios手机没有问题,android手机没有
能用上了 贴上部分代码
<map id=“map” style=“width: 100%; height: 100%;” scale="{{zoomLevel}}" longitude="{{lng}}" latitude="{{lat}}" markers="{{markers}}" include-points="{{markers}}" polyline="{{polyline}}" bindmarkertap=“showDetail”>
this.setData({
polyline: [{
points: res.Data,
color: “#FF0000”,
width: 6,
}],
viewPosition: res.Data
});
includePoints: function () {
this.mapCtx = wx.createMapContext(‘map’);
this.mapCtx.includePoints({
padding: [30],
points: this.data.viewPosition
})
},