gzhbk

 

  1. 申请开发者密钥(key):申请密钥

  2. 开通webserviceAPI服务:控制台 -> key管理 -> 设置(使用该功能的key)-> 勾选webserviceAPI -> 保存

    (小程序SDK需要用到webserviceAPI的部分服务,所以使用该功能的KEY需要具备相应的权限)

  3. 下载微信小程序JavaScriptSDK,微信小程序JavaScriptSDK v1.2

  4. 安全域名设置,在“设置” -> “开发设置”中设置request合法域名,添加https://apis.map.qq.com

  5. 小程序示例


const QQMapWX = require(\'../../libs/qqmap-wx-jssdk.min.js\'); const wxMap = new QQMapWX({ key: \'****-GP***-RB***-B**US-****-RZ**Y\' // 必填 }); onShow () { /**经纬度逆解析 */ this.reverseGeocoder() }, /**经纬度逆解析 */ reverseGeocoder() { const that = this; wx.getLocation({ type: \'gcj02\', success: function (res) { var latitude = res.latitude var longitude = res.longitude wxMap.reverseGeocoder({ location: { latitude: latitude, longitude: longitude }, success: function (res) { const { city } = res.result.address_component console.log(city); that.setData({ city, }) }, }); }, fail(res) { console.log(res) } }) },

  

2. 使用方法
文档地址http://lbs.qq.com/qqmap_wx_jssdk/index.html
使用方法

微信小程序-经纬度逆解析详细地址

https://blog.csdn.net/weixin_38023551/article/details/80736563

 

https://blog.csdn.net/zzwwjjdj1/article/details/79412634

 

https://lbs.qq.com/service/webService/webServiceGuide/webServiceOverview

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-07-21
  • 2021-12-10
  • 2021-05-11
  • 2022-12-23
  • 2022-12-23
  • 2021-09-17
猜你喜欢
  • 2022-12-23
  • 2021-11-10
  • 2022-12-23
  • 2021-12-04
  • 2022-01-19
  • 2022-12-23
  • 2021-04-20
相关资源
相似解决方案