getCenterLocation从mapContext 方法列表中拿掉了吗?
[代码]在运行以下code的时候,发现无法console.log(res.longtitude)及console.log(res.latitude).[代码] [代码]<map id="myMap" show-location />[代码] [代码]<button type="primary" bindtap="getCenterLocation">获取位置button>[代码] [代码]<button type="primary" bindtap="moveToLocation">移动位置button>[代码] [代码]// map.jsPage({
onReady: function (e) { // 使用 wx.createMapContext 获取 map 上下文
this.mapCtx = wx.createMapContext('myMap')
},[代码][代码] getCenterLocation: function () {[代码] [代码] this.mapCtx.getCenterLocation({[代码] [代码] success: function(res){[代码] [代码] console.log(res.longitude)[代码] [代码] console.log(res.latitude)[代码] [代码] }
})
},[代码][代码] moveToLocation: function () {[代码] [代码] this.mapCtx.moveToLocation()[代码] [代码] }[代码] [代码])[代码] [代码] [代码] 在调试模式的scope中查看mapCtx中根本就没有getCenterLocation函数: [代码][图片] [代码] [代码] [代码] [代码]请问有谁遇到类似问题吗,感谢![代码]