微信小程序--wx:openLocation的坑

来源:互联网 发布:wpf更新软件 编辑:程序博客网 时间:2024/05/16 04:26
微信小程序--wx:openLocation的坑
微信小程序api中没有详细介绍wx:openLocation的坑
错误写法:仅支持android,不支持iso
 gotothere:function(e){
        wx.openLocation({
          latitude: e.currentTarget.dataset.yaxis,
          longitude: e.currentTarget.dataset.xaxis,
          name: e.currentTarget.dataset.title,
          scale: 28
        })
  },
正确写法:
 gotothere:function(e){
        wx.openLocation({
          latitude: Number(e.currentTarget.dataset.yaxis),
          longitude: Number(e.currentTarget.dataset.xaxis),
          name: e.currentTarget.dataset.title,
          scale: 28
        })
  },
原创粉丝点击