wxml:
<
map
id=
"maps"
style=
"width: 100%; height: 300px;margin-bottom:30px;"
latitude=
"{{latitude}}"
longitude=
"{{longitude}}"
markers=
"{{markers}}"
covers=
"{{covers}}"
show-location
>
</
map
>
<
button
size=
'mini'
type=
'primary'
open-type=
''
bindtap=
'getLocation'>获取位置
</
button
>
js:
getLocation(){
//获取当前位置
this.maps = wx.createMapContext(
'maps')
this.maps.moveToLocation()
}