"use strict";(self["webpackChunkscui"]=self["webpackChunkscui"]||[]).push([[8457],{42756:function(e,t,n){n.r(t),n.d(t,{default:function(){return h}});var i=n(66252);const a={style:{"line-height":"1.5","font-size":"13px"}},l=(0,i._)("p",null,"演示了使用 @/utils/load 加载百度地图的JSAPI和它的GL库BMapGLLib",-1),o=(0,i._)("p",null,"当然也可以像传统网页一样加载任何JS和CSS，甚至可以是JQ。",-1),d=(0,i._)("br",null,null,-1),r=(0,i._)("div",{style:{width:"100%",height:"100%"},id:"container"},null,-1);function u(e,t,n,u,c,p){const s=(0,i.up)("el-alert"),w=(0,i.up)("el-card"),h=(0,i.up)("el-aside"),m=(0,i.up)("el-main"),f=(0,i.up)("el-container");return(0,i.wg)(),(0,i.j4)(f,null,{default:(0,i.w5)((()=>[(0,i.Wm)(h,{style:{padding:"15px",width:"400px"}},{default:(0,i.w5)((()=>[(0,i.Wm)(w,{shadow:"never",header:"异步加载JS"},{default:(0,i.w5)((()=>[(0,i._)("div",a,[l,o,d,(0,i.Wm)(s,{title:"这是一项试验工具, 具有不稳定性",type:"warning","show-icon":"",closable:!1})])])),_:1})])),_:1}),(0,i.Wm)(m,{class:"nopadding"},{default:(0,i.w5)((()=>[r])),_:1})])),_:1})}function c(e,t,n){return new Promise(((i,a)=>{let l=document.head.querySelector("script[loadKey="+t+"]");if(l)return i(window[t]);let o=document.createElement("script");o.type="text/javascript",o.src=e,o.setAttribute("loadKey",t),document.head.appendChild(o),o.onload=()=>{n?window[n]=()=>i(window[t]):setTimeout((()=>i(window[t])),50)},o.onerror=e=>a(e)}))}var p={name:"loadJS",data(){return{}},mounted(){this.init()},methods:{async init(){var e="vxSbZuydZ42ktZCvXvy5xCai28OEVqUq",t=await c(`//api.map.baidu.com/api?type=webgl&v=1.0&ak=${e}&callback=BMapGLinit`,"BMapGL","BMapGLinit"),n=new t.Map("container");n.centerAndZoom(new t.Point(116.297611,40.047363),20),n.enableScrollWheelZoom(),n.setTilt(55),n.setDisplayOptions({poiText:!1,poiIcon:!1})}}},s=n(83744);const w=(0,s.Z)(p,[["render",u]]);var h=w}}]);