uniapp+H5+移动端配置地图
第一步 注册高德开发者 获取key
然后我们选择web端
提交后我们会获取到key和安全密钥jscode
然后创建一个工具类
export default function MapLoader() {
window._AMapSecurityConfig = {
securityJsCode:'你的安全密钥',
}
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