{"size": 961, "ext": "js", "max_stars_repo_path": "dist/amap.loader.js", "max_stars_repo_name": "altiscope/amap-release", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "dist/amap.loader.js", "max_issues_repo_name": "altiscope/amap-release", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "dist/amap.loader.js", "max_forks_repo_name": "altiscope/amap-release", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 480.5, "max_line_length": 960, "alphanum_fraction": 0.7200832466}
function AMapLoader(n={},o={}){const{preload:t=false,amapUrl:a,version:e}=o;let i=[];(async function(){const{appId:o,insecureHttp:r,apiHost:s}=n;const c=r?"http":"https";let p;try{const n=await fetch(`${c}://${s}/api/v1/configuration/`,{headers:{Authorization:`Token ${o}`,Origin:window.location.origin}});p=await n.json()}catch(n){console.error(n);throw new Error("Error fetching or parsing AMap configuration in AMapLoader")}const d={...n,configuration:p};const w=p.loader?p.loader.amapVersion:"";const l=e||w||"latest";const u=()=>window.AMap!==undefined;if(u()){if(t)return;new window.AMap(d)}else{if(window["__AMap_isLoading"]){i.push(d);return}window["__AMap_isLoading"]=true;const n=document.createElement("script");n.async=true;n.src=a||`https://cdn.jsdelivr.net/gh/altiscope/amap-release@${l}/dist/amap.min.js`;n.onload=function(){if(i.length>0){i.forEach(n=>new window.AMap(n));i=[]}if(t){return}new window.AMap(d)};document.head.appendChild(n)}})()}
