wxMap.js 575 B

1234567891011121314151617181920212223
  1. import QQMapWX from './qqmap-wx-jssdk.js'
  2. // 腾讯地图经纬度转中文地址
  3. export function getAddress (lng, lat) {
  4. return new Promise((resove, reject) => {
  5. const qqmapsdk = new QQMapWX({
  6. key: 'ZEHBZ-5C4WQ-C3K5N-BTP4J-TRMJO-63BVC',
  7. })
  8. qqmapsdk.reverseGeocoder({
  9. location: {
  10. longitude: lng,
  11. latitude: lat,
  12. },
  13. success: (res) => {
  14. resove(res)
  15. },
  16. fail: (e) => {
  17. reject(e)
  18. },
  19. })
  20. })
  21. }