function MapLoader() {
	return new Promise((resolve, reject) => {
		if (window.AMap) {
			resolve(window.AMap)
		} else {
			var script = document.createElement('script')
			script.type = 'text/javascript'
			script.async = true
			script.src = 'https://webapi.amap.com/maps?v=1.4.15&key=09abadb2e35fc61fd84042c518e9aebf&plugin=AMap.Geocoder'
			script.onerror = reject
			document.head.appendChild(script)

			setTimeout(function() {
				resolve(window.AMap)
			}, 1000);

		}
		window.initAMap = () => {
			resolve(window.AMap)
		}
	})
}
export default MapLoader
