tg-map-vue3 3.1.7 → 3.1.8

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]>div>img{display:none}.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: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)}})();
2
2
  (function(a,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],p):(a=typeof globalThis<"u"?globalThis:a||self,p(a.TgMap={},a.Vue))})(this,function(a,p){"use strict";var Di=Object.defineProperty;var ji=(a,p,k)=>p in a?Di(a,p,{enumerable:!0,configurable:!0,writable:!0,value:k}):a[p]=k;var u=(a,p,k)=>(ji(a,typeof p!="symbol"?p+"":p,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 rr=1;function ir(){return rr++}function fe(i,e){return e.__id__||(e.__id__=ir()),`${i}::${e.__id__}`}var vt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},W={},nr={get exports(){return W},set exports(i){W=i}};(function(i){(function(e,t){i.exports?i.exports=t():e.coordtransform=t()})(vt,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,L=Math.sqrt(M*M+w*w)-2e-5*Math.sin(w*e),P=Math.atan2(w,M)-3e-6*Math.cos(M*e),K=L*Math.cos(P),oe=L*Math.sin(P);return[K,oe]}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),L=M*Math.cos(w)+.0065,P=M*Math.sin(w)+.006;return[L,P]}function m(f,y){return o(f,y)?T(f,y):[f,y]}function g(f,y){if(!o(f,y))return[f,y];var M=T(f,y);return[f*2-M[0],y*2-M[1]]}function T(f,y){var M=C(f-105,y-35),w=b(f-105,y-35),L=y/180*t,P=Math.sin(L);P=1-n*P*P;var K=Math.sqrt(P);M=M*180/(r*(1-n)/(P*K)*t),w=w*180/(r/K*Math.cos(L)*t);var oe=y+M,ft=f+w;return[ft,oe]}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 b(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:m,gcj02towgs84:g,bd09ToGcj02:h,gcj02ToBd09:c,wgs84ToGcj02:m,gcj02ToWgs84:g,bd09ToWgs84:function(f,y){if(!o(f,y))return[f,y];var M=h(f,y);return g(M[0],M[1])},wgs84ToBd09:function(f,y){if(!o(f,y))return[f,y];var M=m(f,y);return c(M[0],M[1])}}})})(nr);function X(i,e){if(!i)throw new Error(`AssertionError: ${e}`)}function He(i){throw new Error(`Unexpected object: ${i}`)}function E(i){throw new Error(i)}function Fe(i){throw new Error(`Unsupported: ${i}`)}function sr(i){throw new Error(`todo: ${i}`)}function or(i){return i}function ae(...i){}function ar(i){return i!=null}var F=(i=>(i.wgs84="wgs84",i.gcj02="gcj02",i.bd09="bd09",i))(F||{});const Ue="wgs84",G=class{constructor(e,t,r){this.lat=e,this.lng=t,this.coord=r}static fromBaidu(e,t){return new G(e.lat,e.lng,t)}static fromGoogle(e,t){return new G(e.lat(),e.lng(),t)}static fromHere(e,t){return new G(e.lat,e.lng,t)}static fromLiteral(e){return new G(e.lat,e.lng,e.coord||Ue)}static fromLngLat(e,t,r=Ue){return new G(t,e,r)}static create(e,t,r=Ue){return new G(e,t,r)}to(e){if(this.coord===e)return this;const[t,r]=this.convert(e);return new G(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"?W.bd09ToGcj02(this.lng,this.lat):W.bd09ToWgs84(this.lng,this.lat);case"gcj02":return e==="wgs84"?W.gcj02ToWgs84(this.lng,this.lat):W.gcj02ToBd09(this.lng,this.lat);case"wgs84":return e==="bd09"?W.wgs84ToBd09(this.lng,this.lat):W.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 _=G;u(_,"ZERO",G.create(0,0));const q=class{constructor(e,t){u(this,"coord");this.sw=e,this.ne=t,X(e.coord===t.coord,"sw和ne的coord应该相同"),X(Number.isFinite(e.lat)&&Number.isFinite(e.lng)&&Number.isFinite(t.lat)&&Number.isFinite(t.lng),`sw(${e})和ne(${t})不能包含NaN或Infinite`),X(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(_.fromGoogle(e.getSouthWest(),t),_.fromGoogle(e.getNorthEast(),t))}static fromBaidu(e,t){return new q(_.fromBaidu(e.getSouthWest(),t),_.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 _.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 Z=q;u(Z,"EMPTY",new q(_.ZERO,_.ZERO)),(i=>{class e{constructor(r){u(this,"coord");u(this,"minLat");u(this,"minLng");u(this,"maxLat");u(this,"maxLng");this.coord=r.coord,this.minLat=this.maxLat=r.lat,this.minLng=this.maxLng=r.lng}build(){return new i(_.create(this.minLat,this.minLng,this.coord),_.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})(Z||(Z={}));var lr=function(e){return hr(e)&&!cr(e)};function hr(i){return!!i&&typeof i=="object"}function cr(i){var e=Object.prototype.toString.call(i);return e==="[object RegExp]"||e==="[object Date]"||pr(i)}var dr=typeof Symbol=="function"&&Symbol.for,ur=dr?Symbol.for("react.element"):60103;function pr(i){return i.$$typeof===ur}function gr(i){return Array.isArray(i)?[]:{}}function le(i,e){return e.clone!==!1&&e.isMergeableObject(i)?J(gr(i),i,e):i}function mr(i,e,t){return i.concat(e).map(function(r){return le(r,t)})}function fr(i,e){if(!e.customMerge)return J;var t=e.customMerge(i);return typeof t=="function"?t:J}function yr(i){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(i).filter(function(e){return Object.propertyIsEnumerable.call(i,e)}):[]}function _t(i){return Object.keys(i).concat(yr(i))}function Mt(i,e){try{return e in i}catch{return!1}}function vr(i,e){return Mt(i,e)&&!(Object.hasOwnProperty.call(i,e)&&Object.propertyIsEnumerable.call(i,e))}function _r(i,e,t){var r={};return t.isMergeableObject(i)&&_t(i).forEach(function(n){r[n]=le(i[n],t)}),_t(e).forEach(function(n){vr(i,n)||(Mt(i,n)&&t.isMergeableObject(e[n])?r[n]=fr(n,t)(i[n],e[n],t):r[n]=le(e[n],t))}),r}function J(i,e,t){t=t||{},t.arrayMerge=t.arrayMerge||mr,t.isMergeableObject=t.isMergeableObject||lr,t.cloneUnlessOtherwiseSpecified=le;var r=Array.isArray(e),n=Array.isArray(i),s=r===n;return s?r?t.arrayMerge(i,e,t):_r(i,e,t):le(e,t)}J.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,n){return J(r,n,t)},{})};var Mr=J,bt=Mr;const ye=["3.0"],br={baidu:{version:"3.0",key:{}.VITE_APP_DEV_KEY_BAIDU},google:{version:"quarterly",key:{}.VITE_APP_DEV_KEY_GOOGLE,language:"en-us",libraries:["places"]},here:{version:ye[0],key:{}.VITE_APP_DEV_KEY_HERE}};let Tt;function Ye(){return Tt||E("请先安装: Vue<PartialTgMapConfig>.use(TgMap, {})")}function Ct(i){i!=null&&(Tt=bt(br,i))}var qe;(i=>{function e(t){return t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight}i.isScrollable=e})(qe||(qe={})),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 Tr(){}function ve(i){return i}function Cr(i,e){return i instanceof e}function Or(i,e){if(i instanceof e)return i}function Q(i,e){if((i==null?void 0:i.$options.name)===e.name)return i}function wr(i){return i}function Er(i,e,t){return i.addListener(e,t).remove}function Pr(i,e,t){return i.addEventListener(e,t),()=>i.removeEventListener(e,t)}class Ot{constructor(e,t){u(this,"eventMap",new Map);u(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 mt=class extends Ot{addEventListener(e,t){const r=fe(e,t);if(this.eventMap.get(r)){console.warn("listener已经添加过了",r,t);return}const n=this.inner.addListener(mt.EVENT_TYPE_MAP[e]||e,s=>{const l={type:e,target:this.target,originalEvent:s};s!=null&&s.latLng&&(l.position=_.fromGoogle(s.latLng,this.coordTypeSupplier.coordType)),t.call(this.target,l)});this.eventMap.set(r,n)}removeEventListener(e,t){const r=fe(e,t),n=this.eventMap.get(r);n?(n.remove(),this.eventMap.delete(r)):console.warn("移除失败, 不存在该listener",r,t)}};let U=mt;u(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 We=class extends Ot{addEventListener(e,t){const r=fe(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=_.fromBaidu(s.point,this.coordTypeSupplier.coordType)),t.call(this.target,l)};this.inner.addEventListener(We.EVENT_TYPE_MAP[e]||e,n),this.eventMap.set(r,n)}removeEventListener(e,t){const r=fe(e,t),n=this.eventMap.get(r);n?(this.inner.removeEventListener(We.EVENT_TYPE_MAP[e]||e,n),this.eventMap.delete(r)):console.warn("移除失败, 不存在该listener",r,t)}};let ee=We;u(ee,"EVENT_TYPE_MAP",{drag:"dragging",closeclick:"clickclose","zoom-changed":"zoomend","map-type-changed":"maptypechange"});class kr{constructor(){u(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 Ke{constructor(e,t){u(this,"keyToValue",new Map);u(this,"valueToKey",new Map);X(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 wt{constructor(e,t=10){u(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 Xe{constructor(e){u(this,"value");this.creator=e}get(){return this.value===void 0&&(this.value=this.creator()),this.value}}var B=(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))(B||{});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 Ke(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 Ke(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 Et{constructor(e){u(this,"inner");this.position=e}}class Je{}class _e extends Je{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 Me extends Je{constructor(t,r){super();u(this,"visible",!1);u(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 Pt=(i=>(i.normal="normal",i.satellite="satellite",i.hybrid="hybrid",i))(Pt||{});class S{constructor(e,t,r,n){this.id=e,this.baidu=t,this.google=r,this.googleCoordType=n}getId(){return this.id}getBaiduCoordType(){return F.bd09}asBaiduMapType(){return this.baidu()}getGoogleCoordType(){return this.googleCoordType}getGoogleMapTypeId(){return this.google()}asGoogleMapType(){Fe("google的内置地图没有对应的实例")}}class Ir{constructor(){u(this,"baiduCache",new Xe(()=>new BMap.TrafficLayer));u(this,"googleCache",new Xe(()=>new google.maps.TrafficLayer))}asBaiduLayer(){return this.baiduCache.get()}asGoogleLayer(){return this.googleCache.get()}}var x;(i=>{i.NORMAL=new S("normal",()=>BMAP_NORMAL_MAP,()=>google.maps.MapTypeId.ROADMAP,F.gcj02),i.SATELLITE=new S("satellite",()=>BMAP_SATELLITE_MAP,()=>google.maps.MapTypeId.SATELLITE,F.wgs84),i.HYBRID=new S("hybrid",()=>BMAP_HYBRID_MAP,()=>google.maps.MapTypeId.HYBRID,F.gcj02),i.TERRAIN=new S("terrain",()=>BMAP_PERSPECTIVE_MAP,()=>google.maps.MapTypeId.TERRAIN,F.wgs84),i.BUILD_IN_MAP_TYPES=new wt([i.NORMAL,i.SATELLITE,i.HYBRID,i.TERRAIN])})(x||(x={}));var Qe=(i=>(i.DEFAULT="default",i.HORIZONTAL="horizontal",i.DROPDOWN="dropdown",i))(Qe||{});const kt=[x.NORMAL,x.SATELLITE,x.HYBRID];class be extends _e{static create(e){const t=e.mapTypes??kt,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 be(n,e.position)}}const se=class extends Me{constructor(e="default",t=B.TOP_LEFT,r=kt){super("mapType",t),this.type=e,this.mapTypes=r,se.type2google||(se.type2google={default:google.maps.MapTypeControlStyle.DEFAULT,horizontal:google.maps.MapTypeControlStyle.HORIZONTAL_BAR,dropdown:google.maps.MapTypeControlStyle.DROPDOWN_MENU})}static create(e){return new se(e.type,e.position,e.mapTypes)}onCreateOptions(){const e=super.onCreateOptions();return e.style=se.type2google[this.type],e.mapTypeIds=this.mapTypes.map(t=>t instanceof S?t.getGoogleMapTypeId():t.id),e}addTo(e){super.addTo(e),this.mapTypes.forEach(t=>{t instanceof S||e.innerMap.mapTypes.set(t.id,t.asGoogleMapType())})}};let he=se;u(he,"type2google");class Te extends _e{static create(e){const t=new BMap.ScaleControl({anchor:e.position&&a.ControlPositionConverter.getBaidu().toValue(e.position)});return new Te(t,e.position)}}class Ce extends Me{static create(e){return new Ce(e.position)}constructor(e=B.BOTTOM_RIGHT){super("scale",e)}}class Oe extends _e{static create(e){const t=new BMap.NavigationControl({type:BMAP_NAVIGATION_CONTROL_ZOOM,anchor:e.position&&a.ControlPositionConverter.getBaidu().toValue(e.position)});return new Oe(t,e.position)}}class we extends Me{static create(e){return new we(e.position)}constructor(e=B.RIGHT_BOTTOM){super("zoom",e)}}function Lr(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]={}),m=c.maps||(c.maps={}),g=new Set,T=new URLSearchParams,C=()=>e||(e=new Promise(async(b,f)=>{var y;await(t=o.createElement("script")),T.set("libraries",[...g]+"");for(r in i)T.set(r.replace(/[A-Z]/g,M=>"_"+M[0].toLowerCase()),i[r]);T.set("callback",s+".maps."+d),t.src=`https://maps.${s}apis.com/maps/api/js?`+T,m[d]=b,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)}));m[l]?console.warn(n+" only loads once. Ignoring:",i):m[l]=(b,...f)=>g.add(b)&&C().then(()=>m[l](b,...f))}let It;const Y={get LATLNG_ZERO(){return It??(It=new google.maps.LatLng({lat:0,lng:0}))}};function Lt(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}class et{constructor(e){this.map=e}}class Bt extends et{constructor(t,r){super(t);u(this,"inner");this.inner=new google.maps.places.Autocomplete(r.input,{fields:["address_components","name"]}),r.bindToMap&&this.inner.bindTo("bounds",t.innerMap)}addResultListener(t){return Er(this.inner,"place_changed",()=>{const r=this.inner.getPlace(),n={title:r.name??"",province:"",city:"",district:"",street:"",streetNumber:"",country:""};X(r.address_components!=null,"要求服务器一定返回该字段"),Lt(r.address_components,n),t(n)})}}class St extends et{constructor(t,r){super(t);u(this,"inner");this.inner=new BMap.Autocomplete({input:r.input,location:r.bindToMap?t.innerMap:void 0})}addResultListener(t){return Pr(this.inner,"confirm",r=>{const n=r.item.value;t(Object.assign({title:n.business,country:""},n))})}}let Br=class tr{constructor(e,t,r){this.extend(tr,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 Sr(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)}},Sr=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 tt(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 tt{constructor(e,t,r){e.getMarkerClusterer().extend(tt,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 rt={},xr={get exports(){return rt},set exports(i){rt=i}};(function(i,e){(function(t,r){i.exports=r()})(vt,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),m;return c.defaultView&&c.defaultView.getComputedStyle&&(m=c.defaultView.getComputedStyle(o,null),m)?m[h]||m.getPropertyValue(h):""},r.dom._styleFixer=r.dom._styleFixer||{},r.dom._styleFilter=r.dom._styleFilter||[],r.dom._styleFilter.filter=function(o,h,c){for(var m=0,g=r.dom._styleFilter,T;T=g[m];m++)(T=T[c])&&(h=T(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 m=o.style[h]||(o.currentStyle?o.currentStyle[h]:"")||c.getComputedStyle(o,h);if(!m){var g=c._styleFixer[h];g&&(m=g.get?g.get(o):r.dom.getStyle(o,g))}return(g=c._styleFilter)&&(m=g.filter(h,m,"get")),m},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,m=r.dom.getStyle;c.isGecko>0&&h.getBoxObjectFor&&m(o,"position")=="absolute"&&(o.style.top===""||o.style.left);var g={left:0,top:0},T=c.ie&&!c.isStrict?h.body:h.documentElement,C,b;if(o==T)return g;if(o.getBoundingClientRect){b=o.getBoundingClientRect(),g.left=Math.floor(b.left)+Math.max(h.documentElement.scrollLeft,h.body.scrollLeft),g.top=Math.floor(b.top)+Math.max(h.documentElement.scrollTop,h.body.scrollTop),g.left-=h.documentElement.clientLeft,g.top-=h.documentElement.clientTop;var f=h.body,y=parseInt(m(f,"borderLeftWidth")),M=parseInt(m(f,"borderTopWidth"));c.ie&&!c.isStrict&&(g.left-=isNaN(y)?2:y,g.top-=isNaN(M)?2:M)}else{C=o;do{if(g.left+=C.offsetLeft,g.top+=C.offsetTop,c.isWebkit>0&&m(C,"position")=="fixed"){g.left+=h.body.scrollLeft,g.top+=h.body.scrollTop;break}C=C.offsetParent}while(C&&C!=o);for((c.opera>0||c.isWebkit>0&&m(o,"position")=="absolute")&&(g.top-=h.body.offsetTop),C=o.offsetParent;C&&C!=h.body;)g.left-=C.scrollLeft,(!c.opera||C.tagName!="TR")&&(g.top-=C.scrollTop),C=C.offsetParent}return g},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 m=function(f){c.call(o,f)},g=r.event._listeners,T=r.event._eventFilter,C,b=h;return h=h.toLowerCase(),T&&T[h]&&(C=T[h](o,h,m),b=C.type,m=C.listener),o.addEventListener?o.addEventListener(b,m,!1):o.attachEvent&&o.attachEvent("on"+b,m),g[g.length]=[o,h,c,m,b],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 m=this.__listeners,g;if(typeof c=="string"&&c){if(/[^\w\-]/.test(c))throw"nonstandard key:"+c;h.hashCode=c,g=c}o.indexOf("on")!=0&&(o="on"+o),typeof m[o]!="object"&&(m[o]={}),g=g||r.lang.guid(),h.hashCode=g,m[o][g]=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 m in c[o])delete c[o][m]}},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,m=this.__listeners,g=o.type;if(o.target=o.target||this,o.currentTarget=this,g.indexOf("on")!=0&&(g="on"+g),r.lang.isFunction(this[g])&&this[g].apply(this,arguments),typeof m[g]=="object")for(c in m[g])m[g][c].apply(this,arguments);return o.returnValue},r.lang.inherits=function(o,h,c){var m,g,T=o.prototype,C=new Function;C.prototype=h.prototype,g=o.prototype=new C;for(m in T)g[m]=T[m];o.prototype.constructor=o,o.superClass=h.prototype,typeof c=="string"&&(g._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),m=parseInt(c/10);return m=Math.max(0,m),m=Math.min(m,h.length-1),h[m]},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,m=o.anchor,g=o.offset,T=o.textColor||"black",C=o.textSize||10,b=[];if(this._zIndex&&b.push("z-index:"+this._zIndex+";"),t.browser.ie<7)b.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="'+h+'");');else{b.push("background-image:url("+h+");");var f="0 0";g instanceof BMap.Size&&(f=g.width+"px "+g.height+"px"),b.push("background-position:"+f+";")}return c instanceof BMap.Size&&(m instanceof BMap.Size?(m.height>0&&m.height<c.height&&b.push("height:"+(c.height-m.height)+"px; padding-top:"+m.height+"px;"),m.width>0&&m.width<c.width&&b.push("width:"+(c.width-m.width)+"px; padding-left:"+m.width+"px;")):(b.push("height:"+c.height+"px; line-height:"+c.height+"px;"),b.push("width:"+c.width+"px; text-align:center;"))),b.push("cursor:pointer; color:"+T+"; position:absolute; font-size:"+C+"px; font-family:Arial,sans-serif; font-weight:bold"),b.join("")},d.prototype._bind=function(){if(!this._domElement)return;var o=this,h=this._map,c=t.lang.Event;function m(g,T){var C=g.srcElement||g.target,b=g.clientX||g.pageX,f=g.clientY||g.pageY;if(g&&T&&b&&f&&C){var y=t.dom.getPosition(h.getContainer());T.pixel=new BMap.Pixel(b-y.left,f-y.top),T.point=h.pixelToPoint(T.pixel)}return T}t.event.on(this._domElement,"mouseover",function(g){o.dispatchEvent(m(g,new c("onmouseover")))}),t.event.on(this._domElement,"mouseout",function(g){o.dispatchEvent(m(g,new c("onmouseout")))}),t.event.on(this._domElement,"click",function(g){o.dispatchEvent(m(g,new c("onclick")))})},d})})(xr);const xt=rt;var At=function(i,e,t){e=Ar(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)},Ar=function(i){var e=Ee(i.getNorthEast().lng,-180,180),t=Ee(i.getSouthWest().lng,-180,180),r=Ee(i.getNorthEast().lat,-74,74),n=Ee(i.getSouthWest().lat,-74,74);return new BMap.Bounds(new BMap.Point(t,n),new BMap.Point(e,r))},Ee=function(i,e,t){return e&&(i=Math.max(i,e)),t&&(i=Math.min(i,t)),i},$t=function(i){return Object.prototype.toString.call(i)==="[object Array]"},zt=function(i,e){var t=-1;if($t(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;$t(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=zt(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=At(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=zt(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 xt(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 xt.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=At(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 Pe;(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})(Pe||(Pe={}));class it{constructor(e){u(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 Nt extends it{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=>Pe.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 Rt extends it{constructor(e,t){var n,s;super(e),this.inner=new Br(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=>Pe.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 nt{constructor(e){this.map=e}}class Gt extends nt{constructor(t,r){super(t);u(this,"inner");this.inner=new google.maps.places.PlacesService(t.innerMap)}search(t){return this.searchImpl(t)}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=>{var g;const c=h.address_components?Lt(h.address_components):null;return{country:(c==null?void 0:c.country)??"",province:(c==null?void 0:c.province)??"",city:(c==null?void 0:c.city)??"",id:h.place_id??"",address:h.formatted_address??"",position:_.fromGoogle(((g=h.geometry)==null?void 0:g.location)??Y.LATLNG_ZERO,this.map.coordType),title:h.name??""}});n(o);break}default:s(new Error(`status: ${d}`));break}})})}}class Zt extends nt{constructor(t,r){super(t);u(this,"searchRequestMap",new Map);u(this,"currentSearch")}get inner(){return this.currentSearch}search(t){return this.newSearch(r=>{r.search(t)})}searchInBounds(t,r){return this.newSearch(n=>{n.searchInBounds(t,r.toBaidu(this.map.coordType))})}searchNearBy(t,r,n){return this.newSearch(s=>{s.searchNearby(t,r.toBaidu(this.map.coordType),n)})}newSearch(t){return new Promise((r,n)=>{const s=new BMap.LocalSearch(this.map.innerMap,{onSearchComplete:l=>{Array.isArray(l)&&Fe("当前只支持一次搜索一条数据");const d=s.getStatus();switch(d){case BMAP_STATUS_SUCCESS:{const o=[];for(let h=0;h<l.getCurrentNumPois();h++){const c=l.getPoi(h);o.push({id:c.uid,city:c.city,country:"",position:_.fromBaidu(c.point,this.map.coordType),province:c.province,title:c.title,address:c.address})}r(o);break}default:n(new Error(`status: ${d}`));break}}});t(s)})}}class ke{constructor(e){u(this,"latestInfoWindow");u(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
  *