You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
1.0 KiB

var l=(e,s,t)=>new Promise((o,n)=>{var r=a=>{try{i(t.next(a))}catch(c){n(c)}},p=a=>{try{i(t.throw(a))}catch(c){n(c)}},i=a=>a.done?o(a.value):Promise.resolve(a.value).then(r,p);i((t=t.apply(e,s)).next())});import{useScript as u}from"./useScript-a219c7df.js";import{d,r as f,P as m,J as h,u as w,aT as B,o as _,g as M,a9 as g}from"./index-f4658ae7.js";const y="https://api.map.baidu.com/getscript?v=3.0&ak=OaBvYmKX3pjF7YFUFeeBCeGdy9Zp7xB2&services=&t=20210201100830&s=1",v=d({name:"BaiduMap",props:{width:{type:String,default:"100%"},height:{type:String,default:"calc(100vh - 78px)"}},setup(){const e=f(null),{toPromise:s}=u({src:y});function t(){return l(this,null,function*(){yield s(),yield h();const o=w(e);if(!o)return;const n=window.BMap,r=new n.Map(o),p=new n.Point(116.404,39.915);r.centerAndZoom(p,15),r.enableScrollWheelZoom(!0)})}return m(()=>{t()}),{wrapRef:e}}});function S(e,s,t,o,n,r){return _(),M("div",{ref:"wrapRef",style:g({height:e.height,width:e.width})},null,4)}const $=B(v,[["render",S]]);export{$ as default};