微信公众号地图模块

27次阅读

共计 398 个字符,预计需要花费 1 分钟才能阅读完成。

相关代码

 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 类型不会跳转到地图界面,虽然也不会报错,

    最终效果为:

正文完
 0