基本使用
地图组件使用起来也很简单。
.wxml
参数列表及说明如下:
除了显示基本地图,还可以在地图上添加markers–标注,polyline–折线,circles–圆形,controls–控件。
markers
data: {
//
markers: [{
iconPath: "../../img/marker_red.png",
id: 0,
latitude: 40.002607,
longitude: 116.487847,callout:{
content:'气泡名称',
color: '#FF0000',
fontSize: 15,
borderRadius: 10,
display: 'ALWAYS',
}
width:35,
height:45
}],
... //省略代码
}
#########################################################################
在data中定义markers变量来表示覆盖物
然后map控件引入即可:
效果如下:
polyline
data: {
//
polyline: [{
points: [{
longitude: '116.481451',
latitude: '40.006822'
}, {
longitude: '116.487847',
latitude: '40.002607'
}, {
longitude: '116.496507',
latitude: '40.006103'
}],
color: "#FF0000DD",
width: 3,
dottedLine: true
}],
... //省略代码
}
1
circles
data: { <