map.wxml
经度;维度;缩放比例;样式;显示位置
<!--pages/map/map.wxml-->
<!--地图组件-->
<!--经度;维度;缩放比例;样式;显示位置-->
<map id="map"
longitude="116.300901"
latitude="39.916085"
scale="14"
style="width: 100%; height: 600rpx;"
show-location="true"
controls="{{controls}}"
polyline="{{polyline}}"
>
</map>
map.ts
data: {
//折线线段
polyline:[{ //折线
points:[ //坐标点
{longitude:116.300901,latitude:39.916085},
{longitude:116.316685,latitude:39.913702}
],
color:"#fc0",
width:3
}
],
//地图上显示控件:图片
controls:[{
id:0, //控件id数值
iconPath:"/images/blue.png",
position:{ //控件坐标
left:110, //左侧位置
top:200, //顶端位置
width:15, //宽度和高度
height:15
}
}]
},