@tuoyuan/map-adapter-lib
Version:
地图适配器库
2 lines (1 loc) • 907 B
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i(o){return new Promise(function(n,r){const t=document.createElement("script");t.type="text/javascript";let e=o;if(typeof e.content=="string")return t.text=e.content,document.head.appendChild(t),t.onerror=r,n();e=o,typeof e.url=="string"&&(t.src=e.url),typeof e.async=="boolean"&&(t.async=e.async),typeof e.integrity=="string"&&(t.integrity=e.integrity,t.setAttribute("crossorigin","anonymous")),t.onerror=r,document.head.appendChild(t),t.onload=()=>{n()},t.addEventListener("error",r),t.addEventListener("load",()=>{n()})})}function d(o){return new Promise(function(n,r){const t=document.createElement("link");t.rel="stylesheet",t.type="text/css",t.href=o.url,document.head.appendChild(t),t.onload=()=>{n()},t.addEventListener("error",r),t.addEventListener("load",()=>{n()})})}exports.loadCSS=d;exports.loadScript=i;