收藏
回答

求问腾讯地图问题?

Page({

  data: {

  },

  onLoad: function (options) {

    var that = this;

    wx.getLocation({

      type:"gcj02",

      success: function(res){

        wx.request({

          url: 'https://apis.map.qq.com/ws/geocoder/v1',

          data:{

            address:`广州市番禺永盛羽毛有限公司`,

            key:"VE3BZ-EYLWD-6634W-HCZX2-NIZZH-46FYV"

          },

          success: res1 => {

            wx.request({

              url: 'https://apis.map.qq.com/ws/geocoder/v1',

              data:{

                mode:"walking",

                from:`${res.latitude},${res.longitude}`,

                to:`${res1.data.result.location.lat},${res1.data.result.location.lng}`,

                key:"VE3BZ-EYLWD-6634W-HCZX2-NIZZH-46FYV"

              },

              success:res2 => {

                console.log(res2.data)

              }

            })

          }

        })

      }

    })

  },

})


回答关注问题邀请回答
收藏
登录 后发表内容
问题标签