MapContext.moveToLocation
解释:将地图中心移动到当前定位点,需要配合 map 组件的 show-location 使用。
方法参数
无
示例
跳转编辑工具
扫码体验
代码示例
请使用百度APP扫码
图片示例
代码示例
- SWAN
- JS
<view class="wrap">
<map id="myMap"
longitude="{{longitude}}"
latitude="{{latitude}}"
style="width: 100%"
show-location
>
</map>
<button type="primary" bindtap="moveToLocation">移动到当前定位点</button>
</view>