
export default function loadMap() {
  return new Promise((resolve, reject) => {
    const script = document.createElement('script')
    script.src = `http://webapi.amap.com/maps?v=1.4.0&key=83281d81c793267a8e7079afccf194c0`
    script.async = true
    script.defer = true
    script.onload = () => {
      resolve(window.AMap)
    }
    script.onerror = (error) => {
      reject(error)
    }
    document.head.appendChild(script)
  })
}
