微信公众号地图模块

相关代码

 wx.openLocation({
        latitude: !!that.addressPoint.latitude
          ? Number(that.addressPoint.latitude)
          : 34.194024,
        longitude: !!that.addressPoint.longitude
          ? Number(that.addressPoint.longitude)
          : 108.937925,
        name: !!that.addressPoint.name
          ? that.addressPoint.name
          : "声动语商学苑",
        address: !!that.addressPoint.address
          ? that.addressPoint.address
          : "西安市"
      });
  **
  • 注意:wx的openLocation方法绑定的经纬度坐标值必须为number类型,string类型不会跳转到地图界面,虽然也不会报错,

    最终效果为:

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理