tg-map-vue3 3.3.2 → 3.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode('.baidu-info-box-container{transform:translateY(-11px);font-size:13px;font-weight:300;width:100vw}.baidu-info-box-container__border{position:absolute;padding:12px;background-color:#fff;box-shadow:0 2px 7px 1px #0000004d;border-radius:8px;transform:translate(-50%,-100%)}.baidu-info-box-container__inner{overflow:auto}.baidu-info-box-container__close{position:absolute;right:-6px;top:-6px;width:14px;height:14px;margin:8px;opacity:.6;cursor:pointer}.baidu-info-box-container__close:hover{opacity:1}.baidu-info-box-container:after{position:absolute;background-color:#fff;content:"";width:15px;height:15px;left:0px;top:0px;box-shadow:-2px 2px 2px #b2b2b266;transform:translate(-50%,-50%) rotate(-45deg)}.tg-map{height:100vh;position:relative}.tg-map__map{width:100%;height:100%}.tg-map__map--hide-logo-google .gm-style a[target=_blank]:has(> div > img){display:none!important}.tg-map__map--hide-logo-google .gm-style>div:last-child>div:last-child>div{display:none}.tg-map__map--hide-logo-baidu div.anchorBL>a[target=_blank]>img{display:none}.tg-map__map--hide-logo-baidu div.BMap_cpyCtrl{display:none}.tg-map-widget{position:absolute}.tg-map>.tg-custom-control{display:none}.element-overlay{position:absolute}.tg-map .tg-element-overlay{display:none}.tg-map__map .tg-element-overlay{display:block}.tg-map .tg-info-box{display:none}.tg-map__map .tg-info-box{display:block}.tg-map .tg-label{display:none}.tg-map__map .tg-label{display:block}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
1
+ (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode('.baidu-info-box-container{transform:translateY(-11px);font-size:13px;font-weight:300;width:100vw}.baidu-info-box-container__border{position:absolute;padding:12px;background-color:#fff;box-shadow:0 2px 7px 1px #0000004d;border-radius:8px;transform:translate(-50%,-100%)}.baidu-info-box-container__inner{overflow:auto}.baidu-info-box-container__close{position:absolute;right:-6px;top:-6px;width:14px;height:14px;margin:8px;opacity:.6;cursor:pointer}.baidu-info-box-container__close:hover{opacity:1}.baidu-info-box-container:after{position:absolute;background-color:#fff;content:"";width:15px;height:15px;left:0px;top:0px;box-shadow:-2px 2px 2px #b2b2b266;transform:translate(-50%,-50%) rotate(-45deg)}.tg-map{height:100%;position:relative}.tg-map__map{width:100%;height:100%}.tg-map__map--hide-logo-google .gm-style a[target=_blank]:has(> div > img){display:none!important}.tg-map__map--hide-logo-google .gm-style>div:last-child>div:last-child>div{display:none}.tg-map__map--hide-logo-baidu div.anchorBL>a[target=_blank]>img{display:none}.tg-map__map--hide-logo-baidu div.BMap_cpyCtrl{display:none}.tg-map-widget{position:absolute}.tg-map>.tg-custom-control{display:none}.element-overlay{position:absolute}.tg-map .tg-element-overlay{display:none}.tg-map__map .tg-element-overlay{display:block}.tg-map .tg-info-box{display:none}.tg-map__map .tg-info-box{display:block}.tg-map .tg-label{display:none}.tg-map__map .tg-label{display:block}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
2
  (function(a,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],g):(a=typeof globalThis<"u"?globalThis:a||self,g(a.TgMap={},a.Vue))})(this,function(a,g){"use strict";var tn=Object.defineProperty;var rn=(a,g,k)=>g in a?tn(a,g,{enumerable:!0,configurable:!0,writable:!0,value:k}):a[g]=k;var p=(a,g,k)=>(rn(a,typeof g!="symbol"?g+"":g,k),k);function k(i,e,t){Object.keys(i).forEach(r=>{r.startsWith("update:")||t!=null&&t.includes(r)||e.addEventListener(r,i[r])})}let gr=1;function mr(){return gr++}function _e(i,e){return e.__id__||(e.__id__=mr()),`${i}::${e.__id__}`}var bt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ye(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Tt={exports:{}};(function(i){(function(e,t){i.exports?i.exports=t():e.coordtransform=t()})(bt,function(){var e=52.35987755982988,t=3.141592653589793,r=6378245,n=.006693421622965943;function s(f,y,M,w){this.west=Math.min(f,M),this.north=Math.max(y,w),this.east=Math.max(f,M),this.south=Math.min(y,w)}s.prototype.contain=function(f,y){return this.west<=f&&this.east>=f&&this.north>=y&&this.south<=y};var l=[new s(79.4462,49.2204,96.33,42.8899),new s(109.6872,54.1415,135.0002,39.3742),new s(73.1246,42.8899,124.143255,29.5297),new s(82.9684,29.5297,97.0352,26.7186),new s(97.0253,29.5297,124.367395,20.414096),new s(107.975793,20.414096,111.744104,17.871542)],d=[new s(119.921265,25.398623,122.497559,21.785006),new s(101.8652,22.284,106.665,20.0988),new s(106.4525,21.5422,108.051,20.4878),new s(109.0323,55.8175,119.127,50.3257),new s(127.4568,55.8175,137.0227,49.5574),new s(131.2662,44.8922,137.0227,42.5692),new s(73.1246,35.398637,77.948114,29.5297)];function o(f,y){for(var M=0;M<l.length;M++)if(l[M].contain(f,y)){for(var w=0;w<d.length;w++)if(d[w].contain(f,y))return!1;return!0}return!1}function h(f,y){var M=f-.0065,w=y-.006,I=Math.sqrt(M*M+w*w)-2e-5*Math.sin(w*e),P=Math.atan2(w,M)-3e-6*Math.cos(M*e),X=I*Math.cos(P),le=I*Math.sin(P);return[X,le]}function c(f,y){var M=Math.sqrt(f*f+y*y)+2e-5*Math.sin(y*e),w=Math.atan2(y,f)+3e-6*Math.cos(f*e),I=M*Math.cos(w)+.0065,P=M*Math.sin(w)+.006;return[I,P]}function u(f,y){return o(f,y)?b(f,y):[f,y]}function m(f,y){if(!o(f,y))return[f,y];var M=b(f,y);return[f*2-M[0],y*2-M[1]]}function b(f,y){var M=C(f-105,y-35),w=T(f-105,y-35),I=y/180*t,P=Math.sin(I);P=1-n*P*P;var X=Math.sqrt(P);M=M*180/(r*(1-n)/(P*X)*t),w=w*180/(r/X*Math.cos(I)*t);var le=y+M,vt=f+w;return[vt,le]}function C(f,y){var M=-100+2*f+3*y+.2*y*y+.1*f*y+.2*Math.sqrt(Math.abs(f));return M+=(20*Math.sin(6*f*t)+20*Math.sin(2*f*t))*2/3,M+=(20*Math.sin(y*t)+40*Math.sin(y/3*t))*2/3,M+=(160*Math.sin(y/12*t)+320*Math.sin(y*t/30))*2/3,M}function T(f,y){var M=300+f+2*y+.1*f*f+.1*f*y+.1*Math.sqrt(Math.abs(f));return M+=(20*Math.sin(6*f*t)+20*Math.sin(2*f*t))*2/3,M+=(20*Math.sin(f*t)+40*Math.sin(f/3*t))*2/3,M+=(150*Math.sin(f/12*t)+300*Math.sin(f/30*t))*2/3,M}return{bd09togcj02:h,gcj02tobd09:c,wgs84togcj02:u,gcj02towgs84:m,bd09ToGcj02:h,gcj02ToBd09:c,wgs84ToGcj02:u,gcj02ToWgs84:m,bd09ToWgs84:function(f,y){if(!o(f,y))return[f,y];var M=h(f,y);return m(M[0],M[1])},wgs84ToBd09:function(f,y){if(!o(f,y))return[f,y];var M=u(f,y);return c(M[0],M[1])}}})})(Tt);var fr=Tt.exports;const J=Ye(fr);function F(i,e){if(!i)throw new Error(`AssertionError: ${e}`)}function ve(i){throw new Error(`Unexpected object: ${i}`)}function E(i){throw new Error(i)}function Ke(i){throw new Error(`Unsupported: ${i}`)}function yr(i){throw new Error(`todo: ${i}`)}function _r(i){return i}function Q(...i){}function vr(i){return i!=null}var V=(i=>(i.wgs84="wgs84",i.gcj02="gcj02",i.bd09="bd09",i))(V||{});const qe="wgs84",D=class{constructor(e,t,r){this.lat=e,this.lng=t,this.coord=r}static fromBaidu(e,t){return new D(e.lat,e.lng,t)}static fromGoogle(e,t){return new D(e.lat(),e.lng(),t)}static fromHere(e,t){return new D(e.lat,e.lng,t)}static fromLiteral(e){return new D(e.lat,e.lng,e.coord||qe)}static fromLngLat(e,t,r=qe){return new D(t,e,r)}static create(e,t,r=qe){return new D(e,t,r)}to(e){if(this.coord===e)return this;const[t,r]=this.convert(e);return new D(r,t,e)}toBaidu(e){let t=this.lat,r=this.lng;return this.coord!==e&&([r,t]=this.convert(e)),new BMap.Point(r,t)}toGoogle(e){let t=this.lat,r=this.lng;return this.coord!==e&&([r,t]=this.convert(e)),new google.maps.LatLng(t,r)}toHere(e){let t=this.lat,r=this.lng;return this.coord!==e&&([r,t]=this.convert(e)),new H.geo.Point(t,r)}convert(e){switch(this.coord){case"bd09":return e==="gcj02"?J.bd09ToGcj02(this.lng,this.lat):J.bd09ToWgs84(this.lng,this.lat);case"gcj02":return e==="wgs84"?J.gcj02ToWgs84(this.lng,this.lat):J.gcj02ToBd09(this.lng,this.lat);case"wgs84":return e==="bd09"?J.wgs84ToBd09(this.lng,this.lat):J.wgs84ToGcj02(this.lng,this.lat)}throw new Error(`不支持的坐标转换: ${this.coord}=>${e}`)}equals(e){return this===e?!0:this.lat===e.lat&&this.lng===e.lng&&this.coord===e.coord}toString(){return JSON.stringify(this)}};let v=D;p(v,"ZERO",D.create(0,0));const q=class{constructor(e,t){p(this,"coord");this.sw=e,this.ne=t,F(e.coord===t.coord,"sw和ne的coord应该相同"),F(Number.isFinite(e.lat)&&Number.isFinite(e.lng)&&Number.isFinite(t.lat)&&Number.isFinite(t.lng),`sw(${e})和ne(${t})不能包含NaN或Infinite`),F(e.lat<=t.lat,`sw.lat(${e.lat})应该比ne.lat(${t.lat})小`),this.coord=e.coord}static isBetweenLng(e,t,r){return e<=t?e<=r&&r<=t:e<=r||r<=t}static fromArray(e){if(e.length===0)return;const t=new q.Builder(e[0]);for(let r=1;r<e.length;r++)t.include(e[r]);return t.build()}static from(...e){return this.fromArray(e)??E("positions中没有点")}static fromGoogle(e,t){return new q(v.fromGoogle(e.getSouthWest(),t),v.fromGoogle(e.getNorthEast(),t))}static fromBaidu(e,t){return new q(v.fromBaidu(e.getSouthWest(),t),v.fromBaidu(e.getNorthEast(),t))}static create(e,t){return this.from(e,t)}isEmpty(){return this.sw.equals(this.ne)}contains(e){const{lat:t,lng:r}=e.to(this.coord);return this.sw.lat<=t&&t<=this.ne.lat&&q.isBetweenLng(this.sw.lng,this.ne.lng,r)}getCenter(){const e=(this.sw.lat+this.ne.lat)/2,t=(this.sw.lng+this.ne.lng+(this.sw.lng<this.ne.lng?0:360))/2;return v.create(e,t,this.coord)}toString(){return JSON.stringify(this)}equals(e){return this.sw.equals(e.sw)&&this.ne.equals(e.ne)}toGoogle(e){return new google.maps.LatLngBounds(this.sw.toGoogle(e),this.ne.toGoogle(e))}toBaidu(e){return new BMap.Bounds(this.sw.toBaidu(e),this.ne.toBaidu(e))}toBaiduArray(e){return[this.sw.toBaidu(e),this.ne.toBaidu(e)]}};let G=q;p(G,"EMPTY",new q(v.ZERO,v.ZERO)),(i=>{class e{constructor(r){p(this,"coord");p(this,"minLat");p(this,"minLng");p(this,"maxLat");p(this,"maxLng");this.coord=r.coord,this.minLat=this.maxLat=r.lat,this.minLng=this.maxLng=r.lng}build(){return new i(v.create(this.minLat,this.minLng,this.coord),v.create(this.maxLat,this.maxLng,this.coord))}include(r){const{lat:n,lng:s}=r.to(this.coord);return this.minLat=Math.min(this.minLat,n),this.maxLat=Math.max(this.maxLat,n),i.isBetweenLng(this.minLng,this.maxLng,s)||(this.delta(this.minLng,s)<this.delta(s,this.maxLng)?this.minLng=s:this.maxLng=s),this}delta(r,n){return(r-n+360)%360}}i.Builder=e})(G||(G={}));var Mr=function(e){return br(e)&&!Tr(e)};function br(i){return!!i&&typeof i=="object"}function Tr(i){var e=Object.prototype.toString.call(i);return e==="[object RegExp]"||e==="[object Date]"||wr(i)}var Cr=typeof Symbol=="function"&&Symbol.for,Or=Cr?Symbol.for("react.element"):60103;function wr(i){return i.$$typeof===Or}function Er(i){return Array.isArray(i)?[]:{}}function he(i,e){return e.clone!==!1&&e.isMergeableObject(i)?ee(Er(i),i,e):i}function Pr(i,e,t){return i.concat(e).map(function(r){return he(r,t)})}function kr(i,e){if(!e.customMerge)return ee;var t=e.customMerge(i);return typeof t=="function"?t:ee}function Lr(i){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(i).filter(function(e){return Object.propertyIsEnumerable.call(i,e)}):[]}function Ct(i){return Object.keys(i).concat(Lr(i))}function Ot(i,e){try{return e in i}catch{return!1}}function Ir(i,e){return Ot(i,e)&&!(Object.hasOwnProperty.call(i,e)&&Object.propertyIsEnumerable.call(i,e))}function Sr(i,e,t){var r={};return t.isMergeableObject(i)&&Ct(i).forEach(function(n){r[n]=he(i[n],t)}),Ct(e).forEach(function(n){Ir(i,n)||(Ot(i,n)&&t.isMergeableObject(e[n])?r[n]=kr(n,t)(i[n],e[n],t):r[n]=he(e[n],t))}),r}function ee(i,e,t){t=t||{},t.arrayMerge=t.arrayMerge||Pr,t.isMergeableObject=t.isMergeableObject||Mr,t.cloneUnlessOtherwiseSpecified=he;var r=Array.isArray(e),n=Array.isArray(i),s=r===n;return s?r?t.arrayMerge(i,e,t):Sr(i,e,t):he(e,t)}ee.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,n){return ee(r,n,t)},{})};var Br=ee,xr=Br;const wt=Ye(xr),Me=["3.0"],Ar={baidu:{version:"3.0",key:""},google:{version:"quarterly",key:"",language:"en-us",libraries:["places"]},here:{version:Me[0],key:""}};let Et;function Xe(){return Et||E("请先安装: Vue<PartialTgMapConfig>.use(TgMap, {})")}function Pt(i){i!=null&&(Et=wt(Ar,i))}var Je;(i=>{function e(t){return t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight}i.isScrollable=e})(Je||(Je={})),a.Arrays=void 0,(i=>{function e(r,n){const s=r.indexOf(n);if(s!==-1)return r.splice(s,1)[0]}i.remove=e;function t(r,n){for(const s of r)if(s instanceof n)return s}i.findByType=t})(a.Arrays||(a.Arrays={})),a.MVCArrays=void 0,(i=>{function e(r,n){const s=r.getLength();for(let l=0;l<s;l++)if(r.getAt(l)===n)return l;return-1}i.indexOf=e;function t(r,n){const s=e(r,n);if(s!==-1)return r.removeAt(s)}i.remove=t})(a.MVCArrays||(a.MVCArrays={}));function $r(){}function be(i){return i}function zr(i,e){return i instanceof e}function Rr(i,e){if(i instanceof e)return i}function te(i,e){if((i==null?void 0:i.$options.name)===e.name)return i}function Nr(i){return i}function kt(i,e,t){return i.addListener(e,t).remove}function Dr(i,e,t){return i.addEventListener(e,t),()=>i.removeEventListener(e,t)}function Gr(i,e,t,r){return i.addEventListener(e,t,r),()=>i.removeEventListener(e,t,r)}function Lt(i,e,t){return i.addEventListener(e,t),()=>i.removeEventListener(e,t)}class It{constructor(e,t){p(this,"eventMap",new Map);p(this,"target",void 0);this.inner=e,this.coordTypeSupplier=t,this.addEventListener=this.addEventListener.bind(this),this.removeEventListener=this.removeEventListener.bind(this)}setTarget(e){return this.target=e,this}}const _t=class extends It{addEventListener(e,t){const r=_e(e,t);if(this.eventMap.get(r)){console.warn("listener已经添加过了",r,t);return}const n=this.inner.addListener(_t.EVENT_TYPE_MAP[e]||e,s=>{const l={type:e,target:this.target,originalEvent:s};s!=null&&s.latLng&&(l.position=v.fromGoogle(s.latLng,this.coordTypeSupplier.coordType)),t.call(this.target,l)});this.eventMap.set(r,n)}removeEventListener(e,t){const r=_e(e,t),n=this.eventMap.get(r);n?(n.remove(),this.eventMap.delete(r)):console.warn("移除失败, 不存在该listener",r,t)}};let U=_t;p(U,"EVENT_TYPE_MAP",{"center-changed":"center_changed","zoom-changed":"zoom_changed","map-type-changed":"maptypeid_changed","map-mousedown":"mousedown","map-mousemove":"mousemove","map-mouseup":"mouseup","map-dblclick":"dblclick"});const Ue=class extends It{addEventListener(e,t){const r=_e(e,t);if(this.eventMap.get(r)){console.warn("listener已经添加过了",r,t);return}const n=s=>{const l={type:e,target:this.target,originalEvent:s};s.point&&(l.position=v.fromBaidu(s.point,this.coordTypeSupplier.coordType)),t.call(this.target,l)};this.inner.addEventListener(Ue.EVENT_TYPE_MAP[e]||e,n),this.eventMap.set(r,n)}removeEventListener(e,t){const r=_e(e,t),n=this.eventMap.get(r);n?(this.inner.removeEventListener(Ue.EVENT_TYPE_MAP[e]||e,n),this.eventMap.delete(r)):console.warn("移除失败, 不存在该listener",r,t)}};let re=Ue;p(re,"EVENT_TYPE_MAP",{drag:"dragging",closeclick:"clickclose","zoom-changed":"zoomend","map-type-changed":"maptypechange"});class Zr{constructor(){p(this,"typeMap",new Map)}addEventListener(e,t){let r=this.typeMap.get(e);r||(r=[],this.typeMap.set(e,r)),!r.includes(t)&&r.push(t)}removeEventListener(e,t){const r=this.typeMap.get(e);r&&a.Arrays.remove(r,t)}hasListener(e){const t=this.typeMap.get(e);return t!=null&&t.length>0}notify(e){const t=this.typeMap.get(e.type);t&&t.forEach(r=>r.call(e.target,e))}}class Qe{constructor(e,t){p(this,"keyToValue",new Map);p(this,"valueToKey",new Map);F(e.length===t.length);for(let r=e.length-1;r>=0;r--)this.keyToValue.set(e[r],t[r]),this.valueToKey.set(t[r],e[r])}toKey(e){return this.valueToKey.get(e)??E()}toValue(e){return this.keyToValue.get(e)??E()}}class St{constructor(e,t=10){p(this,"map",new Map);this.values=e,this.maxSize4Debug=t}getValueMap(e){let t=this.map.get(e);if(!t){t=new Map;for(let r=this.values.length-1;r>=0;r--){const n=this.values[r];t.set(e.call(n),n)}this.map.set(e,t),process.env.NODE_ENV!=="production"&&this.map.size>this.maxSize4Debug&&console.warn(`this.map的大小(${this.map.size})超过了设置的最大大小(${this.maxSize4Debug}), 这可能是由于你每次都创建新的keySelector造成的, 请保证相同功能的keySelector只创建一个对象`)}return t}getOrNull(e,t){return this.getValueMap(e).get(t)}get(e,t){return this.getOrNull(e,t)??E(`key(${t})不存在与valueMap(${this.getValueMap(e)})中`)}}class et{constructor(e){p(this,"value");this.creator=e}get(){return this.value===void 0&&(this.value=this.creator()),this.value}}var S=(i=>(i.TOP_LEFT="top-left",i.TOP_CENTER="top-center",i.TOP_RIGHT="top-right",i.BOTTOM_LEFT="bottom-left",i.BOTTOM_CENTER="bottom-center",i.BOTTOM_RIGHT="bottom-right",i.LEFT_TOP="left-top",i.LEFT_CENTER="left-center",i.LEFT_BOTTOM="left-bottom",i.RIGHT_TOP="right-top",i.RIGHT_CENTER="right-center",i.RIGHT_BOTTOM="right-bottom",i))(S||{});a.ControlPositionConverter=void 0,(i=>{let e,t;const r=["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right","left-top","left-center","left-bottom","right-top","right-center","right-bottom"];function n(){return e||(e=new Qe(r,[BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_TOP_RIGHT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_RIGHT,BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_TOP_RIGHT,BMAP_ANCHOR_BOTTOM_RIGHT,BMAP_ANCHOR_BOTTOM_RIGHT])),e}i.getBaidu=n;function s(){return t||(t=new Qe(r,[google.maps.ControlPosition.TOP_LEFT,google.maps.ControlPosition.TOP_CENTER,google.maps.ControlPosition.TOP_RIGHT,google.maps.ControlPosition.BOTTOM_LEFT,google.maps.ControlPosition.BOTTOM_CENTER,google.maps.ControlPosition.BOTTOM_RIGHT,google.maps.ControlPosition.LEFT_TOP,google.maps.ControlPosition.LEFT_CENTER,google.maps.ControlPosition.LEFT_BOTTOM,google.maps.ControlPosition.RIGHT_TOP,google.maps.ControlPosition.RIGHT_CENTER,google.maps.ControlPosition.RIGHT_BOTTOM])),t}i.getGoogle=s})(a.ControlPositionConverter||(a.ControlPositionConverter={}));class Bt{constructor(e){p(this,"inner");this.position=e}}class tt{}class Te extends tt{constructor(e,t){super(),this.inner=e,this.position=t}isVisible(){return this.inner.isVisible()}setVisible(e){e?this.inner.show():this.inner.hide()}getPosition(){return this.position??a.ControlPositionConverter.getBaidu().toKey(this.inner.getAnchor())}setPosition(e){this.position=e,this.inner.setAnchor(a.ControlPositionConverter.getBaidu().toValue(e))}addTo(e){e.innerMap.addControl(this.inner)}removeFrom(e){e.innerMap.removeControl(this.inner)}}class Ce extends tt{constructor(t,r){super();p(this,"visible",!1);p(this,"map");this._type=t,this.position=r}isVisible(){return this.visible}setVisible(t){this.visible=t,this.tryUpdateOptions()}getPosition(){return this.position}setPosition(t){this.position=t,this.tryUpdateOptions()}addTo(t){this.map||(this.map=t,this.setVisible(!0))}removeFrom(){this.map&&(this.setVisible(!1),this.map=void 0)}onCreateOptions(){return{position:a.ControlPositionConverter.getGoogle().toValue(this.position)}}tryUpdateOptions(){this.map&&this.map.innerMap.setOptions({[`${this._type}Control`]:this.visible,[`${this._type}ControlOptions`]:this.onCreateOptions()})}}var xt=(i=>(i.normal="normal",i.satellite="satellite",i.hybrid="hybrid",i))(xt||{});class B{constructor(e,t,r,n){this.id=e,this.baidu=t,this.google=r,this.googleCoordType=n}getId(){return this.id}getBaiduCoordType(){return V.bd09}asBaiduMapType(){return this.baidu()}getGoogleCoordType(){return this.googleCoordType}getGoogleMapTypeId(){return this.google()}asGoogleMapType(){Ke("google的内置地图没有对应的实例")}}class Wr{constructor(){p(this,"baiduCache",new et(()=>new BMap.TrafficLayer));p(this,"googleCache",new et(()=>new google.maps.TrafficLayer))}asBaiduLayer(){return this.baiduCache.get()}asGoogleLayer(){return this.googleCache.get()}}var x;(i=>{i.NORMAL=new B("normal",()=>BMAP_NORMAL_MAP,()=>google.maps.MapTypeId.ROADMAP,V.gcj02),i.SATELLITE=new B("satellite",()=>BMAP_SATELLITE_MAP,()=>google.maps.MapTypeId.SATELLITE,V.wgs84),i.HYBRID=new B("hybrid",()=>BMAP_HYBRID_MAP,()=>google.maps.MapTypeId.HYBRID,V.gcj02),i.TERRAIN=new B("terrain",()=>BMAP_PERSPECTIVE_MAP,()=>google.maps.MapTypeId.TERRAIN,V.wgs84),i.BUILD_IN_MAP_TYPES=new St([i.NORMAL,i.SATELLITE,i.HYBRID,i.TERRAIN])})(x||(x={}));var rt=(i=>(i.DEFAULT="default",i.HORIZONTAL="horizontal",i.DROPDOWN="dropdown",i))(rt||{});const At=[x.NORMAL,x.SATELLITE,x.HYBRID];class Oe extends Te{static create(e){const t=e.mapTypes??At,r={default:BMAP_MAPTYPE_CONTROL_HORIZONTAL,horizontal:BMAP_MAPTYPE_CONTROL_HORIZONTAL,dropdown:BMAP_MAPTYPE_CONTROL_DROPDOWN},n=new BMap.MapTypeControl({type:e.type&&r[e.type],mapTypes:t.map(s=>s.asBaiduMapType())});return e.position&&n.setAnchor(a.ControlPositionConverter.getBaidu().toValue(e.position)),new Oe(n,e.position)}}const ae=class extends Ce{constructor(e="default",t=S.TOP_LEFT,r=At){super("mapType",t),this.type=e,this.mapTypes=r,ae.type2google||(ae.type2google={default:google.maps.MapTypeControlStyle.DEFAULT,horizontal:google.maps.MapTypeControlStyle.HORIZONTAL_BAR,dropdown:google.maps.MapTypeControlStyle.DROPDOWN_MENU})}static create(e){return new ae(e.type,e.position,e.mapTypes)}onCreateOptions(){const e=super.onCreateOptions();return e.style=ae.type2google[this.type],e.mapTypeIds=this.mapTypes.map(t=>t instanceof B?t.getGoogleMapTypeId():t.id),e}addTo(e){super.addTo(e),this.mapTypes.forEach(t=>{t instanceof B||e.innerMap.mapTypes.set(t.id,t.asGoogleMapType())})}};let ce=ae;p(ce,"type2google");class we extends Te{static create(e){const t=new BMap.ScaleControl({anchor:e.position&&a.ControlPositionConverter.getBaidu().toValue(e.position)});return new we(t,e.position)}}class Ee extends Ce{static create(e){return new Ee(e.position)}constructor(e=S.BOTTOM_RIGHT){super("scale",e)}}class Pe extends Te{static create(e){const t=new BMap.NavigationControl({type:BMAP_NAVIGATION_CONTROL_ZOOM,anchor:e.position&&a.ControlPositionConverter.getBaidu().toValue(e.position)});return new Pe(t,e.position)}}class ke extends Ce{static create(e){return new ke(e.position)}constructor(e=S.RIGHT_BOTTOM){super("zoom",e)}}function jr(i){let e,t,r;const n="The Google Maps JavaScript API",s="google",l="importLibrary",d="__ib__",o=document,h=window,c=h[s]||(h[s]={}),u=c.maps||(c.maps={}),m=new Set,b=new URLSearchParams,C=()=>e||(e=new Promise(async(T,f)=>{var y;await(t=o.createElement("script")),b.set("libraries",[...m]+"");for(r in i)b.set(r.replace(/[A-Z]/g,M=>"_"+M[0].toLowerCase()),i[r]);b.set("callback",s+".maps."+d),t.src=`https://maps.${s}apis.com/maps/api/js?`+b,u[d]=T,t.onerror=()=>e=f(Error(n+" could not load.")),t.nonce=((y=o.querySelector("script[nonce]"))==null?void 0:y.nonce)||"",o.head.append(t)}));u[l]?console.warn(n+" only loads once. Ignoring:",i):u[l]=(T,...f)=>m.add(T)&&C().then(()=>u[l](T,...f))}let $t;const Y={get LATLNG_ZERO(){return $t??($t=new google.maps.LatLng({lat:0,lng:0}))}};function zt(i,e={country:"",province:"",city:"",district:"",street:"",streetNumber:""}){for(const t of i)for(const r of t.types)switch(r){case"street_number":e.streetNumber=t.long_name;break;case"route":e.street=t.long_name;break;case"locality":e.city=t.long_name;break;case"sublocality":e.district=t.long_name;break;case"administrative_area_level_1":e.province=t.long_name;break;case"country":e.country=t.long_name;break}return e}function Rt(i,e){var r;const t=i.address_components&&zt(i.address_components);return{country:(t==null?void 0:t.country)??"",province:(t==null?void 0:t.province)??"",city:(t==null?void 0:t.city)??"",id:i.place_id??"",address:i.formatted_address??"",position:v.fromGoogle(((r=i.geometry)==null?void 0:r.location)??Y.LATLNG_ZERO,e.coordType),title:i.name??""}}class it{}class Nt extends it{constructor(t,r){super();p(this,"inner");this.map=t,this.inner=new google.maps.places.Autocomplete(r.input,{fields:["address_components","name"]}),r.bindToMap&&this.inner.bindTo("bounds",t.innerMap)}setBounds(t){this.inner.setBounds(t.toGoogle(this.map.coordType))}addResultListener(t){return kt(this.inner,"place_changed",()=>{const r=this.inner.getPlace(),n={title:r.name??"",province:"",city:"",district:"",street:"",streetNumber:"",country:""};r.address_components&&zt(r.address_components,n),t(n)})}}class Dt extends it{constructor(t,r){super();p(this,"inner");p(this,"input");p(this,"removeableArray",[]);if(this.map=t,this.input=r.input,this.inner=new BMap.Autocomplete({input:r.input,location:r.bindToMap?t.innerMap:void 0}),r.bindToMap){const n=()=>{this.inner.setLocation(this.map.innerMap)};this.removeableArray.push(Lt(this.map,"center-changed",n)),this.removeableArray.push(Lt(this.map,"zoom-changed",n))}}setBounds(t){this.inner.setLocation(t.getCenter().toBaidu(this.map.coordType))}addResultListener(t){let r=0;const n=Dr(this.inner,"confirm",l=>{const d=l.item.value;r=Date.now(),t(Object.assign({title:d.business,country:""},d))}),s=Gr(this.input,"keyup",l=>{l.key==="Enter"&&Date.now()-r>100&&t({title:this.input.value,country:"",city:"",district:"",province:"",street:"",streetNumber:""})});return()=>{s(),n()}}}let Vr=class pr{constructor(e,t,r){this.extend(pr,google.maps.OverlayView),this.map_=e,this.MARKER_CLUSTER_IMAGE_PATH_="../images/m",this.MARKER_CLUSTER_IMAGE_EXTENSION_="png",this.markers_=[],this.clusters_=[],this.sizes=[53,56,66,78,90],this.styles_=[],this.ready_=!1;var n=r||{};this.zIndex_=n.zIndex||google.maps.Marker.MAX_ZINDEX+1,this.gridSize_=n.gridSize||60,this.minClusterSize_=n.minimumClusterSize||2,this.maxZoom_=n.maxZoom||null,this.styles_=n.styles||[],this.imagePath_=n.imagePath||this.MARKER_CLUSTER_IMAGE_PATH_,this.imageExtension_=n.imageExtension||this.MARKER_CLUSTER_IMAGE_EXTENSION_,this.zoomOnClick_=!0,n.zoomOnClick!=null&&(this.zoomOnClick_=n.zoomOnClick),this.averageCenter_=!1,n.averageCenter!=null&&(this.averageCenter_=n.averageCenter),this.setupStyles_(),this.setMap(e),this.prevZoom_=this.map_.getZoom();var s=this;google.maps.event.addListener(this.map_,"zoom_changed",function(){var l=s.map_.getZoom(),d=s.map_.minZoom||0,o=Math.min(s.map_.maxZoom||100,s.map_.mapTypes[s.map_.getMapTypeId()].maxZoom);l=Math.min(Math.max(l,d),o),s.prevZoom_!=l&&(s.prevZoom_=l,s.resetViewport())}),google.maps.event.addListener(this.map_,"idle",function(){s.redraw()}),t&&(t.length||Object.keys(t).length)&&this.addMarkers(t,!1)}extend(e,t){return function(r){for(var n in r.prototype)this.prototype[n]=r.prototype[n];return this}.apply(e,[t])}onAdd(){this.setReady_(!0)}draw(){}setupStyles_(){if(!this.styles_.length)for(var e=0,t;t=this.sizes[e];e++)this.styles_.push({url:this.imagePath_+(e+1)+"."+this.imageExtension_,height:t,width:t})}fitMapToMarkers(){for(var e=this.getMarkers(),t=new google.maps.LatLngBounds,r=0,n;n=e[r];r++)t.extend(n.getPosition());this.map_.fitBounds(t)}setZIndex(e){this.zIndex_=e}getZIndex(){return this.zIndex_}setStyles(e){this.styles_=e}getStyles(){return this.styles_}isZoomOnClick(){return this.zoomOnClick_}isAverageCenter(){return this.averageCenter_}getMarkers(){return this.markers_}getTotalMarkers(){return this.markers_.length}setMaxZoom(e){this.maxZoom_=e}getMaxZoom(){return this.maxZoom_}calculator_(e,t){for(var r=0,n=e.length,s=n;s!==0;)s=parseInt(s/10,10),r++;return r=Math.min(r,t),{text:n,index:r}}setCalculator(e){this.calculator_=e}getCalculator(){return this.calculator_}addMarkers(e,t){if(e.length)for(let r=0,n;n=e[r];r++)this.pushMarkerTo_(n);else if(Object.keys(e).length)for(let r in e)this.pushMarkerTo_(e[r]);t||this.redraw()}pushMarkerTo_(e){if(e.isAdded=!1,e.draggable){var t=this;google.maps.event.addListener(e,"dragend",function(){e.isAdded=!1,t.repaint()})}this.markers_.push(e)}addMarker(e,t){this.pushMarkerTo_(e),t||this.redraw()}removeMarker_(e){var t=-1;if(this.markers_.indexOf)t=this.markers_.indexOf(e);else for(var r=0,n;n=this.markers_[r];r++)if(n==e){t=r;break}return t==-1?!1:(e.setMap(null),this.markers_.splice(t,1),!0)}removeMarker(e,t){var r=this.removeMarker_(e);return!t&&r?(this.resetViewport(),this.redraw(),!0):!1}removeMarkers(e,t){for(var r=e===this.getMarkers()?e.slice():e,n=!1,s=0,l;l=r[s];s++){var d=this.removeMarker_(l);n=n||d}if(!t&&n)return this.resetViewport(),this.redraw(),!0}setReady_(e){this.ready_||(this.ready_=e,this.createClusters_())}getTotalClusters(){return this.clusters_.length}getMap(){return this.map_}setMap(e){this.map_=e}getGridSize(){return this.gridSize_}setGridSize(e){this.gridSize_=e}getMinClusterSize(){return this.minClusterSize_}setMinClusterSize(e){this.minClusterSize_=e}getExtendedBounds(e){var t=this.getProjection(),r=new google.maps.LatLng(e.getNorthEast().lat(),e.getNorthEast().lng()),n=new google.maps.LatLng(e.getSouthWest().lat(),e.getSouthWest().lng()),s=t.fromLatLngToDivPixel(r);s.x+=this.gridSize_,s.y-=this.gridSize_;var l=t.fromLatLngToDivPixel(n);l.x-=this.gridSize_,l.y+=this.gridSize_;var d=t.fromDivPixelToLatLng(s),o=t.fromDivPixelToLatLng(l);return e.extend(d),e.extend(o),e}isMarkerInBounds_(e,t){return t.contains(e.getPosition())}clearMarkers(){this.resetViewport(!0),this.markers_=[]}resetViewport(e){for(let t=0,r;r=this.clusters_[t];t++)r.remove();for(let t=0,r;r=this.markers_[t];t++)r.isAdded=!1,e&&r.setMap(null);this.clusters_=[]}repaint(){var e=this.clusters_.slice();this.clusters_.length=0,this.resetViewport(),this.redraw(),setTimeout(function(){for(var t=0,r;r=e[t];t++)r.remove()},0)}redraw(){this.createClusters_()}distanceBetweenPoints_(e,t){if(!e||!t)return 0;var r=6371,n=(t.lat()-e.lat())*Math.PI/180,s=(t.lng()-e.lng())*Math.PI/180,l=Math.sin(n/2)*Math.sin(n/2)+Math.cos(e.lat()*Math.PI/180)*Math.cos(t.lat()*Math.PI/180)*Math.sin(s/2)*Math.sin(s/2),d=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),o=r*d;return o}addToClosestCluster_(e){for(var t=4e4,r=null,n=0,s;s=this.clusters_[n];n++){var l=s.getCenter();if(l){var d=this.distanceBetweenPoints_(l,e.getPosition());d<t&&(t=d,r=s)}}if(r&&r.isMarkerInClusterBounds(e))r.addMarker(e);else{var o=new Hr(this);o.addMarker(e),this.clusters_.push(o)}}createClusters_(){if(this.ready_)for(var e=new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast()),t=this.getExtendedBounds(e),r=0,n;n=this.markers_[r];r++)!n.isAdded&&this.isMarkerInBounds_(n,t)&&this.addToClosestCluster_(n)}},Hr=class{constructor(e){this.markerClusterer_=e,this.map_=e.getMap(),this.gridSize_=e.getGridSize(),this.minClusterSize_=e.getMinClusterSize(),this.averageCenter_=e.isAverageCenter(),this.center_=null,this.markers_=[],this.bounds_=null,this.clusterIcon_=new nt(this,e.getStyles(),e.getGridSize())}isMarkerAlreadyAdded(e){if(this.markers_.indexOf)return this.markers_.indexOf(e)!=-1;for(var t=0,r;r=this.markers_[t];t++)if(r==e)return!0;return!1}addMarker(e){if(this.isMarkerAlreadyAdded(e))return!1;if(!this.center_)this.center_=e.getPosition(),this.calculateBounds_();else if(this.averageCenter_){var t=this.markers_.length+1,r=(this.center_.lat()*(t-1)+e.getPosition().lat())/t,n=(this.center_.lng()*(t-1)+e.getPosition().lng())/t;this.center_=new google.maps.LatLng(r,n),this.calculateBounds_()}e.isAdded=!0,this.markers_.push(e);var s=this.markers_.length;if(s<this.minClusterSize_&&e.getMap()!=this.map_&&e.setMap(this.map_),s==this.minClusterSize_)for(var l=0;l<s;l++)this.markers_[l].setMap(null);return s>=this.minClusterSize_&&e.setMap(null),this.updateIcon(),!0}getMarkerClusterer(){return this.markerClusterer_}getBounds(){for(var e=new google.maps.LatLngBounds(this.center_,this.center_),t=this.getMarkers(),r=0,n;n=t[r];r++)e.extend(n.getPosition());return e}remove(){this.clusterIcon_.remove(),this.markers_.length=0,delete this.markers_}getSize(){return this.markers_.length}getMarkers(){return this.markers_}getCenter(){return this.center_}calculateBounds_(){var e=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(e)}isMarkerInClusterBounds(e){return this.bounds_.contains(e.getPosition())}getMap(){return this.map_}updateIcon(){var e=this.map_.getZoom(),t=this.markerClusterer_.getMaxZoom();if(t&&e>t){for(var r=0,n;n=this.markers_[r];r++)n.setMap(this.map_);return}if(this.markers_.length<this.minClusterSize_){this.clusterIcon_.hide();return}var s=this.markerClusterer_.getStyles().length,l=this.markerClusterer_.getCalculator()(this.markers_,s);this.clusterIcon_.setCenter(this.center_),this.clusterIcon_.setSums(l),this.clusterIcon_.show()}};class nt{constructor(e,t,r){e.getMarkerClusterer().extend(nt,google.maps.OverlayView),this.styles_=t,this.padding_=r||0,this.cluster_=e,this.center_=null,this.map_=e.getMap(),this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(this.map_)}triggerClusterClick(){var e=this.cluster_.getBounds(),t=this.cluster_.getMarkerClusterer();google.maps.event.trigger(t.map_,"clusterclick",this.cluster_),t.isZoomOnClick()&&(this.map_.fitBounds(e),this.map_.setCenter(e.getCenter()))}onAdd(){if(this.div_=document.createElement("DIV"),this.visible_){var e=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(e),this.div_.innerHTML=this.sums_.text}var t=this.getPanes();t.overlayMouseTarget.appendChild(this.div_);var r=this;google.maps.event.addDomListener(this.div_,"click",function(){r.triggerClusterClick()})}getPosFromLatLng_(e){var t=this.getProjection().fromLatLngToDivPixel(e);return t.x-=parseInt(this.width_/2,10),t.y-=parseInt(this.height_/2,10),t}draw(){if(this.visible_){var e=this.getPosFromLatLng_(this.center_);this.div_.style.top=e.y+"px",this.div_.style.left=e.x+"px"}}hide(){this.div_&&(this.div_.style.display="none"),this.visible_=!1}show(){if(this.div_){var e=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(e),this.div_.style.display=""}this.visible_=!0}remove(){this.setMap(null)}onRemove(){this.div_&&this.div_.parentNode&&(this.hide(),this.div_.parentNode.removeChild(this.div_),this.div_=null)}setSums(e){this.sums_=e,this.text_=e.text,this.index_=e.index,this.div_&&(this.div_.innerHTML=e.text),this.useStyle()}useStyle(){var e=Math.max(0,this.sums_.index-1);e=Math.min(this.styles_.length-1,e);var t=this.styles_[e];this.url_=t.url,this.height_=t.height,this.width_=t.width,this.textColor_=t.textColor,this.anchor_=t.anchor,this.textSize_=t.textSize,this.backgroundPosition_=t.backgroundPosition}setCenter(e){this.center_=e}createCss(e){var t=[];t.push("z-index:"+this.cluster_.markerClusterer_.getZIndex()+";"),t.push("background-image:url("+this.url_+");");var r=this.backgroundPosition_?this.backgroundPosition_:"0 0";t.push("background-position:"+r+";"),typeof this.anchor_=="object"?(typeof this.anchor_[0]=="number"&&this.anchor_[0]>0&&this.anchor_[0]<this.height_?t.push("height:"+(this.height_-this.anchor_[0])+"px; padding-top:"+this.anchor_[0]+"px;"):t.push("height:"+this.height_+"px; line-height:"+this.height_+"px;"),typeof this.anchor_[1]=="number"&&this.anchor_[1]>0&&this.anchor_[1]<this.width_?t.push("width:"+(this.width_-this.anchor_[1])+"px; padding-left:"+this.anchor_[1]+"px;"):t.push("width:"+this.width_+"px; text-align:center;")):t.push("height:"+this.height_+"px; line-height:"+this.height_+"px; width:"+this.width_+"px; text-align:center;");var n=this.textColor_?this.textColor_:"black",s=this.textSize_?this.textSize_:11;return t.push("cursor:pointer; top:"+e.y+"px; left:"+e.x+"px; color:"+n+"; position:absolute; font-size:"+s+"px; font-family:Arial,sans-serif; font-weight:bold"),t.join("")}}var Gt={exports:{}};(function(i,e){(function(t,r){i.exports=r()})(bt,function(){var t,r=t=r||{version:"1.3.8"},n={};r.guid="$BAIDU$",n[r.guid]=n[r.guid]||{},r.dom=r.dom||{},r.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},r.g=r.G=r.dom.g,r.dom.getDocument=function(o){return o=r.dom.g(o),o.nodeType==9?o:o.ownerDocument||o.document},r.lang=r.lang||{},r.lang.isString=function(o){return Object.prototype.toString.call(o)=="[object String]"},r.isString=r.lang.isString,r.dom._g=function(o){return r.lang.isString(o)?document.getElementById(o):o},r._g=r.dom._g,r.browser=r.browser||{},/msie (\d+\.\d)/i.test(navigator.userAgent)&&(r.browser.ie=r.ie=document.documentMode||+RegExp.$1),r.dom.getComputedStyle=function(o,h){o=r.dom._g(o);var c=r.dom.getDocument(o),u;return c.defaultView&&c.defaultView.getComputedStyle&&(u=c.defaultView.getComputedStyle(o,null),u)?u[h]||u.getPropertyValue(h):""},r.dom._styleFixer=r.dom._styleFixer||{},r.dom._styleFilter=r.dom._styleFilter||[],r.dom._styleFilter.filter=function(o,h,c){for(var u=0,m=r.dom._styleFilter,b;b=m[u];u++)(b=b[c])&&(h=b(o,h));return h},r.string=r.string||{},r.string.toCamelCase=function(o){return o.indexOf("-")<0&&o.indexOf("_")<0?o:o.replace(/[-_][^-_]/g,function(h){return h.charAt(1).toUpperCase()})},r.dom.getStyle=function(o,h){var c=r.dom;o=c.g(o),h=r.string.toCamelCase(h);var u=o.style[h]||(o.currentStyle?o.currentStyle[h]:"")||c.getComputedStyle(o,h);if(!u){var m=c._styleFixer[h];m&&(u=m.get?m.get(o):r.dom.getStyle(o,m))}return(m=c._styleFilter)&&(u=m.filter(h,u,"get")),u},r.getStyle=r.dom.getStyle,/opera\/(\d+\.\d)/i.test(navigator.userAgent)&&(r.browser.opera=+RegExp.$1),r.browser.isWebkit=/webkit/i.test(navigator.userAgent),r.browser.isGecko=/gecko/i.test(navigator.userAgent)&&!/like gecko/i.test(navigator.userAgent),r.browser.isStrict=document.compatMode=="CSS1Compat",r.dom.getPosition=function(o){o=r.dom.g(o);var h=r.dom.getDocument(o),c=r.browser,u=r.dom.getStyle;c.isGecko>0&&h.getBoxObjectFor&&u(o,"position")=="absolute"&&(o.style.top===""||o.style.left);var m={left:0,top:0},b=c.ie&&!c.isStrict?h.body:h.documentElement,C,T;if(o==b)return m;if(o.getBoundingClientRect){T=o.getBoundingClientRect(),m.left=Math.floor(T.left)+Math.max(h.documentElement.scrollLeft,h.body.scrollLeft),m.top=Math.floor(T.top)+Math.max(h.documentElement.scrollTop,h.body.scrollTop),m.left-=h.documentElement.clientLeft,m.top-=h.documentElement.clientTop;var f=h.body,y=parseInt(u(f,"borderLeftWidth")),M=parseInt(u(f,"borderTopWidth"));c.ie&&!c.isStrict&&(m.left-=isNaN(y)?2:y,m.top-=isNaN(M)?2:M)}else{C=o;do{if(m.left+=C.offsetLeft,m.top+=C.offsetTop,c.isWebkit>0&&u(C,"position")=="fixed"){m.left+=h.body.scrollLeft,m.top+=h.body.scrollTop;break}C=C.offsetParent}while(C&&C!=o);for((c.opera>0||c.isWebkit>0&&u(o,"position")=="absolute")&&(m.top-=h.body.offsetTop),C=o.offsetParent;C&&C!=h.body;)m.left-=C.scrollLeft,(!c.opera||C.tagName!="TR")&&(m.top-=C.scrollTop),C=C.offsetParent}return m},r.event=r.event||{},r.event._listeners=r.event._listeners||[],r.event.on=function(o,h,c){h=h.replace(/^on/i,""),o=r.dom._g(o);var u=function(f){c.call(o,f)},m=r.event._listeners,b=r.event._eventFilter,C,T=h;return h=h.toLowerCase(),b&&b[h]&&(C=b[h](o,h,u),T=C.type,u=C.listener),o.addEventListener?o.addEventListener(T,u,!1):o.attachEvent&&o.attachEvent("on"+T,u),m[m.length]=[o,h,c,u,T],o},r.on=r.event.on,function(){var o=n[r.guid];r.lang.guid=function(){return"TANGRAM__"+(o._counter++).toString(36)},o._counter=o._counter||1}(),n[r.guid]._instances=n[r.guid]._instances||{},r.lang.isFunction=function(o){return Object.prototype.toString.call(o)=="[object Function]"},r.lang.Class=function(o){this.guid=o||r.lang.guid(),n[r.guid]._instances[this.guid]=this},n[r.guid]._instances=n[r.guid]._instances||{},r.lang.Class.prototype.dispose=function(){delete n[r.guid]._instances[this.guid];for(var o in this)r.lang.isFunction(this[o])||delete this[o];this.disposed=!0},r.lang.Class.prototype.toString=function(){return"[object "+(this._className||"Object")+"]"},r.lang.Event=function(o,h){this.type=o,this.returnValue=!0,this.target=h||null,this.currentTarget=null},r.lang.Class.prototype.addEventListener=function(o,h,c){if(r.lang.isFunction(h)){!this.__listeners&&(this.__listeners={});var u=this.__listeners,m;if(typeof c=="string"&&c){if(/[^\w\-]/.test(c))throw"nonstandard key:"+c;h.hashCode=c,m=c}o.indexOf("on")!=0&&(o="on"+o),typeof u[o]!="object"&&(u[o]={}),m=m||r.lang.guid(),h.hashCode=m,u[o][m]=h}},r.lang.Class.prototype.removeEventListener=function(o,h){if(!(typeof h<"u"&&(r.lang.isFunction(h)&&!(h=h.hashCode)||!r.lang.isString(h)))){!this.__listeners&&(this.__listeners={}),o.indexOf("on")!=0&&(o="on"+o);var c=this.__listeners;if(c[o])if(typeof h<"u")c[o][h]&&delete c[o][h];else for(var u in c[o])delete c[o][u]}},r.lang.Class.prototype.dispatchEvent=function(o,h){r.lang.isString(o)&&(o=new r.lang.Event(o)),!this.__listeners&&(this.__listeners={}),h=h||{};for(var c in h)o[c]=h[c];var c,u=this.__listeners,m=o.type;if(o.target=o.target||this,o.currentTarget=this,m.indexOf("on")!=0&&(m="on"+m),r.lang.isFunction(this[m])&&this[m].apply(this,arguments),typeof u[m]=="object")for(c in u[m])u[m][c].apply(this,arguments);return o.returnValue},r.lang.inherits=function(o,h,c){var u,m,b=o.prototype,C=new Function;C.prototype=h.prototype,m=o.prototype=new C;for(u in b)m[u]=b[u];o.prototype.constructor=o,o.superClass=h.prototype,typeof c=="string"&&(m._className=c)},r.inherits=r.lang.inherits;var s="http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m",l="png",d=function(o,h,c){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}t.lang.inherits(d,BMap.Overlay,"TextIconOverlay"),this._position=o,this._text=h,this._options=c||{},this._styles=this._options.styles||[],this._zIndex=this._options.zIndex,!this._styles.length&&this._setupDefaultStyles()};return d.prototype._setupDefaultStyles=function(){for(var o=[53,56,66,78,90],h=0,c;c=o[h];h++)this._styles.push({url:s+h+"."+l,size:new BMap.Size(c,c)})},d.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},d.prototype.draw=function(){this._map&&this._updatePosition()},d.prototype.getText=function(){return this._text},d.prototype.setText=function(o){o&&(!this._text||this._text.toString()!=o.toString())&&(this._text=o,this._updateText(),this._updateCss(),this._updatePosition())},d.prototype.getPosition=function(){return this._position},d.prototype.setPosition=function(o){o&&(!this._position||!this._position.equals(o))&&(this._position=o,this._updatePosition())},d.prototype.getStyleByText=function(o,h){var c=parseInt(o),u=parseInt(c/10);return u=Math.max(0,u),u=Math.min(u,h.length-1),h[u]},d.prototype._updateCss=function(){if(this._domElement){var o=this.getStyleByText(this._text,this._styles);this._domElement.style.cssText=this._buildCssText(o)}},d.prototype._updateText=function(){this._domElement&&(this._domElement.innerHTML=this._text)},d.prototype._updatePosition=function(){if(this._domElement&&this._position){var o=this._domElement.style,h=this._map.pointToOverlayPixel(this._position);h.x-=Math.ceil(parseInt(o.width)/2),h.y-=Math.ceil(parseInt(o.height)/2),o.left=h.x+"px",o.top=h.y+"px"}},d.prototype._buildCssText=function(o){var h=o.url,c=o.size,u=o.anchor,m=o.offset,b=o.textColor||"black",C=o.textSize||10,T=[];if(this._zIndex&&T.push("z-index:"+this._zIndex+";"),t.browser.ie<7)T.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="'+h+'");');else{T.push("background-image:url("+h+");");var f="0 0";m instanceof BMap.Size&&(f=m.width+"px "+m.height+"px"),T.push("background-position:"+f+";")}return c instanceof BMap.Size&&(u instanceof BMap.Size?(u.height>0&&u.height<c.height&&T.push("height:"+(c.height-u.height)+"px; padding-top:"+u.height+"px;"),u.width>0&&u.width<c.width&&T.push("width:"+(c.width-u.width)+"px; padding-left:"+u.width+"px;")):(T.push("height:"+c.height+"px; line-height:"+c.height+"px;"),T.push("width:"+c.width+"px; text-align:center;"))),T.push("cursor:pointer; color:"+b+"; position:absolute; font-size:"+C+"px; font-family:Arial,sans-serif; font-weight:bold"),T.join("")},d.prototype._bind=function(){if(!this._domElement)return;var o=this,h=this._map,c=t.lang.Event;function u(m,b){var C=m.srcElement||m.target,T=m.clientX||m.pageX,f=m.clientY||m.pageY;if(m&&b&&T&&f&&C){var y=t.dom.getPosition(h.getContainer());b.pixel=new BMap.Pixel(T-y.left,f-y.top),b.point=h.pixelToPoint(b.pixel)}return b}t.event.on(this._domElement,"mouseover",function(m){o.dispatchEvent(u(m,new c("onmouseover")))}),t.event.on(this._domElement,"mouseout",function(m){o.dispatchEvent(u(m,new c("onmouseout")))}),t.event.on(this._domElement,"click",function(m){o.dispatchEvent(u(m,new c("onclick")))})},d})})(Gt);var Fr=Gt.exports;const Zt=Ye(Fr);var Wt=function(i,e,t){e=Ur(e);var r=i.pointToPixel(e.getNorthEast()),n=i.pointToPixel(e.getSouthWest());r.x+=t,r.y-=t,n.x-=t,n.y+=t;var s=i.pixelToPoint(r),l=i.pixelToPoint(n);return new BMap.Bounds(l,s)},Ur=function(i){var e=Le(i.getNorthEast().lng,-180,180),t=Le(i.getSouthWest().lng,-180,180),r=Le(i.getNorthEast().lat,-74,74),n=Le(i.getSouthWest().lat,-74,74);return new BMap.Bounds(new BMap.Point(t,n),new BMap.Point(e,r))},Le=function(i,e,t){return e&&(i=Math.max(i,e)),t&&(i=Math.min(i,t)),i},jt=function(i){return Object.prototype.toString.call(i)==="[object Array]"},Vt=function(i,e){var t=-1;if(jt(e)){if(e.indexOf)t=e.indexOf(i);else for(var r=0,n;n=e[r];r++)if(n===i){t=r;break}}return t},O=function(i,e){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}if(i){this._map=i,this._markers=[],this._clusters=[];var t=e||{};this._zIndex=t.zIndex,this._gridSize=t.gridSize||60,this._maxZoom=t.maxZoom||18,this._minClusterSize=t.minClusterSize||2,this._isAverageCenter=!1,t.isAverageCenter!=null&&(this._isAverageCenter=t.isAverageCenter),this._styles=t.styles||[];var r=this;this._map.addEventListener("zoomend",function(){r._redraw()}),this._map.addEventListener("moveend",function(){r._redraw()});var n=t.markers;jt(n)&&this.addMarkers(n)}};O.prototype.addMarkers=function(i){if(i.length){for(var e=0,t=i.length;e<t;e++)this._pushMarkerTo(i[e]);this._createClusters()}},O.prototype._pushMarkerTo=function(i){var e=Vt(i,this._markers);e===-1&&(i.isInCluster=!1,this._markers.push(i))},O.prototype.addMarker=function(i){this._pushMarkerTo(i),this._createClusters()},O.prototype._createClusters=function(){var i=this._map.getBounds();if(i.getCenter()){for(var e=Wt(this._map,i,this._gridSize),t=0,r;r=this._markers[t];t++)!r.isInCluster&&e.containsPoint(r.getPosition())&&this._addToClosestCluster(r);for(var n=this._markers.length,t=0;t<n;t++)this._clusters[t]&&this._clusters[t].render()}},O.prototype._addToClosestCluster=function(i){var e=4e6,t=null;i.getPosition();for(var r=0,n;n=this._clusters[r];r++){var s=n.getCenter();if(s){var l=this._map.getDistance(s,i.getPosition());l<e&&(e=l,t=n)}}if(t&&t.isMarkerInClusterBounds(i))t.addMarker(i);else{var n=new A(this);n.addMarker(i),this._clusters.push(n)}},O.prototype._clearLastClusters=function(){for(var i=0,e;e=this._clusters[i];i++)e.remove();this._clusters=[],this._removeMarkersFromCluster()},O.prototype._removeMarkersFromCluster=function(){for(var i=0,e;e=this._markers[i];i++)e.isInCluster=!1},O.prototype._removeMarkersFromMap=function(){for(var i=0,e;e=this._markers[i];i++){e.isInCluster=!1;var t=e.getLabel();this._map.removeOverlay(e),e.setLabel(t)}},O.prototype._removeMarker=function(i){var e=Vt(i,this._markers);return e===-1?!1:(this._map.removeOverlay(i),this._markers.splice(e,1),!0)},O.prototype.removeMarker=function(i){var e=this._removeMarker(i);return e&&(this._clearLastClusters(),this._createClusters()),e},O.prototype.removeMarkers=function(i){for(var e=!1,t=0;t<i.length;t++){var r=this._removeMarker(i[t]);e=e||r}return e&&(this._clearLastClusters(),this._createClusters()),e},O.prototype.clearMarkers=function(){this._clearLastClusters(),this._removeMarkersFromMap(),this._markers=[]},O.prototype._redraw=function(){this._clearLastClusters(),this._createClusters()},O.prototype.getGridSize=function(){return this._gridSize},O.prototype.setGridSize=function(i){this._gridSize=i,this._redraw()},O.prototype.getMaxZoom=function(){return this._maxZoom},O.prototype.setMaxZoom=function(i){this._maxZoom=i,this._redraw()},O.prototype.getZIndex=function(){return this._zIndex},O.prototype.setZIndex=function(i){this._zIndex!=i&&(this.zIndex=i,this._redraw())},O.prototype.getStyles=function(){return this._styles},O.prototype.setStyles=function(i){this._styles=i,this._redraw()},O.prototype.getMinClusterSize=function(){return this._minClusterSize},O.prototype.setMinClusterSize=function(i){this._minClusterSize=i,this._redraw()},O.prototype.isAverageCenter=function(){return this._isAverageCenter},O.prototype.getMap=function(){return this._map},O.prototype.getMarkers=function(){return this._markers},O.prototype.getClustersCount=function(){for(var i=0,e=0,t;t=this._clusters[e];e++)t.isReal()&&i++;return i},O.prototype._textCalculator=function(i){return i.length.toString()},O.prototype._stylesIndexCalculator=null,O.prototype.setTextCalculator=function(i){this._textCalculator=i},O.prototype.setStylesIndexCalculator=function(i){this._stylesIndexCalculator=i};function A(i){var e=this;this._markerClusterer=i,this._map=i.getMap(),this._minClusterSize=i.getMinClusterSize(),this._isAverageCenter=i.isAverageCenter(),this._center=null,this._markers=[],this._gridBounds=null,this._isReal=!1,this._clusterMarker=new Zt(this._center,this._markers.length,{styles:this._markerClusterer.getStyles(),zIndex:i._zIndex}),this._clusterMarker.getStyleByText=function(t,r){if(e._markerClusterer._stylesIndexCalculator){var n=e._markerClusterer._stylesIndexCalculator(e._markers,r.length);return r[n]}return Zt.prototype.getStyleByText.call(this,t,r)},this._clusterMarker.addEventListener&&this._clusterMarker.addEventListener("click",function(t){e._map.setViewport(e.getBounds())})}A.prototype.addMarker=function(i){if(this.isMarkerInCluster(i))return!1;if(!this._center)this._center=i.getPosition(),this.updateGridBounds();else if(this._isAverageCenter){var e=this._markers.length+1,t=(this._center.lat*(e-1)+i.getPosition().lat)/e,r=(this._center.lng*(e-1)+i.getPosition().lng)/e;this._center=new BMap.Point(r,t),this.updateGridBounds()}return i.isInCluster=!0,this._markers.push(i),!0},A.prototype.render=function(){var i=this._markers.length;if(i<this._minClusterSize)for(var e=0;e<i;e++)this._map.addOverlay(this._markers[e]);else this._map.addOverlay(this._clusterMarker),this._isReal=!0,this.updateClusterMarker()},A.prototype.isMarkerInCluster=function(i){if(this._markers.indexOf)return this._markers.indexOf(i)!=-1;for(var e=0,t;t=this._markers[e];e++)if(t===i)return!0;return!1},A.prototype.isMarkerInClusterBounds=function(i){return this._gridBounds.containsPoint(i.getPosition())},A.prototype.isReal=function(i){return this._isReal},A.prototype.updateGridBounds=function(){var i=new BMap.Bounds(this._center,this._center);this._gridBounds=Wt(this._map,i,this._markerClusterer.getGridSize())},A.prototype.updateClusterMarker=function(){if(this._map.getZoom()>this._markerClusterer.getMaxZoom()){this._clusterMarker&&this._map.removeOverlay(this._clusterMarker);for(var i=0,e;e=this._markers[i];i++)this._map.addOverlay(e);return}if(this._markers.length<this._minClusterSize){this._clusterMarker.hide();return}this._clusterMarker.setPosition(this._center),this._clusterMarker.setText(this._markerClusterer._textCalculator(this._markers))},A.prototype.remove=function(){for(var i=0,e;e=this._markers[i];i++){var t=this._markers[i].getLabel();this._markers[i].getMap()&&this._map.removeOverlay(this._markers[i]),this._markers[i].setLabel(t)}this._map.removeOverlay(this._clusterMarker),this._markers.length=0,delete this._markers},A.prototype.getBounds=function(){for(var i=new BMap.Bounds(this._center,this._center),e=0,t;t=this._markers[e];e++)i.extend(t.getPosition());return i},A.prototype.getCenter=function(){return this._center};var Ie;(i=>{function e(r){return{url:r.url,size:new BMap.Size(r.size.width,r.size.height),anchor:r.anchor&&new BMap.Size(r.anchor.x,r.anchor.y),offset:r.offset&&new BMap.Size(r.offset.x,r.offset.y),textColor:r.textColor,textSize:r.textSize}}i.toBaidu=e;function t(r){return{url:r.url,width:r.size.width,height:r.size.height,anchor:r.anchor&&[r.anchor.y,r.anchor.x],backgroundPosition:r.offset&&`${r.offset.x} ${r.offset.y}`,textColor:r.textColor,textSize:r.textSize}}i.toGoogle=t})(Ie||(Ie={}));class st{constructor(e){p(this,"inner");this.map=e}clearMarkers(){this.inner.clearMarkers()}addMarker(e){this.inner.addMarker(e.innerOverlay)}removeMarker(e){return this.inner.removeMarker(e.innerOverlay)}addMarkers(e){this.inner.addMarkers(e.map(t=>t.innerOverlay))}removeMarkers(e){return this.inner.removeMarkers(e.map(t=>t.innerOverlay))}}class Ht extends st{constructor(e,t){var n;super(e),this.inner=new O(e.innerMap,{gridSize:t.gridSize,maxZoom:t.maxZoom,minClusterSize:t.minClusterSize,isAverageCenter:t.averageCenter,styles:(n=t.styles)==null?void 0:n.map(s=>Ie.toBaidu(s)),zIndex:t.zIndex});const r=t.stylesIndexCalculator;r&&this.inner.setStylesIndexCalculator((s,l)=>r(s.length,l)),t.markers&&this.addMarkers(t.markers)}recreate(){this.inner._redraw()}}class Ft extends st{constructor(e,t){var n,s;super(e),this.inner=new Vr(e.innerMap,(n=t.markers)==null?void 0:n.map(l=>l.innerOverlay),{gridSize:t.gridSize,maxZoom:t.maxZoom,minimumClusterSize:t.minClusterSize,averageCenter:t.averageCenter,styles:(s=t.styles)==null?void 0:s.map(l=>Ie.toGoogle(l)),zIndex:t.zIndex});const r=t.stylesIndexCalculator;r&&this.inner.setCalculator((l,d)=>({text:l.length,index:r(l.length,d)+1}))}recreate(){this.inner.repaint()}}class ot{constructor(){}}class Ut extends ot{constructor(t,r){super();p(this,"inner");this.map=t,this.inner=new google.maps.places.PlacesService(t.innerMap)}search(t,r){return this.searchImpl(t,r instanceof v?r.toGoogle(this.map.coordType):r??this.map.innerMap.getCenter())}searchInBounds(t,r){return this.searchImpl(t,r.toGoogle(this.map.coordType))}searchNearBy(t,r,n){return this.searchImpl(t,{center:r.toGoogle(this.map.coordType),radius:n})}searchImpl(t,r){return new Promise((n,s)=>{this.inner.findPlaceFromQuery({query:t,fields:["formatted_address","geometry","name","place_id"],locationBias:r},(l,d)=>{switch(d){case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:case google.maps.places.PlacesServiceStatus.OK:{const o=(l??[]).map(h=>Rt(h,this.map));n(o);break}default:s(new Error(`status: ${d}`));break}})})}}class Yt extends ot{constructor(t,r){super();p(this,"searchRequestMap",new Map);p(this,"currentSearch");this.map=t}get inner(){return this.currentSearch}search(t,r){return this.newSearch(r instanceof v?r.toBaidu(this.map.coordType):r??this.map.innerMap.getCenter(),n=>{n.search(t)})}searchInBounds(t,r){return this.newSearch(void 0,n=>{n.searchInBounds(t,r.toBaidu(this.map.coordType))})}searchNearBy(t,r,n){return this.newSearch(void 0,s=>{s.searchNearby(t,r.toBaidu(this.map.coordType),n)})}newSearch(t,r){return new Promise((n,s)=>{const l=new BMap.LocalSearch(t??this.map.innerMap,{onSearchComplete:d=>{Array.isArray(d)&&Ke("当前只支持一次搜索一条数据");const o=l.getStatus();switch(o){case BMAP_STATUS_SUCCESS:{const h=[];for(let c=0;c<d.getCurrentNumPois();c++){const u=d.getPoi(c);h.push({id:u.uid,city:u.city,country:"",position:v.fromBaidu(u.point,this.map.coordType),province:u.province,title:u.title,address:u.address})}n(h);break}case BMAP_STATUS_UNKNOWN_LOCATION:n([]);break;default:s(new Error(`status: ${o}`));break}}});r(l)})}}class at{constructor(e,t){p(this,"onData");p(this,"onError");this.map=e,this.input=t}setSearchListener(e,t){return this.onData&&E("setSearchListener只能调用一次"),this.onData=e,this.onError=t,Q}}class Kt extends at{constructor(t,r){super(t,r.input);p(this,"searchBox");this.searchBox=new google.maps.places.SearchBox(r.input),this.searchBox.bindTo("bounds",t.innerMap)}setSearchListener(t,r){return super.setSearchListener(t,r),kt(this.searchBox,"places_changed",()=>{const n=this.searchBox.getPlaces();t((n??[]).map(s=>Rt(s,this.map)))})}search(){this.input.value&&(google.maps.event.trigger(this.input,"focus",{}),google.maps.event.trigger(this.input,"keydown",{keyCode:13}))}}class qt extends at{constructor(t,r){super(t,r.input);p(this,"autocomplete");p(this,"placeService");this.autocomplete=t.createAutocomplete({input:r.input,bindToMap:!0}),this.placeService=t.createPlaceService({})}setSearchListener(t,r){return super.setSearchListener(t,r),this.autocomplete.addResultListener(n=>{this.searchImpl(n.country+n.province+n.city+n.district+n.street+n.streetNumber+n.title)})}search(){this.input.value&&this.searchImpl(this.input.value)}searchImpl(t){this.placeService.search(t).then(this.onData,this.onError)}}var Xt=(i=>(i[i.WORLD=1]="WORLD",i[i.STATE=5]="STATE",i[i.CITY=10]="CITY",i[i.STREET=15]="STREET",i[i.BUILDING=20]="BUILDING",i))(Xt||{});class Se{constructor(e){p(this,"latestInfoWindow");p(this,"delegate",void 0);this.element=e,process.env.NODE_ENV!=="production"&&setTimeout(()=>{this.delegate||console.warn(`${this.constructor.name}继承了AbstractMap, 但未调用setEventTargetDelegate(delegate)`)})}setEventTargetDelegate(e){this.delegate=e.setTarget(this)}addEventListener(e,t){this.delegate.addEventListener(e,t)}removeEventListener(e,t){this.delegate.removeEventListener(e,t)}getLatestInfoWindow(){return this.latestInfoWindow}setLatestInfoWindowInternal(e){this.latestInfoWindow=e}addOverlayMapType(e){this.addLayer(e)}removeOverlayMapType(e){this.removeLayer(e)}addControl(e){e.addTo(this)}removeControl(e){e.removeFrom(this)}getZoom(){return this.innerMap.getZoom()??0}setZoom(e){this.innerMap.setZoom(e)}}/*!
3
3
  * isobject <https://github.com/jonschlinkert/isobject>
4
4
  *