Taro开发微信小程序之初始化地图到当前位置
时间:2019-03-11 17:53:05
收藏:0
阅读:1730
在componentDidMount中,初始化mapCtx。
this.mapCtx = Taro.createMapContext(‘container‘) //container是地图显示模块id //获取当前位置 this.mapCtx.getCenterLocation({ success(res) { console.log(res.longitude) console.log(res.latitude) } }) //移动到定位到的位置 this.mapCtx.moveToLocation()
原文:https://www.cnblogs.com/all1008/p/10511938.html
评论(0)