import{a as Z,f as $,$ as V,R as X,n as Y,O as K,d as J,z as U,c as Q,b as q,e as tt,h as et,_ as it}from"./index-e450010e.js";var nt={"bm-map":["click","dblclick","rightclick","rightdblclick","maptypechange","mousemove","mouseover","mouseout","movestart","moving","moveend","zoomstart","zoomend","addoverlay","addcontrol","removecontrol","removeoverlay","clearoverlays","dragstart","dragging","dragend","addtilelayer","removetilelayer","load","resize","hotspotclick","hotspotover","hotspotout","tilesloaded","touchstart","touchmove","touchend","longpress"],"bm-geolocation":["locationSuccess","locationError"],"bm-overview-map":["viewchanged","viewchanging"],"bm-marker":["click","dblclick","mousedown","mouseup","mouseout","mouseover","remove","infowindowclose","infowindowopen","dragstart","dragging","dragend","rightclick"],"bm-polyline":["click","dblclick","mousedown","mouseup","mouseout","mouseover","remove","lineupdate"],"bm-polygon":["click","dblclick","mousedown","mouseup","mouseout","mouseover","remove","lineupdate"],"bm-circle":["click","dblclick","mousedown","mouseup","mouseout","mouseover","remove","lineupdate"],"bm-label":["click","dblclick","mousedown","mouseup","mouseout","mouseover","remove","rightclick"],"bm-info-window":["close","open","maximize","restore","clickclose"],"bm-ground":["click","dblclick"],"bm-autocomplete":["onconfirm","onhighlight"],"bm-point-collection":["click","mouseover","mouseout"]};function ot(s,g){const h=g||nt[this.$options.name];h&&h.forEach(x=>{let _=x.slice(0,2)==="on"?x.slice(2):x;const e=this.$attrs["on"+_.replace(_[0],_[0].toUpperCase())];e&&s.addEventListener(x,e)})}const j=s=>Object.prototype.toString.call(s).slice(8,-1);let D={v:"3.0",type:"API"};const rt=(s={})=>{D=Object.assign(D,s),D.ak||console.error("请配置ak:百度地图开发者平台申请的密钥")},A=()=>D;var I=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},R={exports:{}};function N(){}N.prototype={on:function(s,g,h){var x=this.e||(this.e={});return(x[s]||(x[s]=[])).push({fn:g,ctx:h}),this},once:function(s,g,h){var x=this;function w(){x.off(s,w),g.apply(h,arguments)}return w._=g,this.on(s,w,h)},emit:function(s){var g=[].slice.call(arguments,1),h=((this.e||(this.e={}))[s]||[]).slice(),x=0,w=h.length;for(x;xz.on(...s),$once:(...s)=>z.once(...s),$off:(...s)=>z.off(...s),$emit:(...s)=>z.emit(...s)};const G={API:{"2.0":{setMapStyle:"setMapStyle",NavigationControl:"NavigationControl"},"3.0":{setMapStyle:"setMapStyleV2",NavigationControl:"NavigationControl"}},WebGL:{setMapStyle:"setMapStyleV2",NavigationControl:"NavigationControl3D"}},L=s=>{const g=A();return g.type=="WebGL"?G[g.type][s]:G[g.type][g.v][s]};let H;new Promise(s=>{H=s});var st=(s,g)=>{const h=s.__vccOpts||s;for(const[x,w]of g)h[x]=w;return h};const lt={name:"bm-map",inheritAttrs:!1,emits:["ready","init","animationed"],props:{ak:{type:String},v:{type:String},type:{type:String},center:{type:[Object,String]},zoom:{type:Number},minZoom:{type:Number},maxZoom:{type:Number},highResolution:{type:Boolean,default:!0},mapClick:{type:Boolean,default:!0},mapType:{type:String},dragging:{type:Boolean,default:!0},scrollWheelZoom:{type:Boolean,default:!1},doubleClickZoom:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},inertialDragging:{type:Boolean,default:!0},continuousZoom:{type:Boolean,default:!0},pinchToZoom:{type:Boolean,default:!0},autoResize:{type:Boolean,default:!0},theme:{type:Array},mapStyle:{type:Object},hasAnimation:{type:Boolean,default:!0},defaultAnimation:{type:Boolean,default:!0},preserveDrawingBuffer:{type:Boolean,default:!1}},watch:{center(s,g){const{map:h,zoom:x}=this;j(s)==="String"&&s!==g&&this.setCenterZoom(h,s,x)},"center.lng"(s,g){const{BMap:h,map:x,zoom:w,center:_}=this;s!==g&&s>=-180&&s<=180&&this.setCenterZoom(x,new h.Point(s,_.lat),w)},"center.lat"(s,g){const{BMap:h,map:x,zoom:w,center:_}=this;s!==g&&s>=-74&&s<=74&&this.setCenterZoom(x,new h.Point(_.lng,s),w)},zoom(s,g){const{map:h}=this;s!==g&&s>=3&&s<=19&&h.setZoom(s)},minZoom(s){const{map:g}=this;g.setMinZoom(s)},maxZoom(s){const{map:g}=this;g.setMaxZoom(s)},highResolution(){this.reset()},mapClick(){this.reset()},mapType(s){const{map:g}=this;g.setMapType(window[s])},dragging(s){const{map:g}=this;s?g.enableDragging():g.disableDragging()},scrollWheelZoom(s){const{map:g}=this;s?g.enableScrollWheelZoom():g.disableScrollWheelZoom()},doubleClickZoom(s){const{map:g}=this;s?g.enableDoubleClickZoom():g.disableDoubleClickZoom()},keyboard(s){const{map:g}=this;s?g.enableKeyboard():g.disableKeyboard()},inertialDragging(s){const{map:g}=this;s?g.enableInertialDragging():g.disableInertialDragging()},continuousZoom(s){const{map:g}=this;s?g.enableContinuousZoom():g.disableContinuousZoom()},pinchToZoom(s){const{map:g}=this;s?g.enablePinchToZoom():g.disablePinchToZoom()},autoResize(s){const{map:g}=this;s?g.enableAutoResize():g.disableAutoResize()},theme(s){const{map:g}=this;g[L("setMapStyle")]({styleJson:s})},mapStyle:{handler(s){const{map:g,theme:h}=this;!h&&g[L("setMapStyle")](s)},deep:!0}},methods:{setMapOptions(){const{map:s,minZoom:g,maxZoom:h,mapType:x,dragging:w,scrollWheelZoom:_,doubleClickZoom:e,keyboard:r,inertialDragging:t,continuousZoom:i,pinchToZoom:u,autoResize:p}=this;g&&s.setMinZoom(g),h&&s.setMaxZoom(h),x&&s.setMapType(window[x]),w?s.enableDragging():s.disableDragging(),_?s.enableScrollWheelZoom():s.disableScrollWheelZoom(),e?s.enableDoubleClickZoom():s.disableDoubleClickZoom(),r?s.enableKeyboard():s.disableKeyboard(),t?s.enableInertialDragging():s.disableInertialDragging(),i?s.enableContinuousZoom():s.disableContinuousZoom(),u?s.enablePinchToZoom():s.disablePinchToZoom(),p?s.enableAutoResize():s.disableAutoResize()},init(s){if(this.map)return;let g=this.$refs.view;const h=new s.Map(g,{enableHighResolution:this.highResolution,enableMapClick:this.mapClick,preserveDrawingBuffer:this.preserveDrawingBuffer}),x=Math.random().toString();this.mapKey=x,this.map=h;const{setMapOptions:w,zoom:_,getCenterPoint:e,theme:r,mapStyle:t}=this;w(),ot.call(this,h),h.reset(),this.setCenterZoom(h,e(),_),r?h[L("setMapStyle")]({styleJson:r}):t&&h[L("setMapStyle")](t);let i=0;this.$emit("init",{BMap:s,map:h,mapKey:x}),F.$emit("init",{BMap:s,map:h,mapKey:x}),h.addEventListener("tilesloaded",()=>{i||(i++,this.$emit("ready",{BMap:s,map:h,mapKey:x}),F.$emit("ready",{BMap:s,map:h,mapKey:x}))}),h.addEventListener("loaded",()=>{this.$emit("loaded",{BMap:s,map:h,mapKey:x}),F.$emit("loaded",{BMap:s,map:h,mapKey:x})})},setCenterZoom(s,g,h){A().type==="WebGL"&&(!this.hasAnimation||!this.defaultAnimation)?s.setCenter(g,{noAnimation:!this.hasAnimation,callback:()=>{s.setZoom(h,{noAnimation:!this.hasAnimation,zoomCenter:g,callback:()=>{this.$emit("animationed",{BMap:this.BMap,map:s})}})}}):s.centerAndZoom(g,h)},getCenterPoint(){const{center:s,BMap:g}=this;switch(j(s)){case"String":return s;case"Object":return new g.Point(s.lng,s.lat);default:return new g.Point}},initMap(s){this.BMap=s,this.init(s),H(s)},getMapScript(){return window.BMap?window.BMap._preloader?window.BMap._preloader:Promise.resolve(window.BMap):(window.BMap={},window.BMap._preloader=new Promise((s,g)=>{window._initBaiduMap=function(){window.BMap=A().type=="WebGL"?window.BMapGL:window.BMap,s(window.BMap),window.document.body.removeChild(h),window.BMap._preloader=null,window._initBaiduMap=null};const h=document.createElement("script");switch(window.document.body.appendChild(h),A().type){case"WebGL":h.src=`https://api.map.baidu.com/api?v=1.0&type=webgl&ak=${A().ak}&callback=_initBaiduMap`;break;default:h.src=`https://api.map.baidu.com/api?v=${A().v}&ak=${A().ak}&callback=_initBaiduMap`}}),window.BMap._preloader)},reset(){const{getMapScript:s,initMap:g}=this;s().then(g)}},created(){const s={};this.ak&&(s.ak=this.ak),this.v&&(s.v=this.v),this.type&&(s.type=this.type),rt(s)},mounted(){this.reset()},data(){return{hasBmView:!1,map:null,BMap:null,name:"bm-map",mapKey:""}}},ht={key:0,ref:"view",style:{width:"100%",height:"100%"}};function ut(s,g,h,x,w,_){return Z(),$("div",{class:Y(s.$attrs.class),style:K(s.$attrs.style)},[w.hasBmView?V("",!0):(Z(),$("div",ht,null,512)),X(s.$slots,"default")],6)}var pt=st(lt,[["render",ut]]),dt={exports:{}};(function(s,g){(function(h,x){s.exports=x()})(I,function(){var h=typeof window<"u"?window:typeof I<"u"?I:this;function x(n,l){return l={exports:{}},n(l,l.exports,h),l.exports}var w=x(function(n,l,f){(function(v,a){typeof l=="object"?n.exports=a():(v.BMapLib=v.BMapLib||{},v.BMapLib.TextIconOverlay=v.BMapLib.TextIconOverlay||a())})(h,function(){var v,a=v=a||{version:"1.3.8"},M={};a.guid="$BAIDU$",M[a.guid]=M[a.guid]||{},a.dom=a.dom||{},a.dom.g=function(o){return typeof o=="string"||o instanceof String?document.getElementById(o):o&&o.nodeName&&(o.nodeType==1||o.nodeType==9)?o:null},a.g=a.G=a.dom.g,a.dom.getDocument=function(o){return o=a.dom.g(o),o.nodeType==9?o:o.ownerDocument||o.document},a.lang=a.lang||{},a.lang.isString=function(o){return Object.prototype.toString.call(o)=="[object String]"},a.isString=a.lang.isString,a.dom._g=function(o){return a.lang.isString(o)?document.getElementById(o):o},a._g=a.dom._g,a.browser=a.browser||{},/msie (\d+\.\d)/i.test(navigator.userAgent)&&(a.browser.ie=a.ie=document.documentMode||+RegExp.$1),a.dom.getComputedStyle=function(o,c){o=a.dom._g(o);var m=a.dom.getDocument(o),y;return m.defaultView&&m.defaultView.getComputedStyle&&(y=m.defaultView.getComputedStyle(o,null),y)?y[c]||y.getPropertyValue(c):""},a.dom._styleFixer=a.dom._styleFixer||{},a.dom._styleFilter=a.dom._styleFilter||[],a.dom._styleFilter.filter=function(o,c,m){for(var y=0,b=a.dom._styleFilter,T;T=b[y];y++)(T=T[m])&&(c=T(o,c));return c},a.string=a.string||{},a.string.toCamelCase=function(o){return o.indexOf("-")<0&&o.indexOf("_")<0?o:o.replace(/[-_][^-_]/g,function(c){return c.charAt(1).toUpperCase()})},a.dom.getStyle=function(o,c){var m=a.dom;o=m.g(o),c=a.string.toCamelCase(c);var y=o.style[c]||(o.currentStyle?o.currentStyle[c]:"")||m.getComputedStyle(o,c);if(!y){var b=m._styleFixer[c];b&&(y=b.get?b.get(o):a.dom.getStyle(o,b))}return(b=m._styleFilter)&&(y=b.filter(c,y,"get")),y},a.getStyle=a.dom.getStyle,/opera\/(\d+\.\d)/i.test(navigator.userAgent)&&(a.browser.opera=+RegExp.$1),a.browser.isWebkit=/webkit/i.test(navigator.userAgent),a.browser.isGecko=/gecko/i.test(navigator.userAgent)&&!/like gecko/i.test(navigator.userAgent),a.browser.isStrict=document.compatMode=="CSS1Compat",a.dom.getPosition=function(o){o=a.dom.g(o);var c=a.dom.getDocument(o),m=a.browser,y=a.dom.getStyle;m.isGecko>0&&c.getBoxObjectFor&&y(o,"position")=="absolute"&&(o.style.top===""||o.style.left);var b={left:0,top:0},T=m.ie&&!m.isStrict?c.body:c.documentElement,C,k;if(o==T)return b;if(o.getBoundingClientRect){k=o.getBoundingClientRect(),b.left=Math.floor(k.left)+Math.max(c.documentElement.scrollLeft,c.body.scrollLeft),b.top=Math.floor(k.top)+Math.max(c.documentElement.scrollTop,c.body.scrollTop),b.left-=c.documentElement.clientLeft,b.top-=c.documentElement.clientTop;var P=c.body,O=parseInt(y(P,"borderLeftWidth")),W=parseInt(y(P,"borderTopWidth"));m.ie&&!m.isStrict&&(b.left-=isNaN(O)?2:O,b.top-=isNaN(W)?2:W)}else{C=o;do{if(b.left+=C.offsetLeft,b.top+=C.offsetTop,m.isWebkit>0&&y(C,"position")=="fixed"){b.left+=c.body.scrollLeft,b.top+=c.body.scrollTop;break}C=C.offsetParent}while(C&&C!=o);for((m.opera>0||m.isWebkit>0&&y(o,"position")=="absolute")&&(b.top-=c.body.offsetTop),C=o.offsetParent;C&&C!=c.body;)b.left-=C.scrollLeft,(!m.opera||C.tagName!="TR")&&(b.top-=C.scrollTop),C=C.offsetParent}return b},a.event=a.event||{},a.event._listeners=a.event._listeners||[],a.event.on=function(o,c,m){c=c.replace(/^on/i,""),o=a.dom._g(o);var y=function(P){m.call(o,P)},b=a.event._listeners,T=a.event._eventFilter,C,k=c;return c=c.toLowerCase(),T&&T[c]&&(C=T[c](o,c,y),k=C.type,y=C.listener),o.addEventListener?o.addEventListener(k,y,!1):o.attachEvent&&o.attachEvent("on"+k,y),b[b.length]=[o,c,m,y,k],o},a.on=a.event.on,function(){var o=M[a.guid];a.lang.guid=function(){return"TANGRAM__"+(o._counter++).toString(36)},o._counter=o._counter||1}(),M[a.guid]._instances=M[a.guid]._instances||{},a.lang.isFunction=function(o){return Object.prototype.toString.call(o)=="[object Function]"},a.lang.Class=function(o){this.guid=o||a.lang.guid(),M[a.guid]._instances[this.guid]=this},M[a.guid]._instances=M[a.guid]._instances||{},a.lang.Class.prototype.dispose=function(){delete M[a.guid]._instances[this.guid];for(var o in this)a.lang.isFunction(this[o])||delete this[o];this.disposed=!0},a.lang.Class.prototype.toString=function(){return"[object "+(this._className||"Object")+"]"},a.lang.Event=function(o,c){this.type=o,this.returnValue=!0,this.target=c||null,this.currentTarget=null},a.lang.Class.prototype.addEventListener=function(o,c,m){if(a.lang.isFunction(c)){!this.__listeners&&(this.__listeners={});var y=this.__listeners,b;if(typeof m=="string"&&m){if(/[^\w\-]/.test(m))throw"nonstandard key:"+m;c.hashCode=m,b=m}o.indexOf("on")!=0&&(o="on"+o),typeof y[o]!="object"&&(y[o]={}),b=b||a.lang.guid(),c.hashCode=b,y[o][b]=c}},a.lang.Class.prototype.removeEventListener=function(o,c){if(!(typeof c<"u"&&(a.lang.isFunction(c)&&!(c=c.hashCode)||!a.lang.isString(c)))){!this.__listeners&&(this.__listeners={}),o.indexOf("on")!=0&&(o="on"+o);var m=this.__listeners;if(m[o])if(typeof c<"u")m[o][c]&&delete m[o][c];else for(var y in m[o])delete m[o][y]}},a.lang.Class.prototype.dispatchEvent=function(o,c){a.lang.isString(o)&&(o=new a.lang.Event(o)),!this.__listeners&&(this.__listeners={}),c=c||{};for(var m in c)o[m]=c[m];var m,y=this.__listeners,b=o.type;if(o.target=o.target||this,o.currentTarget=this,b.indexOf("on")!=0&&(b="on"+b),a.lang.isFunction(this[b])&&this[b].apply(this,arguments),typeof y[b]=="object")for(m in y[b])y[b][m].apply(this,arguments);return o.returnValue},a.lang.inherits=function(o,c,m){var y,b,T=o.prototype,C=new Function;C.prototype=c.prototype,b=o.prototype=new C;for(y in T)b[y]=T[y];o.prototype.constructor=o,o.superClass=c.prototype,typeof m=="string"&&(b._className=m)},a.inherits=a.lang.inherits;var B="http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m",E="png",S=function(o,c,m){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}v.lang.inherits(S,BMap.Overlay,"TextIconOverlay"),this._position=o,this._text=c,this._options=m||{},this._styles=this._options.styles||[],!this._styles.length&&this._setupDefaultStyles()};return S.prototype._setupDefaultStyles=function(){for(var o=[53,56,66,78,90],c=0,m;m=o[c];c++)this._styles.push({url:B+c+"."+E,size:new BMap.Size(m,m)})},S.prototype.initialize=function(o){return this._map=o,this._domElement=document.createElement("div"),this._updateCss(),this._updateText(),this._updatePosition(),this._bind(),this._map.getPanes().markerMouseTarget.appendChild(this._domElement),this._domElement},S.prototype.draw=function(){this._map&&this._updatePosition()},S.prototype.getText=function(){return this._text},S.prototype.setText=function(o){o&&(!this._text||this._text.toString()!=o.toString())&&(this._text=o,this._updateText(),this._updateCss(),this._updatePosition())},S.prototype.getPosition=function(){return this._position},S.prototype.setPosition=function(o){o&&(!this._position||!this._position.equals(o))&&(this._position=o,this._updatePosition())},S.prototype.getStyleByText=function(o,c){var m=parseInt(o),y=parseInt(m/10);return y=Math.max(0,y),y=Math.min(y,c.length-1),c[y]},S.prototype._updateCss=function(){if(this._domElement){var o=this.getStyleByText(this._text,this._styles);this._domElement.style.cssText=this._buildCssText(o)}},S.prototype._updateText=function(){this._domElement&&(this._domElement.innerHTML=this._text)},S.prototype._updatePosition=function(){if(this._domElement&&this._position){var o=this._domElement.style,c=this._map.pointToOverlayPixel(this._position);c.x-=Math.ceil(parseInt(o.width)/2),c.y-=Math.ceil(parseInt(o.height)/2),o.left=c.x+"px",o.top=c.y+"px"}},S.prototype._buildCssText=function(o){var c=o.url,m=o.size,y=o.anchor,b=o.offset,T=o.textColor||"black",C=o.textSize||10,k=[];if(v.browser.ie<7)k.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="'+c+'");');else{k.push("background-image:url("+c+");");var P="0 0";b instanceof BMap.Size&&(P=b.width+"px "+b.height+"px"),k.push("background-position:"+P+";")}return m instanceof BMap.Size&&(y instanceof BMap.Size?(y.height>0&&y.height0&&y.widththis._markerClusterer.getMaxZoom()){this._clusterMarker&&this._map.removeOverlay(this._clusterMarker);for(var n=0,l;l=this._markers[n];n++)this._map.addOverlay(l);return}if(this._markers.length=f){if(clearInterval(i._intervalFlag),i.i>i._path.length)return;i._moveNext(++i.i),i._opts.onmove(i)}else{u++;var v=t(n.x,l.x,u,f),a=t(n.y,l.y,u,f),M=i._projection.pointToLngLat(new BMap.Pixel(v,a));if(u==1){var B=null;i.i-1>=0&&(B=i._path[i.i-1]),i._opts.enableRotation==!0&&i.setRotation(B,e,r),i._opts.autoView&&(i._map.getBounds().containsPoint(M)||i._map.setCenter(M))}i._marker.setPosition(M),i._setInfoWin(M)}},p)},setRotation:function(e,r,t){var i=this,u=0;if(r=i._map.pointToPixel(r),t=i._map.pointToPixel(t),t.x!=r.x){var p=(t.y-r.y)/(t.x-r.x),d=Math.atan(p);u=d*360/(2*Math.PI),t.x0?l=-1:l=1,i._marker.setRotation(-l*90)}},linePixellength:function(e,r){return Math.sqrt(Math.abs(e.x-r.x)*Math.abs(e.x-r.x)+Math.abs(e.y-r.y)*Math.abs(e.y-r.y))},pointToPoint:function(e,r){return Math.abs(e.x-r.x)*Math.abs(e.x-r.x)+Math.abs(e.y-r.y)*Math.abs(e.y-r.y)},_moveNext:function(e){var r=this;e-1?v+="top:"+d+"px;":v+="bottom:"+d+"px;",p.indexOf("l")>-1?v+="left:"+d+"px;":v+="right:"+d+"px;",l=document.createElement("div"),l.style.cssText="border-radius:5px;position:absolute;"+v+"font-family:Helvetica; width:256px;z-index:10000000000; background:rgba(255,255,255,1);padding:10px;border:1px solid black;margin:0;",l.innerHTML="

"+u+"

",n.style.cssText="position:relative;font-size:12px;display:block;list-style:none;list-style-type:none;margin:0;height:15px;",f=document.createElement("div"),f.style.cssText=["position:relative;display:block;width:256px;height:15px;border-bottom:1px solid black; background-image:url(",t.createGradientImage(),");"].join(""),l.appendChild(n),l.appendChild(f),t.set("element",l),t.set("labelsEl",n),t.update(1)},processGradientObject:function(){var t=this,i=this.config.gradient,u=[];for(var p in i)i.hasOwnProperty(p)&&u.push({stop:p,value:i[p]});u.sort(function(d,n){return d.stop-n.stop}),u.unshift({stop:0,value:"rgba(0,0,0,0)"}),t.set("gradientArr",u)},createGradientImage:function(){var t=this,i=t.get("gradientArr"),u=i.length,p=document.createElement("canvas"),d=p.getContext("2d"),n;p.width="256",p.height="15",n=d.createLinearGradient(0,5,256,10);for(var l=0;l>0)+.5,0),d.lineTo((1/(u-1)*l*256>>0)+.5,l==0?15:5);return d.moveTo(255.5,0),d.lineTo(255.5,15),d.moveTo(255.5,4.5),d.lineTo(0,4.5),d.stroke(),t.set("ctx",d),p.toDataURL()},getElement:function(){return this.get("element")},update:function(t){for(var i=this,u=i.get("gradientArr"),p=i.get("ctx"),d=i.get("labelsEl"),n,l="",f,v=0;v>0,f=p.measureText(n).width/2>>0,v==0&&(f=0),v==u.length-1&&(f*=2),l+='
  • '+n+"
  • ";d.innerHTML=l}};var r=function(i){var u={radius:40,element:{},canvas:{},acanvas:{},ctx:{},actx:{},legend:null,visible:!0,width:0,height:0,max:!1,gradient:!1,opacity:180,premultiplyAlpha:!1,bounds:{l:1e3,r:0,t:1e3,b:0},debug:!1};this.store=new _(this),this.get=function(p){return u[p]},this.set=function(p,d){u[p]=d},this.configure(i),this.init()};return r.prototype={configure:function(t){var i=this;if(i.set("radius",t.radius||40),i.set("element",t.element instanceof Object?t.element:document.getElementById(t.element)),i.set("visible",t.visible!=null?t.visible:!0),i.set("max",t.max||!1),i.set("gradient",t.gradient||{.45:"rgb(0,0,255)",.55:"rgb(0,255,255)",.65:"rgb(0,255,0)",.95:"yellow",1:"rgb(255,0,0)"}),i.set("opacity",parseInt(255/(100/t.opacity),10)||180),i.set("width",t.width||0),i.set("height",t.height||0),i.set("debug",t.debug),t.legend){var u=t.legend;u.gradient=i.get("gradient"),i.set("legend",new e(u))}},resize:function(){var t=this,i=t.get("element"),u=t.get("canvas"),p=t.get("acanvas");u.width=p.width=t.get("width")||i.style.width.replace(/px/,"")||t.getWidth(i),this.set("width",u.width),u.height=p.height=t.get("height")||i.style.height.replace(/px/,"")||t.getHeight(i),this.set("height",u.height)},init:function(){var t=this,i=document.createElement("canvas"),u=document.createElement("canvas"),p=i.getContext("2d"),d=u.getContext("2d"),n=t.get("element");t.initColorPalette(),t.set("canvas",i),t.set("ctx",p),t.set("acanvas",u),t.set("actx",d),t.resize(),i.style.cssText=u.style.cssText="position:absolute;top:0;left:0;z-index:10000000;",t.get("visible")||(i.style.display="none"),n.appendChild(i),t.get("legend")&&n.appendChild(t.get("legend").getElement()),t.get("debug")&&document.body.appendChild(u),d.shadowOffsetX=15e3,d.shadowOffsetY=15e3,d.shadowBlur=15},initColorPalette:function(){var t=this,i=document.createElement("canvas"),u=t.get("gradient"),p,d,n;i.width="1",i.height="256",p=i.getContext("2d"),d=p.createLinearGradient(0,0,1,256),n=p.getImageData(0,0,1,1),n.data[0]=n.data[3]=64,n.data[1]=n.data[2]=0,p.putImageData(n,0,0),n=p.getImageData(0,0,1,1),t.set("premultiplyAlpha",n.data[0]<60||n.data[0]>70);for(var l in u)d.addColorStop(l,u[l]);p.fillStyle=d,p.fillRect(0,0,1,256),t.set("gradient",p.getImageData(0,0,1,256).data)},getWidth:function(t){var i=t.offsetWidth;return t.style.paddingLeft&&(i+=t.style.paddingLeft),t.style.paddingRight&&(i+=t.style.paddingRight),i},getHeight:function(t){var i=t.offsetHeight;return t.style.paddingTop&&(i+=t.style.paddingTop),t.style.paddingBottom&&(i+=t.style.paddingBottom),i},colorize:function(t,i){var u=this,p=u.get("width"),d=u.get("radius"),n=u.get("height"),l=u.get("actx"),f=u.get("ctx"),v=d*3,a=u.get("premultiplyAlpha"),M=u.get("gradient"),B=u.get("opacity"),E=u.get("bounds"),S,o,c,m,y,b,T,C,k;t!=null&&i!=null?(t+v>p&&(t=p-v),t<0&&(t=0),i<0&&(i=0),i+v>n&&(i=n-v),S=t,o=i,m=t+v,c=i+v):(E.l<0?S=0:S=E.l,E.r>p?m=p:m=E.r,E.t<0?o=0:o=E.t,E.b>n?c=n:c=E.b),y=l.getImageData(S,o,m-S,c-o),b=y.data.length;for(var P=3;P>0,a=i-1.5*n>>0,M=t+1.5*n>>0,B=i+1.5*n>>0;l.shadowColor="rgba(0,0,0,"+(u?u/d.store.max:"0.1")+")",l.shadowOffsetX=15e3,l.shadowOffsetY=15e3,l.shadowBlur=15,l.beginPath(),l.arc(t-15e3,i-15e3,n,0,Math.PI*2,!0),l.closePath(),l.fill(),p?d.colorize(v,a):(vf.r&&(f.r=M),B>f.b&&(f.b=B))},toggleDisplay:function(){var t=this,i=t.get("visible"),u=t.get("canvas");i?u.style.display="none":u.style.display="block",t.set("visible",!i)},getImageData:function(){return this.get("canvas").toDataURL()},clear:function(){var t=this,i=t.get("width"),u=t.get("height");t.store.set("data",[]),t.get("ctx").clearRect(0,0,i,u),t.get("actx").clearRect(0,0,i,u)},cleanup:function(){var t=this;t.get("element").removeChild(t.get("canvas"))}},{create:function(t){return new r(t)},util:{mousePosition:function(t){var i,u;if(t.layerX?(i=t.layerX,u=t.layerY):t.offsetX&&(i=t.offsetX,u=t.offsetY),!(typeof i>"u"))return[i,u]}}}}(),w=function(_){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}if(!w._isExtended){w._isExtended=!0,h(w,BMap.Overlay,"HeatmapOverlay");var e=new w(_);this.__proto__=e.__proto__}this.conf=_,this.heatmap=null,this.latlngs=[],this.bounds=null,this._moveendHandler=this._moveendHandler.bind(this)};return w.prototype.initialize=function(_){this._map=_;var e=document.createElement("div");return e.style.position="absolute",e.style.top=0,e.style.left=0,e.style.border=0,e.style.width=this._map.getSize().width+"px",e.style.height=this._map.getSize().height+"px",this.conf.element=e,_.getPanes().mapPane.appendChild(e),this.heatmap=x.create(this.conf),this._div=e,e},w.prototype.draw=function(){var _=this._map.getBounds();if(!_.equals(this.bounds)){this.bounds=_;var e=this._map.pointToOverlayPixel(_.getNorthEast()),r=this._map.pointToOverlayPixel(_.getSouthWest());if(!(!e||!r)){var t=e.y,i=r.x,u=r.y-e.y,p=e.x-r.x;if(this.conf.element.style.left=i+"px",this.conf.element.style.top=t+"px",this.conf.element.style.width=p+"px",this.conf.element.style.height=u+"px",this.heatmap.store.get("heatmap").resize(),this.latlngs.length>0){this.heatmap.clear();for(var d=this.latlngs.length,n={max:this.heatmap.store.max,data:[]};d--;){var l=this.latlngs[d].latlng;if(_.containsPoint(l)){var f=this._map.pointToOverlayPixel(l),v=new BMap.Pixel(f.x-i,f.y-t),a=this.pixelTransform(v);n.data.push({x:a.x,y:a.y,count:this.latlngs[d].c})}}this.heatmap.store.setDataSet(n)}}}},w.prototype.pixelTransform=function(_){for(var e=this.heatmap.get("width"),r=this.heatmap.get("height");_.x<0;)_.x+=e;for(;_.x>e;)_.x-=e;for(;_.y<0;)_.y+=r;for(;_.y>r;)_.y-=r;return _.x=_.x>>0,_.y=_.y>>0,_},w.prototype._moveendHandler=function(_){this.setDataSet(this._data),delete this._data,this._map.removeEventListener("moveend",this._moveendHandler)},w.prototype.setDataSet=function(_){if(this._map){var e=this._map.getBounds(),r=this._map.pointToOverlayPixel(e.getNorthEast()),t=this._map.pointToOverlayPixel(e.getSouthWest());(!r||!t)&&(this._data=_,this._map.addEventListener("moveend",this._moveendHandler));var i={max:_.max,data:[]},u=_.data,p=u.length;for(this.latlngs=[];p--;){var d=new BMap.Point(u[p].lng,u[p].lat);if(this.latlngs.push({latlng:d,c:u[p].count}),!!e.containsPoint(d)){var n=this._map.pointToOverlayPixel(d),l=this._map.pointToOverlayPixel(e.getSouthWest()).x,f=this._map.pointToOverlayPixel(e.getNorthEast()).y,v=new BMap.Pixel(n.x-l,n.y-f),a=this.pixelTransform(v);i.data.push({x:a.x,y:a.y,count:u[p].count})}}this.heatmap.clear(),this.heatmap.store.setDataSet(i)}},w.prototype.addDataPoint=function(_,e,r){var t=new BMap.Point(_,e),i=this.pixelTransform(this._map.pointToOverlayPixel(t));this.heatmap.store.addDataPoint(i.x,i.y,r),this.latlngs.push({latlng:t,c:r})},w.prototype.toggle=function(){this.heatmap.toggleDisplay()},w})})(ft);var gt={exports:{}};(function(s,g){(function(h,x){s.exports=x()})(I,function(){function h(_,e){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}var r=x(_),t=new BMap.Polyline(r,e);return t.addEventListener("lineupdate",function(){this.isEditing&&this.enableEditing()}),t.cornerPoints=_,t.editMarkers=[],t.enableEditing=function(){var i=this;if(i.map){i.disableEditing();for(var u=0;u0&&(e=e.concat(t))}return e}function w(_,e){var r=[];if(!_||!e||!(_ instanceof BMap.Point)||!(e instanceof BMap.Point))return null;var t=function(m){return 1-2*m+m*m},i=function(m){return 2*m-2*m*m},u=function(m){return m*m},p=30,d,n,l,f,v,a,M=0,B=0;if(typeof e>"u"){typeof r<"u"&&(r=[]);return}var E=parseFloat(_.lat),S=parseFloat(e.lat),o=parseFloat(_.lng),c=parseFloat(e.lng);for(c>o&&parseFloat(c-o)>180&&o<0&&(o=parseFloat(180+180+o)),o>c&&parseFloat(o-c)>180&&c<0&&(c=parseFloat(180+180+c)),a=0,S==E?(d=0,n=o-c):c==o?(d=Math.PI/2,n=E-S):(d=Math.atan((S-E)/(c-o)),n=(S-E)/Math.sin(d)),a==0&&(a=d+Math.PI/5),l=n/2,v=l*Math.cos(a)+o,f=l*Math.sin(a)+E,M=0;M{const x=U("bm-map-type");return Z(),Q(et(pt),{class:"map",ak:"ljiKlTAsS7SNVqDM16IUwRVFFhrvbxiF",v:"3.0",center:{lng:116.404,lat:39.915},zoom:15,"scroll-wheel-zoom":!0},{default:q(()=>[tt(x,{"map-types":["BMAP_NORMAL_MAP","BMAP_HYBRID_MAP"],anchor:"BMAP_ANCHOR_TOP_LEFT"})]),_:1})}}});const vt=it(mt,[["__scopeId","data-v-ff16be7d"]]);export{vt as default};