微信小程序openLocation:fail parameter error: parameter.latitude should be Number instead of Undefined

微信小程序官方文档中对于openLocation展示了一个示例:

直接复制后显示错误信息openLocation:fail parameter error: parameter.latitude should be Number instead of Undefined:

 开始以为我的数据格式不正确,后来发现示例中openLocation的参数传入写法错误,正确写法为:

    wx.openLocation({
      latitude:orderLatitude,
      longitude:orderLongitude,
      scale:18
    })

问题解决。

猜你喜欢

转载自blog.csdn.net/zjgo007/article/details/106540104