格里高利 2019-03-30 22:27 采纳率: 33.3%
浏览 8760

微信小程序在onLoad函数中调用自定义函数出现undefined问题

data: {

},

getCenterLocation: function() {
this.mapCtx.getCenterLocation({
success: function(res) {
console.log(res.longitude)
console.log(res.latitude)
}
})
},
/**

  • 生命周期函数--监听页面加载 */ onLoad: function(options) { this.getCenterLocation(); },
  • 写回答

2条回答 默认 最新

  • threenewbee 2019-03-31 10:49
    关注

    仔细检查下完整的代码,getCenterLocation写的位置不正确

    评论

报告相同问题?

悬赏问题

  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办