tg-map-vue3 3.8.7 → 3.9.0
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.
- package/CHANGELOG.md +1 -0
- package/README.md +8 -12
- package/dist/src/components/TgMap.vue.d.ts +33 -33
- package/dist/src/components/controls/TgCustomControl.vue.d.ts +1 -1
- package/dist/src/components/controls/TgMapTypeControl.vue.d.ts +6 -6
- package/dist/src/components/controls/TgScaleControl.vue.d.ts +3 -3
- package/dist/src/components/controls/TgStreetViewControl.vue.d.ts +3 -3
- package/dist/src/components/controls/TgZoomControl.vue.d.ts +3 -3
- package/dist/src/components/extra/TgHeatmap.vue.d.ts +2 -2
- package/dist/src/components/extra/TgMarkerClusterer.vue.d.ts +2 -2
- package/dist/src/components/index.d.ts +3 -5
- package/dist/src/components/overlays/TgCircle.vue.d.ts +12 -12
- package/dist/src/components/overlays/TgElementOverlay.vue.d.ts +4 -4
- package/dist/src/components/overlays/TgMarker.vue.d.ts +21 -21
- package/dist/src/components/overlays/TgPolygon.vue.d.ts +9 -9
- package/dist/src/components/overlays/TgPolyline.vue.d.ts +9 -9
- package/dist/src/components/overlays/TgRectangle.vue.d.ts +9 -9
- package/dist/src/map/lat-lng.d.ts +0 -3
- package/dist/src/map/map/controls/control.d.ts +0 -2
- package/dist/src/map/map/controls/map-type.control.d.ts +0 -1
- package/dist/src/map/map/controls/zoom.control.d.ts +0 -1
- package/dist/src/map/map/extra/autocomplete.d.ts +0 -1
- package/dist/src/map/map/extra/heatmap.d.ts +0 -1
- package/dist/src/map/map/extra/places-service.d.ts +0 -2
- package/dist/src/map/map/google-map.d.ts +0 -1
- package/dist/src/map/map/here-map.d.ts +0 -1
- package/dist/src/map/map/map-options.d.ts +0 -2
- package/dist/src/map/map/map-type.d.ts +0 -3
- package/dist/src/map/map/overlay/baidu-info-box.d.ts +1 -2
- package/dist/src/map/map/overlay/circle.d.ts +0 -2
- package/dist/src/map/map/overlay/element-overlay.d.ts +0 -2
- package/dist/src/map/map/overlay/google-label.d.ts +11 -12
- package/dist/src/map/map/overlay/icon.d.ts +0 -2
- package/dist/src/map/map/overlay/info-box.d.ts +1 -0
- package/dist/src/map/map/overlay/info-window.d.ts +1 -1
- package/dist/src/map/map/overlay/label.d.ts +0 -1
- package/dist/src/map/map/overlay/marker.d.ts +0 -1
- package/dist/src/map/map/overlay/polygon.d.ts +0 -2
- package/dist/src/map/map/overlay/polyline.d.ts +0 -3
- package/dist/src/map/map/overlay/rectangle.d.ts +0 -2
- package/dist/src/map/unions.d.ts +0 -5
- package/dist/src/utils/arrays.d.ts +1 -13
- package/dist/src/utils/baidu-utils.d.ts +14 -0
- package/dist/src/utils/google-utils.d.ts +0 -1
- package/dist/src/utils/mapped-types.d.ts +0 -7
- package/dist/src/utils/strings.d.ts +0 -5
- package/dist/src/utils/utils.d.ts +1 -8
- package/dist/tg-map.js +1482 -1295
- package/dist/tg-map.js.map +1 -1
- package/dist/tg-map.umd.cjs +7 -7
- package/dist/tg-map.umd.cjs.map +1 -1
- package/package.json +10 -5
- package/dist/src/utils/assert.d.ts +0 -9
package/dist/tg-map.umd.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var
|
|
2
|
-
(function(a,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],y):(a=typeof globalThis<"u"?globalThis:a||self,y(a.TgMap={},a.Vue))})(this,function(a,y){"use strict";var Vn=Object.defineProperty;var jn=(a,y,$)=>y in a?Vn(a,y,{enumerable:!0,configurable:!0,writable:!0,value:$}):a[y]=$;var f=(a,y,$)=>(jn(a,typeof y!="symbol"?y+"":y,$),$);function $(r,t,e){Object.keys(r).forEach(i=>{i.startsWith("update:")||e!=null&&e.includes(i)||t.addEventListener(i,r[i])})}let gr=1;function mr(){return gr++}function $e(r,t){return t.__id__||(t.__id__=mr()),`${r}::${t.__id__}`}var It=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ze(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Jt={exports:{}};(function(r){(function(t,e){r.exports?r.exports=e():t.coordtransform=e()})(It,function(){var t=52.35987755982988,e=3.141592653589793,i=6378245,n=.006693421622965943;function s(h,p,_,b){this.west=Math.min(h,_),this.north=Math.max(p,b),this.east=Math.max(h,_),this.south=Math.min(p,b)}s.prototype.contain=function(h,p){return this.west<=h&&this.east>=h&&this.north>=p&&this.south<=p};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)],o=[new s(114.505238,22.138258,113.845,22.428903),new s(113.97,22.507833,114.45,22.428903)];function c(h,p,_=!0){for(var b=0;b<l.length;b++)if(l[b].contain(h,p)){for(var E=0;E<d.length;E++)if(d[E].contain(h,p))return!1;if(_){for(var E=0;E<o.length;E++)if(o[E].contain(h,p))return!1}return!0}return!1}function u(h,p){var _=h-.0065,b=p-.006,E=Math.sqrt(_*_+b*b)-2e-5*Math.sin(b*t),P=Math.atan2(b,_)-3e-6*Math.cos(_*t),B=E*Math.cos(P),D=E*Math.sin(P);return[B,D]}function g(h,p){var _=Math.sqrt(h*h+p*p)+2e-5*Math.sin(p*t),b=Math.atan2(p,h)+3e-6*Math.cos(h*t),E=_*Math.cos(b)+.0065,P=_*Math.sin(b)+.006;return[E,P]}function m(h,p){return C(h,p)}function v(h,p){var _=C(h,p);return[h*2-_[0],p*2-_[1]]}function C(h,p){var _=M(h-105,p-35),b=O(h-105,p-35),E=p/180*e,P=Math.sin(E);P=1-n*P*P;var B=Math.sqrt(P);_=_*180/(i*(1-n)/(P*B)*e),b=b*180/(i/B*Math.cos(E)*e);var D=p+_,Z=h+b;return[Z,D]}function M(h,p){var _=-100+2*h+3*p+.2*p*p+.1*h*p+.2*Math.sqrt(Math.abs(h));return _+=(20*Math.sin(6*h*e)+20*Math.sin(2*h*e))*2/3,_+=(20*Math.sin(p*e)+40*Math.sin(p/3*e))*2/3,_+=(160*Math.sin(p/12*e)+320*Math.sin(p*e/30))*2/3,_}function O(h,p){var _=300+h+2*p+.1*h*h+.1*h*p+.1*Math.sqrt(Math.abs(h));return _+=(20*Math.sin(6*h*e)+20*Math.sin(2*h*e))*2/3,_+=(20*Math.sin(h*e)+40*Math.sin(h/3*e))*2/3,_+=(150*Math.sin(h/12*e)+300*Math.sin(h/30*e))*2/3,_}return{rawBd09ToGcj02:u,rawGcj02ToBd09:g,rawWgs84ToGcj02:m,rawGcj02ToWgs84:v,bd09ToGcj02:u,gcj02ToBd09:g,wgs84ToGcj02:function(h,p){return c(h,p)?m(h,p):[h,p]},gcj02ToWgs84:function(h,p){return c(h,p)?v(h,p):[h,p]},bd09ToWgs84:function(h,p){if(!c(h,p,!1))return[h,p];var _=u(h,p);return v(_[0],_[1])},wgs84ToBd09:function(h,p){if(!c(h,p,!1))return[h,p];var _=m(h,p);return g(_[0],_[1])}}})})(Jt);var fr=Jt.exports;const ae=ze(fr);a.Arrays=void 0,(r=>{function t(d,o){return d.length===o.length&&d.every((c,u)=>c===o[u])}r.equals=t;function e(d,o){const c=d.indexOf(o);if(c!==-1)return d.splice(c,1)[0]}r.remove=e;function i(d,o){for(const c of d)if(c instanceof o)return c}r.findByType=i;function n(d,o){return d.includes(o)}r.includesTyped=n;function s(d,o,c){const u=o>=0?o:d.length+o;if(c===void 0)return d[u];d[u]=c}r.at=s;function l(d){return d.length>0}r.isNotEmpty=l})(a.Arrays||(a.Arrays={})),a.MVCArrays=void 0,(r=>{function t(n,s){const l=n.getLength();for(let d=0;d<l;d++)if(n.getAt(d)===s)return d;return-1}r.indexOf=t;function e(n,s){const l=t(n,s);if(l!==-1)return n.removeAt(l)}r.remove=e;function i(n,s){return[n.addListener("insert_at",s),n.addListener("remove_at",s),n.addListener("set_at",s)]}r.listenChanged=i})(a.MVCArrays||(a.MVCArrays={}));function ne(r,t){if(!r)throw new Error(`AssertionError: ${t}`)}function Ge(r){throw new Error(`Unexpected object: ${r}`)}function yr(){}function Ne(r){return r}function vr(r,t){return r instanceof t}function _r(r,t){if(r instanceof t)return r}function Ze(r,t){return(r==null?void 0:r.$options.name)===t.name}function St(r,t){return Ze(r,t)?r:void 0}function We(r,t,e){let i=t;for(;i;){if(Ze(i,r))return i;if(e&&Ze(i,e))return;i=i.$parent}}function br(r){return r}function I(r){throw new Error(r)}function He(r){throw new Error(`Unsupported: ${r}`)}function Mr(r){throw new Error(`todo: ${r}`)}function Tr(r){return r}function le(...r){}function Cr(r){return r!=null}function Qt(r){return r[1]!=null}function ei(r){let t=null;return()=>t??(t=r().catch(e=>(t=null,Promise.reject(e))))}var R=(r=>(r.wgs84="wgs84",r.gcj02="gcj02",r.bd09="bd09",r))(R||{});const kt="wgs84",G=class G{constructor(t,e,i){this.lat=t,this.lng=e,this.coord=i}static _normalize(t,e){const i=e>90?90:e<-90?-90:e;return[t>180?(t+180)%360-180:t<-180?(t-180)%360+180:t,i]}static fromBaidu(t,e){return new G(t.lat,t.lng,e)}static fromGoogle(t,e){return new G(t.lat(),t.lng(),e)}static fromHere(t,e){return new G(t.lat,t.lng,e)}static fromLiteral(t){return new G(t.lat,t.lng,t.coord||kt)}static fromLngLat(t,e,i=kt){return new G(e,t,i)}static create(t,e,i=kt){return new G(t,e,i)}to(t){const e=t;if(this.coord===e)return this;const[i,n]=this._convert(e);return new G(n,i,e)}toBaidu(t,e=!1){let i=this.lat,n=this.lng;return this.coord!==t&&([n,i]=this._convert(t)),e&&([n,i]=G._normalize(n,i)),new BMap.Point(n,i)}toGoogle(t){let e=this.lat,i=this.lng;return this.coord!==t&&([i,e]=this._convert(t)),new google.maps.LatLng(e,i)}toHere(t){let e=this.lat,i=this.lng;return this.coord!==t&&([i,e]=this._convert(t)),new H.geo.Point(e,i)}_convert(t){switch(this.coord){case"bd09":return t==="gcj02"?ae.bd09ToGcj02(this.lng,this.lat):ae.bd09ToWgs84(this.lng,this.lat);case"gcj02":return t==="wgs84"?ae.gcj02ToWgs84(this.lng,this.lat):ae.gcj02ToBd09(this.lng,this.lat);case"wgs84":return t==="bd09"?ae.wgs84ToBd09(this.lng,this.lat):ae.wgs84ToGcj02(this.lng,this.lat)}throw new Error(`不支持的坐标转换: ${this.coord}=>${t}`)}normalize(){const[t,e]=G._normalize(this.lng,this.lat);return e===this.lat&&t===this.lng?this:new G(e,t,this.coord)}equals(t){return this===t?!0:this.lat===t.lat&&this.lng===t.lng&&this.coord===t.coord}toString(){return JSON.stringify(this)}};f(G,"ZERO",G.create(0,0));let w=G;const re=class re{constructor(t,e){f(this,"coord");this.sw=t,this.ne=e,ne(t.coord===e.coord,"sw和ne的coord应该相同"),ne(Number.isFinite(t.lat)&&Number.isFinite(t.lng)&&Number.isFinite(e.lat)&&Number.isFinite(e.lng),`sw(${t})和ne(${e})不能包含NaN或Infinite`),ne(t.lat<=e.lat,`sw.lat(${t.lat})应该比ne.lat(${e.lat})小`),this.coord=t.coord}static isBetweenLng(t,e,i){return t<=e?t<=i&&i<=e:t<=i||i<=e}static fromArray(t){if(t.length===0)return;const e=new re.Builder(t[0]);for(let i=1;i<t.length;i++)e.include(t[i]);return e.build()}static from(...t){return this.fromArray(t)??I("positions中没有点")}static fromGoogle(t,e){return new re(w.fromGoogle(t.getSouthWest(),e),w.fromGoogle(t.getNorthEast(),e))}static fromBaidu(t,e){return new re(w.fromBaidu(t.getSouthWest(),e),w.fromBaidu(t.getNorthEast(),e))}static create(t,e){return this.from(t,e)}isEmpty(){return this.sw.equals(this.ne)}contains(t){const{lat:e,lng:i}=t.to(this.coord);return this.sw.lat<=e&&e<=this.ne.lat&&re.isBetweenLng(this.sw.lng,this.ne.lng,i)}getCenter(){if(this.sw.equals(this.ne))return this.sw;const t=(this.sw.lat+this.ne.lat)/2,e=(this.sw.lng+this.ne.lng+(this.sw.lng<this.ne.lng?0:360))/2;return w.create(t,e,this.coord)}toString(){return JSON.stringify(this)}equals(t){return this.sw.equals(t.sw)&&this.ne.equals(t.ne)}toRectArray(){const t=this.sw.coord;return[this.sw,w.fromLngLat(this.sw.lng,this.ne.lat,t),this.ne,w.fromLngLat(this.ne.lng,this.sw.lat,t)]}toGoogle(t){return new google.maps.LatLngBounds(this.sw.toGoogle(t),this.ne.toGoogle(t))}toBaidu(t){return new BMap.Bounds(this.sw.toBaidu(t),this.ne.toBaidu(t))}toBaiduArray(t){return[this.sw.toBaidu(t),this.ne.toBaidu(t)]}};f(re,"EMPTY",new re(w.ZERO,w.ZERO));let j=re;(r=>{class t{constructor(i){f(this,"coord");f(this,"minLat");f(this,"minLng");f(this,"maxLat");f(this,"maxLng");this.coord=i.coord,this.minLat=this.maxLat=i.lat,this.minLng=this.maxLng=i.lng}build(){return new r(w.create(this.minLat,this.minLng,this.coord),w.create(this.maxLat,this.maxLng,this.coord))}include(i){const{lat:n,lng:s}=i.to(this.coord);return this.minLat=Math.min(this.minLat,n),this.maxLat=Math.max(this.maxLat,n),r.isBetweenLng(this.minLng,this.maxLng,s)||(this.delta(this.minLng,s)<this.delta(s,this.maxLng)?this.minLng=s:this.maxLng=s),this}delta(i,n){return(i-n+360)%360}}r.Builder=t})(j||(j={})),a.Location=void 0,(r=>{function t(i,n){if(i==null)return;if(typeof i=="string")return i;const s=i.to(n);return`${s.lat},${s.lng}`}r.toString=t;function e(i){return typeof i=="string"||i==null?void 0:i.coord}r.getCoordType=e})(a.Location||(a.Location={}));var xt;(r=>{function t(e){return e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight}r.isScrollable=t})(xt||(xt={}));function ti(r,t,e){return r.addListener(t,e).remove}function Or(r,t,e){return r.addEventListener(t,e),()=>r.removeEventListener(t,e)}function wr(r,t,e,i){return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}function ii(r,t,e){return r.addEventListener(t,e),()=>r.removeEventListener(t,e)}class ri{constructor(t,e){f(this,"eventMap",new Map);f(this,"target",void 0);this.inner=t,this.coordTypeSupplier=e,this.addEventListener=this.addEventListener.bind(this),this.removeEventListener=this.removeEventListener.bind(this)}setTarget(t){return this.target=t,this}}class Ve{constructor(t,e){f(this,"eventHub",new ni);this.delegate=t,this.options=e}notify(t){this.eventHub.notify(t)}hasListener(t){return this.eventHub.hasListener(t)}setTarget(t){return this.delegate.setTarget(t),this}addEventListener(t,e){if(a.Arrays.includesTyped(this.options.types,t)){this.eventHub.hasListener(t)||this.options.onListen(t),this.eventHub.addEventListener(t,e);return}this.delegate.addEventListener(t,e)}removeEventListener(t,e){if(a.Arrays.includesTyped(this.options.types,t)){this.eventHub.removeEventListener(t,e),this.eventHub.hasListener(t)||this.options.onCancel(t);return}this.delegate.removeEventListener(t,e)}}const Lt=class Lt extends ri{addEventListener(t,e){const i=$e(t,e);if(this.eventMap.get(i)){console.warn("listener已经添加过了",i,e);return}const n=this.inner.addListener(Lt.EVENT_TYPE_MAP[t]||t,s=>{const l={type:t,target:this.target,originalEvent:s};s!=null&&s.latLng&&(l.position=w.fromGoogle(s.latLng,this.coordTypeSupplier.coordType)),e.call(this.target,l)});this.eventMap.set(i,n)}removeEventListener(t,e){const i=$e(t,e),n=this.eventMap.get(i);n?(n.remove(),this.eventMap.delete(i)):console.warn("移除失败, 不存在该listener",i,e)}};f(Lt,"EVENT_TYPE_MAP",{"center-changed":"center_changed","zoom-changed":"zoom_changed","radius-changed":"radius_changed","bounds-changed":"bounds_changed","map-type-changed":"maptypeid_changed","map-mousedown":"mousedown","map-mousemove":"mousemove","map-mouseup":"mouseup","map-dblclick":"dblclick"});let he=Lt;const ke=class ke extends ri{addEventListener(t,e){const i=$e(t,e);if(this.eventMap.get(i)){console.warn("listener已经添加过了",i,e);return}const n=s=>{const l={type:t,target:this.target,originalEvent:s};s.point&&(l.position=w.fromBaidu(s.point,this.coordTypeSupplier.coordType)),e.call(this.target,l)};this.inner.addEventListener(ke.EVENT_TYPE_MAP[t]||t,n),this.eventMap.set(i,n)}removeEventListener(t,e){const i=$e(t,e),n=this.eventMap.get(i);n?(this.inner.removeEventListener(ke.EVENT_TYPE_MAP[t]||t,n),this.eventMap.delete(i)):console.warn("移除失败, 不存在该listener",i,e)}};f(ke,"EVENT_TYPE_MAP",{drag:"dragging",closeclick:"clickclose",contextmenu:"rightclick","zoom-changed":"zoomend","map-type-changed":"maptypechange"});let _e=ke;class ni{constructor(){f(this,"typeMap",new Map)}addEventListener(t,e){let i=this.typeMap.get(t);i||(i=[],this.typeMap.set(t,i)),!i.includes(e)&&i.push(e)}removeEventListener(t,e){const i=this.typeMap.get(t);i&&a.Arrays.remove(i,e)}hasListener(t){const e=this.typeMap.get(t);return e!=null&&e.length>0}notify(t){const e=this.typeMap.get(t.type);e&&e.forEach(i=>i.call(t.target,t))}}class At{constructor(t,e){f(this,"keyToValue",new Map);f(this,"valueToKey",new Map);ne(t.length===e.length);for(let i=t.length-1;i>=0;i--)this.keyToValue.set(t[i],e[i]),this.valueToKey.set(e[i],t[i])}toKey(t){return this.valueToKey.get(t)??I()}toValue(t){return this.keyToValue.get(t)??I()}}class si{constructor(t,e=10){f(this,"map",new Map);this.values=t,this.maxSize4Debug=e}getValueMap(t){let e=this.map.get(t);if(!e){e=new Map;for(let i=this.values.length-1;i>=0;i--){const n=this.values[i];e.set(t.call(n),n)}this.map.set(t,e),process.env.NODE_ENV!=="production"&&this.map.size>this.maxSize4Debug&&console.warn(`this.map的大小(${this.map.size})超过了设置的最大大小(${this.maxSize4Debug}), 这可能是由于你每次都创建新的keySelector造成的, 请保证相同功能的keySelector只创建一个对象`)}return e}getOrNull(t,e){return this.getValueMap(t).get(e)}get(t,e){return this.getOrNull(t,e)??I(`key(${e})不存在与valueMap(${this.getValueMap(t)})中`)}}class ce{constructor(t){f(this,"value");this.creator=t}get(){return this.value===void 0&&(this.value=this.creator()),this.value}}var k=(r=>(r.TOP_LEFT="top-left",r.TOP_CENTER="top-center",r.TOP_RIGHT="top-right",r.BOTTOM_LEFT="bottom-left",r.BOTTOM_CENTER="bottom-center",r.BOTTOM_RIGHT="bottom-right",r.LEFT_TOP="left-top",r.LEFT_CENTER="left-center",r.LEFT_BOTTOM="left-bottom",r.RIGHT_TOP="right-top",r.RIGHT_CENTER="right-center",r.RIGHT_BOTTOM="right-bottom",r))(k||{});a.ControlPositionConverter=void 0,(r=>{let t,e;const i=["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 t||(t=new At(i,[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])),t}r.getBaidu=n;function s(){return e||(e=new At(i,[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])),e}r.getGoogle=s})(a.ControlPositionConverter||(a.ControlPositionConverter={}));class oi{constructor(t){f(this,"inner");this.position=t}}class je{}class ai extends je{constructor(t,e){super(),this.visible=t,this.position=e}isVisible(){return this.visible}setVisible(t){this.visible=t}getPosition(){return this.position}setPosition(t){this.position=t}addTo(t){}removeFrom(t){}}class Fe extends je{constructor(t,e){super(),this.inner=t,this.position=e}isVisible(){return this.inner.isVisible()}setVisible(t){t?this.inner.show():this.inner.hide()}getPosition(){return this.position??a.ControlPositionConverter.getBaidu().toKey(this.inner.getAnchor())}setPosition(t){this.position=t,this.inner.setAnchor(a.ControlPositionConverter.getBaidu().toValue(t))}addTo(t){t.innerMap.addControl(this.inner)}removeFrom(t){t.innerMap.removeControl(this.inner)}}class be extends je{constructor(e,i){super();f(this,"visible",!1);f(this,"map");this._type=e,this.position=i}isVisible(){return this.visible}setVisible(e){this.visible=e,this.tryUpdateOptions()}getPosition(){return this.position}setPosition(e){this.position=e,this.tryUpdateOptions()}addTo(e){this.map||(this.map=e,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 Rt=(r=>(r.normal="normal",r.satellite="satellite",r.hybrid="hybrid",r))(Rt||{});class W{constructor(t,e,i,n){this.id=t,this.baidu=e,this.google=i,this.googleCoordType=n}getId(){return this.id}getBaiduCoordType(){return R.bd09}asBaiduMapType(){return this.baidu()}getGoogleCoordType(){return this.googleCoordType}getGoogleMapTypeId(){return this.google()}asGoogleMapType(){He("google的内置地图没有对应的实例")}}class Er{constructor(t,e){f(this,"baiduLayerCached",new ce(()=>{const t=new BMap.TileLayer({});return t.getTilesUrl=(e,i)=>{const n=Math.pow(2,i-1),s=e.x+n,l=n-1-e.y;return this.options.getTileUrl({x:s,y:l},i)},t}));f(this,"baiduMapTypeCached",new ce(()=>{const t=new BMap.MapType(this.options.name,this.baiduLayerCached.get(),{maxZoom:this.options.maxZoom,minZoom:this.options.minZoom,tips:this.options.describe});return t.__baidu_map_type__=this,t}));f(this,"googleCached",new ce(()=>{const t=new google.maps.ImageMapType({getTileUrl:(e,i)=>this.options.getTileUrl(e,i),tileSize:new google.maps.Size(256,256),name:this.options.name,alt:this.options.describe,maxZoom:this.options.maxZoom,minZoom:this.options.minZoom});return t.__google_map_type__=this,t}));this.coordType=t,this.options=e}get id(){return this.options.id}getBaiduCoordType(){return this.coordType}asBaiduMapType(){return this.baiduMapTypeCached.get()}asBaiduLayer(){return this.baiduLayerCached.get()}getGoogleCoordType(){return this.coordType}asGoogleMapType(){return this.googleCached.get()}asGoogleLayer(){He("这个方法不会被调用")}}class li{constructor(){f(this,"baiduCache",new ce(()=>new BMap.TrafficLayer));f(this,"googleCache",new ce(()=>new google.maps.TrafficLayer))}asBaiduLayer(){return this.baiduCache.get()}asGoogleLayer(){return this.googleCache.get()}}a.MapType=void 0,(r=>{r.NORMAL=new W("normal",()=>BMAP_NORMAL_MAP,()=>google.maps.MapTypeId.ROADMAP,R.gcj02),r.SATELLITE=new W("satellite",()=>BMAP_SATELLITE_MAP,()=>google.maps.MapTypeId.SATELLITE,R.wgs84),r.HYBRID=new W("hybrid",()=>BMAP_HYBRID_MAP,()=>google.maps.MapTypeId.HYBRID,R.gcj02),r.TERRAIN=new W("terrain",()=>BMAP_PERSPECTIVE_MAP,()=>google.maps.MapTypeId.TERRAIN,R.wgs84),r.BUILD_IN_MAP_TYPES=new si([r.NORMAL,r.SATELLITE,r.HYBRID,r.TERRAIN])})(a.MapType||(a.MapType={}));var Dt=(r=>(r.DEFAULT="default",r.HORIZONTAL="horizontal",r.DROPDOWN="dropdown",r))(Dt||{});const hi=[a.MapType.NORMAL,a.MapType.SATELLITE,a.MapType.HYBRID];class Ue extends Fe{static create(t){const e=t.mapTypes??hi,i={default:BMAP_MAPTYPE_CONTROL_HORIZONTAL,horizontal:BMAP_MAPTYPE_CONTROL_HORIZONTAL,dropdown:BMAP_MAPTYPE_CONTROL_DROPDOWN},n=new BMap.MapTypeControl({type:t.type&&i[t.type],mapTypes:e.map(s=>s.asBaiduMapType())});return t.position&&n.setAnchor(a.ControlPositionConverter.getBaidu().toValue(t.position)),new Ue(n,t.position)}}const oe=class oe extends be{constructor(t="default",e=k.TOP_LEFT,i=hi){super("mapType",e),this.type=t,this.mapTypes=i,oe.type2google||(oe.type2google={default:google.maps.MapTypeControlStyle.DEFAULT,horizontal:google.maps.MapTypeControlStyle.HORIZONTAL_BAR,dropdown:google.maps.MapTypeControlStyle.DROPDOWN_MENU})}static create(t){return new oe(t.type,t.position,t.mapTypes)}onCreateOptions(){const t=super.onCreateOptions();return t.style=oe.type2google[this.type],t.mapTypeIds=this.mapTypes.map(e=>e instanceof W?e.getGoogleMapTypeId():e.id),t}addTo(t){super.addTo(t),this.mapTypes.forEach(e=>{e instanceof W||t.innerMap.mapTypes.set(e.id,e.asGoogleMapType())})}};f(oe,"type2google");let Ye=oe;class qe extends Fe{static create(t){const e=new BMap.ScaleControl({anchor:t.position&&a.ControlPositionConverter.getBaidu().toValue(t.position)});return new qe(e,t.position)}}class Ke extends be{static create(t){return new Ke(t.position)}constructor(t=k.BOTTOM_RIGHT){super("scale",t)}}class Xe extends ai{static create(t){return new Xe(!0,t.position??k.RIGHT_BOTTOM)}}class Je extends be{static create(t){return new Je(t.position)}constructor(t=k.RIGHT_BOTTOM){super("streetView",t)}}class Qe extends Fe{static create(t){const e=new BMap.NavigationControl({type:BMAP_NAVIGATION_CONTROL_ZOOM,anchor:t.position&&a.ControlPositionConverter.getBaidu().toValue(t.position)});return new Qe(e,t.position)}}class et extends be{static create(t){return new et(t.position)}constructor(t=k.RIGHT_BOTTOM){super("zoom",t)}}function Pr(r){let t,e,i;const n="The Google Maps JavaScript API",s="google",l="importLibrary",d="__ib__",o=document,c=window,u=c[s]||(c[s]={}),g=u.maps||(u.maps={}),m=new Set,v=new URLSearchParams,C=()=>t||(t=new Promise(async(M,O)=>{var h;await(e=o.createElement("script")),v.set("libraries",[...m]+"");for(i in r)v.set(i.replace(/[A-Z]/g,p=>"_"+p[0].toLowerCase()),r[i]);v.set("callback",s+".maps."+d),e.src=`https://maps.${s}apis.com/maps/api/js?`+v,g[d]=M,e.onerror=()=>t=O(Error(n+" could not load.")),e.nonce=((h=o.querySelector("script[nonce]"))==null?void 0:h.nonce)||"",o.head.append(e)}));g[l]?console.warn(n+" only loads once. Ignoring:",r):g[l]=(M,...O)=>m.add(M)&&C().then(()=>g[l](M,...O))}let Lr,Br;const ie={get LATLNG_ZERO(){return Lr??(Lr=new google.maps.LatLng({lat:0,lng:0}))},get BOUNDS_ZERO(){return Br??(Br=new google.maps.LatLngBounds(this.LATLNG_ZERO,this.LATLNG_ZERO))}};function ci(r,t={country:"",province:"",city:"",district:"",street:"",streetNumber:""}){for(const e of r)for(const i of e.types)switch(i){case"street_number":t.streetNumber=e.long_name;break;case"route":t.street=e.long_name;break;case"locality":t.city=e.long_name;break;case"sublocality":t.district=e.long_name;break;case"administrative_area_level_1":t.province=e.long_name;break;case"country":t.country=e.long_name;break}return t}function di(r,t){var i;const e=r.address_components&&ci(r.address_components);return{country:(e==null?void 0:e.country)??"",province:(e==null?void 0:e.province)??"",city:(e==null?void 0:e.city)??"",id:r.place_id??"",address:r.formatted_address??"",position:w.fromGoogle(((i=r.geometry)==null?void 0:i.location)??ie.LATLNG_ZERO,t.coordType),title:r.name??""}}class $t{}class ui extends $t{constructor(e,i){super();f(this,"inner");this.map=e,this.inner=new google.maps.places.Autocomplete(i.input,{fields:["address_components","name"]}),i.bindToMap&&this.inner.bindTo("bounds",e.innerMap)}setBounds(e){this.inner.setBounds(e.toGoogle(this.map.coordType))}addResultListener(e){return ti(this.inner,"place_changed",()=>{const i=this.inner.getPlace(),n={title:i.name??"",province:"",city:"",district:"",street:"",streetNumber:"",country:""};i.address_components&&ci(i.address_components,n),e(n)})}}class pi extends $t{constructor(e,i){super();f(this,"inner");f(this,"input");f(this,"removeableArray",[]);if(this.map=e,this.input=i.input,this.inner=new BMap.Autocomplete({input:i.input,location:i.bindToMap?e.innerMap:void 0}),i.bindToMap){const n=()=>{this.inner.setLocation(this.map.innerMap)};this.removeableArray.push(ii(this.map,"center-changed",n)),this.removeableArray.push(ii(this.map,"zoom-changed",n))}}setBounds(e){this.inner.setLocation(e.getCenter().toBaidu(this.map.coordType))}addResultListener(e){let i=0;const n=Or(this.inner,"confirm",l=>{const d=l.item.value;i=Date.now(),e(Object.assign({title:d.business,country:""},d))}),s=wr(this.input,"keyup",l=>{l.key==="Enter"&&Date.now()-i>100&&e({title:this.input.value,country:"",city:"",district:"",province:"",street:"",streetNumber:""})});return()=>{s(),n()}}}var gi={exports:{}};(function(r,t){(function(e,i){r.exports=i()})(It,function(){const e=function(){var s={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.45:"rgb(0,0,255)",.55:"rgb(0,255,255)",.65:"rgb(0,255,0)",.95:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},l=function(){var v=function(O){this._coordinator={},this._data=[],this._radi=[],this._min=0,this._max=1,this._xField=O.xField||O.defaultXField,this._yField=O.yField||O.defaultYField,this._valueField=O.valueField||O.defaultValueField,O.radius&&(this._cfgRadius=O.radius)},C=s.defaultRadius;return v.prototype={_organiseData:function(M,O){var h=M[this._xField],p=M[this._yField],_=this._radi,b=this._data,E=this._max,P=this._min,B=M[this._valueField]||1,D=M.radius||this._cfgRadius||C;return b[h]||(b[h]=[],_[h]=[]),b[h][p]?b[h][p]+=B:(b[h][p]=B,_[h][p]=D),b[h][p]>E?(O?this.setDataMax(b[h][p]):this._max=b[h][p],!1):{x:h,y:p,value:B,radius:D,min:P,max:E}},_unOrganizeData:function(){var M=[],O=this._data,h=this._radi;for(var p in O)for(var _ in O[p])M.push({x:p,y:_,radius:h[p][_],value:O[p][_]});return{min:this._min,max:this._max,data:M}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(arguments[0].length>0)for(var M=arguments[0],O=M.length;O--;)this.addData.call(this,M[O]);else{var h=this._organiseData(arguments[0],!0);h&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[h]})}return this},setData:function(M){var O=M.data,h=O.length;this._data=[],this._radi=[];for(var p=0;p<h;p++)this._organiseData(O[p],!1);return this._max=M.max,this._min=M.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(M){return this._max=M,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(M){return this._min=M,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(M){this._coordinator=M},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},v}(),d=function(){var v=function(h){var p=h.gradient||h.defaultGradient,_=document.createElement("canvas"),b=_.getContext("2d");_.width=256,_.height=1;var E=b.createLinearGradient(0,0,256,1);for(var P in p)E.addColorStop(P,p[P]);return b.fillStyle=E,b.fillRect(0,0,256,1),b.getImageData(0,0,256,1).data},C=function(h,p){var _=document.createElement("canvas"),b=_.getContext("2d"),E=h,P=h;if(_.width=_.height=h*2,p==1)b.beginPath(),b.arc(E,P,h,0,2*Math.PI,!1),b.fillStyle="rgba(0,0,0,1)",b.fill();else{var B=b.createRadialGradient(E,P,h*p,E,P,h);B.addColorStop(0,"rgba(0,0,0,1)"),B.addColorStop(1,"rgba(0,0,0,0)"),b.fillStyle=B,b.fillRect(0,0,2*h,2*h)}return _},M=function(P){for(var p=[],_=P.min,b=P.max,E=P.radi,P=P.data,B=Object.keys(P),D=B.length;D--;)for(var Z=B[D],S=Object.keys(P[Z]),ee=S.length;ee--;){var A=S[ee],q=P[Z][A],te=E[Z][A];p.push({x:Z,y:A,value:q,radius:te})}return{min:_,max:b,data:p}};function O(h){var p=h.element,_=this.shadowCanvas=document.createElement("canvas"),b=this.canvas=h.canvas||document.createElement("canvas");this._renderBoundaries=[1e4,1e4,0,0];var E=getComputedStyle(h.element)||{};b.className="heatmap-canvas",this._width=b.width=_.width=+E.width.replace(/px/,""),this._height=b.height=_.height=+E.height.replace(/px/,""),this.shadowCtx=_.getContext("2d"),this.ctx=b.getContext("2d"),b.style.cssText=_.style.cssText="position:absolute;left:0;top:0;",p.style.position="relative",p.appendChild(b),this._palette=v(h),this._templates={},this._setStyles(h)}return O.prototype={renderPartial:function(h){this._drawAlpha(h),this._colorize()},renderAll:function(h){this._clear(),this._drawAlpha(M(h)),this._colorize()},_updateGradient:function(h){this._palette=v(h)},updateConfig:function(h,p){h.gradient!==p.gradient&&this._updateGradient(h),this._setStyles(h)},setDimensions:function(h,p){this._width=h,this._height=p,this.canvas.width=this.shadowCanvas.width=h,this.canvas.height=this.shadowCanvas.height=p},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(h){this._blur=h.blur==0?0:h.blur||h.defaultBlur,h.backgroundColor&&(this.canvas.style.backgroundColor=h.backgroundColor),this._opacity=(h.opacity||0)*255,this._maxOpacity=(h.maxOpacity||h.defaultMaxOpacity)*255,this._minOpacity=(h.minOpacity||h.defaultMinOpacity)*255,this._useGradientOpacity=!!h.useGradientOpacity},_drawAlpha:function(b){for(var p=this._min=b.min,_=this._max=b.max,b=b.data||[],E=b.length,P=1-this._blur;E--;){var B=b[E],D=B.x,Z=B.y,S=B.radius,ee=Math.min(B.value,_),A=D-S,q=Z-S,te=this.shadowCtx,K;this._templates[S]?K=this._templates[S]:this._templates[S]=K=C(S,P),te.globalAlpha=(ee-p)/(_-p),te.drawImage(K,A,q),A<this._renderBoundaries[0]&&(this._renderBoundaries[0]=A),q<this._renderBoundaries[1]&&(this._renderBoundaries[1]=q),A+2*S>this._renderBoundaries[2]&&(this._renderBoundaries[2]=A+2*S),q+2*S>this._renderBoundaries[3]&&(this._renderBoundaries[3]=q+2*S)}},_colorize:function(){var h=this._renderBoundaries[0],p=this._renderBoundaries[1],_=this._renderBoundaries[2]-h,b=this._renderBoundaries[3]-p,E=this._width,P=this._height,B=this._opacity,D=this._maxOpacity,Z=this._minOpacity,S=this._useGradientOpacity;h<0&&(h=0),p<0&&(p=0),h+_>E&&(_=E-h),p+b>P&&(b=P-p);for(var ee=this.shadowCtx.getImageData(h,p,_,b),A=ee.data,q=A.length,te=this._palette,K=3;K<q;K+=4){var Bt=A[K],Re=Bt*4;if(Re){var De;B>0?De=B:Bt<D?Bt<Z?De=Z:De=Bt:De=D,A[K-3]=te[Re],A[K-2]=te[Re+1],A[K-1]=te[Re+2],A[K]=S?te[Re+3]:De}}this.ctx.putImageData(ee,h,p),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(h){var p,_=this.shadowCtx,b=_.getImageData(h.x,h.y,1,1),E=b.data[3],P=this._max,B=this._min;return p=Math.abs(P-B)*(E/255)>>0,p},getDataURL:function(){return this.canvas.toDataURL()}},O}(),o=function(){var v=!1;return s.defaultRenderer==="canvas2d"&&(v=d),v}(),c={merge:function(){for(var m={},v=arguments.length,C=0;C<v;C++){var M=arguments[C];for(var O in M)m[O]=M[O]}return m}},u=function(){var v=function(){function h(){this.cStore={}}return h.prototype={on:function(p,_,b){var E=this.cStore;E[p]||(E[p]=[]),E[p].push(function(P){return _.call(b,P)})},emit:function(p,_){var b=this.cStore;if(b[p])for(var E=b[p].length,P=0;P<E;P++){var B=b[p][P];B(_)}}},h}(),C=function(O){var h=O._renderer,p=O._coordinator,_=O._store;p.on("renderpartial",h.renderPartial,h),p.on("renderall",h.renderAll,h),p.on("extremachange",function(b){O._config.onExtremaChange&&O._config.onExtremaChange({min:b.min,max:b.max,gradient:O._config.gradient||O._config.defaultGradient})}),_.setCoordinator(p)};function M(){var O=this._config=c.merge(s,arguments[0]||{});if(this._coordinator=new v,O.plugin){var h=O.plugin;if(s.plugins[h]){var p=s.plugins[h];this._renderer=new p.renderer(O),this._store=new p.store(O)}else throw new Error("Plugin '"+h+"' not found. Maybe it was not registered.")}else this._renderer=new o(O),this._store=new l(O);C(this)}return M.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(O){const h=this._config;return this._config=c.merge(this._config,O),this._renderer.updateConfig(this._config,h),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(O){return this._store.getValueAt?this._store.getValueAt(O):this._renderer.getValueAt?this._renderer.getValueAt(O):null}},M}(),g={create:function(m){return new u(m)},register:function(m,v){s.plugins[m]=v}};return g}();var i=function(s){Reflect.getPrototypeOf(i.prototype)!==BMap.Overlay.prototype&&Reflect.setPrototypeOf(i.prototype,BMap.Overlay.prototype),this.conf=s,this.conf.visible=s.visible===void 0?!0:s.visible,this.heatmap=null,this.latlngs=[],this.bounds=null};i.prototype=Object.create(typeof BMap>"u"?null:BMap.Overlay.prototype),i.prototype.initialize=function(s){this._map=s;var l=document.createElement("div");if(l.style.position="absolute",l.style.top=0,l.style.left=0,l.style.border=0,l.style.width=this._map.getSize().width+"px",l.style.height=this._map.getSize().height+"px",this.conf.element=l,!n())return l;s.getPanes().mapPane.appendChild(l),this.conf.valueField=this.conf.valueField||"count",this.heatmap=e.create(this.conf);var d=this;return s.addEventListener("resize",function(o){var c=o.size;l.style.width=c.width+"px",l.style.height=c.height+"px",d.heatmap._renderer.setDimensions(c.width,c.height),d.draw()}),this._div=l,l},i.prototype.draw=function(){if(n()){var s=this._map.getBounds();if(!s.equals(this.bounds)){this.bounds=s;var l=this._map.pointToOverlayPixel(s.getNorthEast()),d=this._map.pointToOverlayPixel(s.getSouthWest()),o=l.y,c=d.x,u=d.y-l.y,g=l.x-d.x;if(this.conf.element.style.left=c+"px",this.conf.element.style.top=o+"px",this.conf.element.style.width=g+"px",this.conf.element.style.height=u+"px",this.latlngs.length>0){this.heatmap.removeData();var m=this.latlngs.length;const h={max:this.heatmap._store.getData().max,data:[]};for(;m--;){var v=this.latlngs[m].latlng;if(s.containsPoint(v)){var C=this._map.pointToOverlayPixel(v),c=this._map.pointToOverlayPixel(s.getSouthWest()).x,o=this._map.pointToOverlayPixel(s.getNorthEast()).y,M=new BMap.Pixel(C.x-c,C.y-o),O=this.pixelTransform(M);h.data.push({x:O.x,y:O.y,count:this.latlngs[m].c})}}this.conf.radiusChangeByZoom&&(this.heatmap._store._cfgRadius=this.conf.radiusChangeByZoom(this._map.getZoom())),this.heatmap.setData(h)}}}},i.prototype.pixelTransform=function(s){for(var l=this.heatmap.width,d=this.heatmap.height;s.x<0;)s.x+=l;for(;s.x>l;)s.x-=l;for(;s.y<0;)s.y+=d;for(;s.y>d;)s.y-=d;return s.x=s.x>>0,s.y=s.y>>0,s},i.prototype.setDataSet=function(s){if(this.data=s,!!n()){var l=this._map.getBounds(),d={max:s.max,data:[]},o=s.data,c=o.length;for(this.latlngs=[],this.heatmap.removeData(),this.conf.radiusChangeByZoom&&(this.heatmap._store._cfgRadius=this.conf.radiusChangeByZoom(this._map.getZoom()));c--;){var u=new BMap.Point(o[c].lng,o[c].lat);if(this.latlngs.push({latlng:u,c:o[c].count}),!!l.containsPoint(u)){var g=this._map.pointToOverlayPixel(u),m=this._map.pointToOverlayPixel(l.getSouthWest()).x,v=this._map.pointToOverlayPixel(l.getNorthEast()).y,C=new BMap.Pixel(g.x-m,g.y-v),M=this.pixelTransform(C);d.data.push({x:M.x,y:M.y,count:o[c].count})}}this.heatmap.setData(d)}},i.prototype.addDataPoint=function(s,l,d){if(n()){this.data&&this.data.data&&this.data.data.push({lng:s,lat:l,count:d});var o=new BMap.Point(s,l),c=this.pixelTransform(this._map.pointToOverlayPixel(o));this.heatmap.store.addDataPoint(c.x,c.y,d),this.latlngs.push({latlng:o,c:d})}},i.prototype.toggle=function(){n()&&(this.conf.visible===!0?this.conf.visible=!1:this.conf.visible=!0,this.conf.visible?this.conf.element.style.display="block":this.conf.element.style.display="none")},i.prototype.setOptions=function(s){if(n()){for(var l in s)l=="radius"&&(this.heatmap._store._cfgRadius=s[l]);this.heatmap.configure(s),this.data&&this.setDataSet(this.data)}};function n(){var s=document.createElement("canvas");return!!(s.getContext&&s.getContext("2d"))}return i})})(gi);var Ir=gi.exports;const Sr=ze(Ir),mi=10,tt={toGoogle:(r,t)=>({opacity:r.opacity,radius:r.radius??mi,gradient:r.gradient&&Object.entries(r.gradient).sort(([e],[i])=>+e-+i).map(([e,i])=>i),maxIntensity:r.maxIntensity,data:it.toGoogle(r.data,t)}),toBaidu:(r,t,e)=>({opacity:r.opacity,radius:r.radius??mi,gradient:r.gradient,data:it.toBaidu(r.data,t,e)})},it={toGoogle:(r,t)=>r.map(e=>"weight"in e?{weight:e.weight,location:e.position.toGoogle(t)}:e.toGoogle(t)),toBaidu:(r,t,e)=>{let i=1;return{data:r.map(s=>{let l,d;return"weight"in s?(l=s.position.to(t),d=s.weight):(l=s.to(t),d=1),i<d&&(i=d),{lng:l.lng,lat:l.lat,count:d}}),max:e??i}}};class zt{}class fi extends zt{constructor(e,i){super();f(this,"inner");this.map=e,this.inner=new google.maps.visualization.HeatmapLayer(tt.toGoogle(i,this.map.coordType)),this.inner.setMap(e.innerMap)}setData(e){this.inner.setData(it.toGoogle(e,this.map.coordType))}setOptions(e){this.inner.setOptions(tt.toGoogle(e,this.map.coordType))}remove(){this.inner.setMap(null)}}class yi extends zt{constructor(e,i){super();f(this,"inner");this.map=e;const n=tt.toBaidu(i,this.map.coordType,i.maxIntensity);this.inner=new Sr(n),e.innerMap.addOverlay(this.inner),this.inner.setDataSet(n.data)}get innerDataMax(){var e;return(e=this.inner.data)==null?void 0:e.max}set innerDataMax(e){var i;((i=this.inner).data??(i.data={})).max=e}setData(e){this.inner.setDataSet(it.toBaidu(e,this.map.coordType,this.innerDataMax))}setOptions(e){const i=tt.toBaidu(e,this.map.coordType,e.maxIntensity??this.innerDataMax);e.data!==this.inner.data?this.inner.setDataSet(i.data):e.maxIntensity&&(this.innerDataMax=e.maxIntensity),this.inner.setOptions(i)}remove(){this.map.innerMap.removeOverlay(this.inner)}}class Gt{constructor(t){this.options=t}}function Me(r,t,e){const i=new URL(t,r),n=new URLSearchParams(Object.entries(e).filter(Qt));return i.search="?"+n.toString(),i}function Nt(){const r=window.location.hostname.split(".").filter(t=>!a.Strings.isInt(t));return r.length===3?r.join("."):[...r,"tg","map","urls"].slice(0,3).join(".")}const xe=class xe extends Gt{directions(t,e,i){return Me(xe.BASE_URL,"dir/",{api:"1",origin:a.Location.toString(t,R.gcj02),destination:a.Location.toString(e,R.gcj02),travelmode:i})}search(t){return Me(xe.BASE_URL,"search/",{api:"1",query:a.Location.toString(t,R.gcj02)})}};f(xe,"BASE_URL","https://www.google.com/maps/");let rt=xe;const ve=class ve extends Gt{directions(t,e,i="driving"){const n=a.Location.getCoordType(e)??a.Location.getCoordType(t)??R.bd09,s=a.Location.toString(e,n);return Me(ve.BASE_URL,"direction",{origin:a.Location.toString(t,n)??(typeof e!="string"?`name:请选择起点|latlng:${s}`:s),destination:s,coord_type:n===R.bd09?void 0:n,mode:i,output:"html",region:"中国",src:Nt()})}search(t){return typeof t=="string"?this.geocoderApi(t):this.latlngApi(t)}latlngApi(t){const e=t.to(R.bd09);return new URL(`https://map.baidu.com/?latlng=${e.lat},${e.lng}`)}markerApi(t,e,i){return Me(ve.BASE_URL,"marker",{location:`${t.lat},${t.lng}`,coord_type:t.coord===R.bd09?void 0:t.coord,title:e,content:i,output:"html",src:Nt()})}geocoderApi(t){return Me(ve.BASE_URL,"geocoder",{...typeof t=="string"?{address:t}:{location:`${t.lat},${t.lng}`,coord_type:t.coord===R.bd09?void 0:t.coord},output:"html",src:Nt()})}};f(ve,"BASE_URL","https://api.map.baidu.com/");let nt=ve,kr=class pr{constructor(t,e,i){this.extend(pr,google.maps.OverlayView),this.map_=t,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=i||{};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(t),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()}),e&&(e.length||Object.keys(e).length)&&this.addMarkers(e,!1)}extend(t,e){return(function(i){for(var n in i.prototype)this.prototype[n]=i.prototype[n];return this}).apply(t,[e])}onAdd(){this.setReady_(!0)}draw(){}setupStyles_(){if(!this.styles_.length)for(var t=0,e;e=this.sizes[t];t++)this.styles_.push({url:this.imagePath_+(t+1)+"."+this.imageExtension_,height:e,width:e})}fitMapToMarkers(){for(var t=this.getMarkers(),e=new google.maps.LatLngBounds,i=0,n;n=t[i];i++)e.extend(n.getPosition());this.map_.fitBounds(e)}setZIndex(t){this.zIndex_=t}getZIndex(){return this.zIndex_}setStyles(t){this.styles_=t}getStyles(){return this.styles_}isZoomOnClick(){return this.zoomOnClick_}isAverageCenter(){return this.averageCenter_}getMarkers(){return this.markers_}getTotalMarkers(){return this.markers_.length}setMaxZoom(t){this.maxZoom_=t}getMaxZoom(){return this.maxZoom_}calculator_(t,e){for(var i=0,n=t.length,s=n;s!==0;)s=parseInt(s/10,10),i++;return i=Math.min(i,e),{text:n,index:i}}setCalculator(t){this.calculator_=t}getCalculator(){return this.calculator_}addMarkers(t,e){if(t.length)for(let i=0,n;n=t[i];i++)this.pushMarkerTo_(n);else if(Object.keys(t).length)for(let i in t)this.pushMarkerTo_(t[i]);e||this.redraw()}pushMarkerTo_(t){if(t.isAdded=!1,t.draggable){var e=this;google.maps.event.addListener(t,"dragend",function(){t.isAdded=!1,e.repaint()})}this.markers_.push(t)}addMarker(t,e){this.pushMarkerTo_(t),e||this.redraw()}removeMarker_(t){var e=-1;if(this.markers_.indexOf)e=this.markers_.indexOf(t);else for(var i=0,n;n=this.markers_[i];i++)if(n==t){e=i;break}return e==-1?!1:(t.setMap(null),this.markers_.splice(e,1),!0)}removeMarker(t,e){var i=this.removeMarker_(t);return!e&&i?(this.resetViewport(),this.redraw(),!0):!1}removeMarkers(t,e){for(var i=t===this.getMarkers()?t.slice():t,n=!1,s=0,l;l=i[s];s++){var d=this.removeMarker_(l);n=n||d}if(!e&&n)return this.resetViewport(),this.redraw(),!0}setReady_(t){this.ready_||(this.ready_=t,this.createClusters_())}getTotalClusters(){return this.clusters_.length}getMap(){return this.map_}setMap(t){this.map_=t}getGridSize(){return this.gridSize_}setGridSize(t){this.gridSize_=t}getMinClusterSize(){return this.minClusterSize_}setMinClusterSize(t){this.minClusterSize_=t}getExtendedBounds(t){var e=this.getProjection(),i=new google.maps.LatLng(t.getNorthEast().lat(),t.getNorthEast().lng()),n=new google.maps.LatLng(t.getSouthWest().lat(),t.getSouthWest().lng()),s=e.fromLatLngToDivPixel(i);s.x+=this.gridSize_,s.y-=this.gridSize_;var l=e.fromLatLngToDivPixel(n);l.x-=this.gridSize_,l.y+=this.gridSize_;var d=e.fromDivPixelToLatLng(s),o=e.fromDivPixelToLatLng(l);return t.extend(d),t.extend(o),t}isMarkerInBounds_(t,e){return e.contains(t.getPosition())}clearMarkers(){this.resetViewport(!0),this.markers_=[]}resetViewport(t){for(let e=0,i;i=this.clusters_[e];e++)i.remove();for(let e=0,i;i=this.markers_[e];e++)i.isAdded=!1,t&&i.setMap(null);this.clusters_=[]}repaint(){var t=this.clusters_.slice();this.clusters_.length=0,this.resetViewport(),this.redraw(),setTimeout(function(){for(var e=0,i;i=t[e];e++)i.remove()},0)}redraw(){this.createClusters_()}distanceBetweenPoints_(t,e){if(!t||!e)return 0;var i=6371,n=(e.lat()-t.lat())*Math.PI/180,s=(e.lng()-t.lng())*Math.PI/180,l=Math.sin(n/2)*Math.sin(n/2)+Math.cos(t.lat()*Math.PI/180)*Math.cos(e.lat()*Math.PI/180)*Math.sin(s/2)*Math.sin(s/2),d=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),o=i*d;return o}addToClosestCluster_(t){for(var e=4e4,i=null,n=0,s;s=this.clusters_[n];n++){var l=s.getCenter();if(l){var d=this.distanceBetweenPoints_(l,t.getPosition());d<e&&(e=d,i=s)}}if(i&&i.isMarkerInClusterBounds(t))i.addMarker(t);else{var o=new xr(this);o.addMarker(t),this.clusters_.push(o)}}createClusters_(){if(this.ready_)for(var t=new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast()),e=this.getExtendedBounds(t),i=0,n;n=this.markers_[i];i++)!n.isAdded&&this.isMarkerInBounds_(n,e)&&this.addToClosestCluster_(n)}},xr=class{constructor(t){this.markerClusterer_=t,this.map_=t.getMap(),this.gridSize_=t.getGridSize(),this.minClusterSize_=t.getMinClusterSize(),this.averageCenter_=t.isAverageCenter(),this.center_=null,this.markers_=[],this.bounds_=null,this.clusterIcon_=new Zt(this,t.getStyles(),t.getGridSize())}isMarkerAlreadyAdded(t){if(this.markers_.indexOf)return this.markers_.indexOf(t)!=-1;for(var e=0,i;i=this.markers_[e];e++)if(i==t)return!0;return!1}addMarker(t){if(this.isMarkerAlreadyAdded(t))return!1;if(!this.center_)this.center_=t.getPosition(),this.calculateBounds_();else if(this.averageCenter_){var e=this.markers_.length+1,i=(this.center_.lat()*(e-1)+t.getPosition().lat())/e,n=(this.center_.lng()*(e-1)+t.getPosition().lng())/e;this.center_=new google.maps.LatLng(i,n),this.calculateBounds_()}t.isAdded=!0,this.markers_.push(t);var s=this.markers_.length;if(s<this.minClusterSize_&&t.getMap()!=this.map_&&t.setMap(this.map_),s==this.minClusterSize_)for(var l=0;l<s;l++)this.markers_[l].setMap(null);return s>=this.minClusterSize_&&t.setMap(null),this.updateIcon(),!0}getMarkerClusterer(){return this.markerClusterer_}getBounds(){for(var t=new google.maps.LatLngBounds(this.center_,this.center_),e=this.getMarkers(),i=0,n;n=e[i];i++)t.extend(n.getPosition());return t}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 t=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(t)}isMarkerInClusterBounds(t){return this.bounds_.contains(t.getPosition())}getMap(){return this.map_}updateIcon(){var t=this.map_.getZoom(),e=this.markerClusterer_.getMaxZoom();if(e&&t>e){for(var i=0,n;n=this.markers_[i];i++)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 Zt{constructor(t,e,i){t.getMarkerClusterer().extend(Zt,google.maps.OverlayView),this.styles_=e,this.padding_=i||0,this.cluster_=t,this.center_=null,this.map_=t.getMap(),this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(this.map_)}triggerClusterClick(){var t=this.cluster_.getBounds(),e=this.cluster_.getMarkerClusterer();google.maps.event.trigger(e.map_,"clusterclick",this.cluster_),e.isZoomOnClick()&&(this.map_.fitBounds(t),this.map_.setCenter(t.getCenter()))}onAdd(){if(this.div_=document.createElement("DIV"),this.visible_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(t),this.div_.innerHTML=this.sums_.text}var e=this.getPanes();e.overlayMouseTarget.appendChild(this.div_);var i=this;google.maps.event.addDomListener(this.div_,"click",function(){i.triggerClusterClick()})}getPosFromLatLng_(t){var e=this.getProjection().fromLatLngToDivPixel(t);return e.x-=parseInt(this.width_/2,10),e.y-=parseInt(this.height_/2,10),e}draw(){if(this.visible_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.top=t.y+"px",this.div_.style.left=t.x+"px"}}hide(){this.div_&&(this.div_.style.display="none"),this.visible_=!1}show(){if(this.div_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(t),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(t){this.sums_=t,this.text_=t.text,this.index_=t.index,this.div_&&(this.div_.innerHTML=t.text),this.useStyle()}useStyle(){var t=Math.max(0,this.sums_.index-1);t=Math.min(this.styles_.length-1,t);var e=this.styles_[t];this.url_=e.url,this.height_=e.height,this.width_=e.width,this.textColor_=e.textColor,this.anchor_=e.anchor,this.textSize_=e.textSize,this.backgroundPosition_=e.backgroundPosition}setCenter(t){this.center_=t}createCss(t){var e=[];e.push("z-index:"+this.cluster_.markerClusterer_.getZIndex()+";"),e.push("background-image:url("+this.url_+");");var i=this.backgroundPosition_?this.backgroundPosition_:"0 0";e.push("background-position:"+i+";"),typeof this.anchor_=="object"?(typeof this.anchor_[0]=="number"&&this.anchor_[0]>0&&this.anchor_[0]<this.height_?e.push("height:"+(this.height_-this.anchor_[0])+"px; padding-top:"+this.anchor_[0]+"px;"):e.push("height:"+this.height_+"px; line-height:"+this.height_+"px;"),typeof this.anchor_[1]=="number"&&this.anchor_[1]>0&&this.anchor_[1]<this.width_?e.push("width:"+(this.width_-this.anchor_[1])+"px; padding-left:"+this.anchor_[1]+"px;"):e.push("width:"+this.width_+"px; text-align:center;")):e.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 e.push("cursor:pointer; top:"+t.y+"px; left:"+t.x+"px; color:"+n+"; position:absolute; font-size:"+s+"px; font-family:Arial,sans-serif; font-weight:bold"),e.join("")}}var vi={exports:{}};(function(r,t){(function(e,i){r.exports=i()})(It,function(){var e,i=e=i||{version:"1.3.8"},n={};i.guid="$BAIDU$",n[i.guid]=n[i.guid]||{},i.dom=i.dom||{},i.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},i.g=i.G=i.dom.g,i.dom.getDocument=function(o){return o=i.dom.g(o),o.nodeType==9?o:o.ownerDocument||o.document},i.lang=i.lang||{},i.lang.isString=function(o){return Object.prototype.toString.call(o)=="[object String]"},i.isString=i.lang.isString,i.dom._g=function(o){return i.lang.isString(o)?document.getElementById(o):o},i._g=i.dom._g,i.browser=i.browser||{},/msie (\d+\.\d)/i.test(navigator.userAgent)&&(i.browser.ie=i.ie=document.documentMode||+RegExp.$1),i.dom.getComputedStyle=function(o,c){o=i.dom._g(o);var u=i.dom.getDocument(o),g;return u.defaultView&&u.defaultView.getComputedStyle&&(g=u.defaultView.getComputedStyle(o,null),g)?g[c]||g.getPropertyValue(c):""},i.dom._styleFixer=i.dom._styleFixer||{},i.dom._styleFilter=i.dom._styleFilter||[],i.dom._styleFilter.filter=function(o,c,u){for(var g=0,m=i.dom._styleFilter,v;v=m[g];g++)(v=v[u])&&(c=v(o,c));return c},i.string=i.string||{},i.string.toCamelCase=function(o){return o.indexOf("-")<0&&o.indexOf("_")<0?o:o.replace(/[-_][^-_]/g,function(c){return c.charAt(1).toUpperCase()})},i.dom.getStyle=function(o,c){var u=i.dom;o=u.g(o),c=i.string.toCamelCase(c);var g=o.style[c]||(o.currentStyle?o.currentStyle[c]:"")||u.getComputedStyle(o,c);if(!g){var m=u._styleFixer[c];m&&(g=m.get?m.get(o):i.dom.getStyle(o,m))}return(m=u._styleFilter)&&(g=m.filter(c,g,"get")),g},i.getStyle=i.dom.getStyle,/opera\/(\d+\.\d)/i.test(navigator.userAgent)&&(i.browser.opera=+RegExp.$1),i.browser.isWebkit=/webkit/i.test(navigator.userAgent),i.browser.isGecko=/gecko/i.test(navigator.userAgent)&&!/like gecko/i.test(navigator.userAgent),i.browser.isStrict=document.compatMode=="CSS1Compat",i.dom.getPosition=function(o){o=i.dom.g(o);var c=i.dom.getDocument(o),u=i.browser,g=i.dom.getStyle;u.isGecko>0&&c.getBoxObjectFor&&g(o,"position")=="absolute"&&(o.style.top===""||o.style.left);var m={left:0,top:0},v=u.ie&&!u.isStrict?c.body:c.documentElement,C,M;if(o==v)return m;if(o.getBoundingClientRect){M=o.getBoundingClientRect(),m.left=Math.floor(M.left)+Math.max(c.documentElement.scrollLeft,c.body.scrollLeft),m.top=Math.floor(M.top)+Math.max(c.documentElement.scrollTop,c.body.scrollTop),m.left-=c.documentElement.clientLeft,m.top-=c.documentElement.clientTop;var O=c.body,h=parseInt(g(O,"borderLeftWidth")),p=parseInt(g(O,"borderTopWidth"));u.ie&&!u.isStrict&&(m.left-=isNaN(h)?2:h,m.top-=isNaN(p)?2:p)}else{C=o;do{if(m.left+=C.offsetLeft,m.top+=C.offsetTop,u.isWebkit>0&&g(C,"position")=="fixed"){m.left+=c.body.scrollLeft,m.top+=c.body.scrollTop;break}C=C.offsetParent}while(C&&C!=o);for((u.opera>0||u.isWebkit>0&&g(o,"position")=="absolute")&&(m.top-=c.body.offsetTop),C=o.offsetParent;C&&C!=c.body;)m.left-=C.scrollLeft,(!u.opera||C.tagName!="TR")&&(m.top-=C.scrollTop),C=C.offsetParent}return m},i.event=i.event||{},i.event._listeners=i.event._listeners||[],i.event.on=function(o,c,u){c=c.replace(/^on/i,""),o=i.dom._g(o);var g=function(O){u.call(o,O)},m=i.event._listeners,v=i.event._eventFilter,C,M=c;return c=c.toLowerCase(),v&&v[c]&&(C=v[c](o,c,g),M=C.type,g=C.listener),o.addEventListener?o.addEventListener(M,g,!1):o.attachEvent&&o.attachEvent("on"+M,g),m[m.length]=[o,c,u,g,M],o},i.on=i.event.on,function(){var o=n[i.guid];i.lang.guid=function(){return"TANGRAM__"+(o._counter++).toString(36)},o._counter=o._counter||1}(),n[i.guid]._instances=n[i.guid]._instances||{},i.lang.isFunction=function(o){return Object.prototype.toString.call(o)=="[object Function]"},i.lang.Class=function(o){this.guid=o||i.lang.guid(),n[i.guid]._instances[this.guid]=this},n[i.guid]._instances=n[i.guid]._instances||{},i.lang.Class.prototype.dispose=function(){delete n[i.guid]._instances[this.guid];for(var o in this)i.lang.isFunction(this[o])||delete this[o];this.disposed=!0},i.lang.Class.prototype.toString=function(){return"[object "+(this._className||"Object")+"]"},i.lang.Event=function(o,c){this.type=o,this.returnValue=!0,this.target=c||null,this.currentTarget=null},i.lang.Class.prototype.addEventListener=function(o,c,u){if(i.lang.isFunction(c)){!this.__listeners&&(this.__listeners={});var g=this.__listeners,m;if(typeof u=="string"&&u){if(/[^\w\-]/.test(u))throw"nonstandard key:"+u;c.hashCode=u,m=u}o.indexOf("on")!=0&&(o="on"+o),typeof g[o]!="object"&&(g[o]={}),m=m||i.lang.guid(),c.hashCode=m,g[o][m]=c}},i.lang.Class.prototype.removeEventListener=function(o,c){if(!(typeof c<"u"&&(i.lang.isFunction(c)&&!(c=c.hashCode)||!i.lang.isString(c)))){!this.__listeners&&(this.__listeners={}),o.indexOf("on")!=0&&(o="on"+o);var u=this.__listeners;if(u[o])if(typeof c<"u")u[o][c]&&delete u[o][c];else for(var g in u[o])delete u[o][g]}},i.lang.Class.prototype.dispatchEvent=function(o,c){i.lang.isString(o)&&(o=new i.lang.Event(o)),!this.__listeners&&(this.__listeners={}),c=c||{};for(var u in c)o[u]=c[u];var u,g=this.__listeners,m=o.type;if(o.target=o.target||this,o.currentTarget=this,m.indexOf("on")!=0&&(m="on"+m),i.lang.isFunction(this[m])&&this[m].apply(this,arguments),typeof g[m]=="object")for(u in g[m])g[m][u].apply(this,arguments);return o.returnValue},i.lang.inherits=function(o,c,u){var g,m,v=o.prototype,C=new Function;C.prototype=c.prototype,m=o.prototype=new C;for(g in v)m[g]=v[g];o.prototype.constructor=o,o.superClass=c.prototype,typeof u=="string"&&(m._className=u)},i.inherits=i.lang.inherits;var s="http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m",l="png",d=function(o,c,u){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}e.lang.inherits(d,BMap.Overlay,"TextIconOverlay"),this._position=o,this._text=c,this._options=u||{},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],c=0,u;u=o[c];c++)this._styles.push({url:s+c+"."+l,size:new BMap.Size(u,u)})},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,c){var u=parseInt(o),g=parseInt(u/10);return g=Math.max(0,g),g=Math.min(g,c.length-1),c[g]},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,c=this._map.pointToOverlayPixel(this._position);c.x-=Math.ceil(parseInt(o.width)/2),c.y-=Math.ceil(parseInt(o.height)/2),o.left=c.x+"px",o.top=c.y+"px"}},d.prototype._buildCssText=function(o){var c=o.url,u=o.size,g=o.anchor,m=o.offset,v=o.textColor||"black",C=o.textSize||10,M=[];if(this._zIndex&&M.push("z-index:"+this._zIndex+";"),e.browser.ie<7)M.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="'+c+'");');else{M.push("background-image:url("+c+");");var O="0 0";m instanceof BMap.Size&&(O=m.width+"px "+m.height+"px"),M.push("background-position:"+O+";")}return u instanceof BMap.Size&&(g instanceof BMap.Size?(g.height>0&&g.height<u.height&&M.push("height:"+(u.height-g.height)+"px; padding-top:"+g.height+"px;"),g.width>0&&g.width<u.width&&M.push("width:"+(u.width-g.width)+"px; padding-left:"+g.width+"px;")):(M.push("height:"+u.height+"px; line-height:"+u.height+"px;"),M.push("width:"+u.width+"px; text-align:center;"))),M.push("cursor:pointer; color:"+v+"; position:absolute; font-size:"+C+"px; font-family:Arial,sans-serif; font-weight:bold"),M.join("")},d.prototype._bind=function(){if(!this._domElement)return;var o=this,c=this._map,u=e.lang.Event;function g(m,v){var C=m.srcElement||m.target,M=m.clientX||m.pageX,O=m.clientY||m.pageY;if(m&&v&&M&&O&&C){var h=e.dom.getPosition(c.getContainer());v.pixel=new BMap.Pixel(M-h.left,O-h.top),v.point=c.pixelToPoint(v.pixel)}return v}e.event.on(this._domElement,"mouseover",function(m){o.dispatchEvent(g(m,new u("onmouseover")))}),e.event.on(this._domElement,"mouseout",function(m){o.dispatchEvent(g(m,new u("onmouseout")))}),e.event.on(this._domElement,"click",function(m){o.dispatchEvent(g(m,new u("onclick")))})},d})})(vi);var Ar=vi.exports;const _i=ze(Ar);var bi=function(r,t,e){t=Rr(t);var i=r.pointToPixel(t.getNorthEast()),n=r.pointToPixel(t.getSouthWest());i.x+=e,i.y-=e,n.x-=e,n.y+=e;var s=r.pixelToPoint(i),l=r.pixelToPoint(n);return new BMap.Bounds(l,s)},Rr=function(r){var t=st(r.getNorthEast().lng,-180,180),e=st(r.getSouthWest().lng,-180,180),i=st(r.getNorthEast().lat,-74,74),n=st(r.getSouthWest().lat,-74,74);return new BMap.Bounds(new BMap.Point(e,n),new BMap.Point(t,i))},st=function(r,t,e){return t&&(r=Math.max(r,t)),e&&(r=Math.min(r,e)),r},Mi=function(r){return Object.prototype.toString.call(r)==="[object Array]"},Ti=function(r,t){var e=-1;if(Mi(t)){if(t.indexOf)e=t.indexOf(r);else for(var i=0,n;n=t[i];i++)if(n===r){e=i;break}}return e},L=function(r,t){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}if(r){this._map=r,this._markers=[],this._clusters=[];var e=t||{};this._zIndex=e.zIndex,this._gridSize=e.gridSize||60,this._maxZoom=e.maxZoom||18,this._minClusterSize=e.minClusterSize||2,this._isAverageCenter=!1,e.isAverageCenter!=null&&(this._isAverageCenter=e.isAverageCenter),this._styles=e.styles||[];var i=this;this._map.addEventListener("zoomend",function(){i._redraw()}),this._map.addEventListener("moveend",function(){i._redraw()});var n=e.markers;Mi(n)&&this.addMarkers(n)}};L.prototype.addMarkers=function(r){if(r.length){for(var t=0,e=r.length;t<e;t++)this._pushMarkerTo(r[t]);this._createClusters()}},L.prototype._pushMarkerTo=function(r){var t=Ti(r,this._markers);t===-1&&(r.isInCluster=!1,this._markers.push(r))},L.prototype.addMarker=function(r){this._pushMarkerTo(r),this._createClusters()},L.prototype._createClusters=function(){var r=this._map.getBounds();if(r.getCenter()){for(var t=bi(this._map,r,this._gridSize),e=0,i;i=this._markers[e];e++)!i.isInCluster&&t.containsPoint(i.getPosition())&&this._addToClosestCluster(i);for(var n=this._markers.length,e=0;e<n;e++)this._clusters[e]&&this._clusters[e].render()}},L.prototype._addToClosestCluster=function(r){var t=4e6,e=null;r.getPosition();for(var i=0,n;n=this._clusters[i];i++){var s=n.getCenter();if(s){var l=this._map.getDistance(s,r.getPosition());l<t&&(t=l,e=n)}}if(e&&e.isMarkerInClusterBounds(r))e.addMarker(r);else{var n=new F(this);n.addMarker(r),this._clusters.push(n)}},L.prototype._clearLastClusters=function(){for(var r=0,t;t=this._clusters[r];r++)t.remove();this._clusters=[],this._removeMarkersFromCluster()},L.prototype._removeMarkersFromCluster=function(){for(var r=0,t;t=this._markers[r];r++)t.isInCluster=!1},L.prototype._removeMarkersFromMap=function(){for(var r=0,t;t=this._markers[r];r++){t.isInCluster=!1;var e=t.getLabel();this._map.removeOverlay(t),t.setLabel(e)}},L.prototype._removeMarker=function(r){var t=Ti(r,this._markers);return t===-1?!1:(this._map.removeOverlay(r),this._markers.splice(t,1),!0)},L.prototype.removeMarker=function(r){var t=this._removeMarker(r);return t&&(this._clearLastClusters(),this._createClusters()),t},L.prototype.removeMarkers=function(r){for(var t=!1,e=0;e<r.length;e++){var i=this._removeMarker(r[e]);t=t||i}return t&&(this._clearLastClusters(),this._createClusters()),t},L.prototype.clearMarkers=function(){this._clearLastClusters(),this._removeMarkersFromMap(),this._markers=[]},L.prototype._redraw=function(){this._clearLastClusters(),this._createClusters()},L.prototype.getGridSize=function(){return this._gridSize},L.prototype.setGridSize=function(r){this._gridSize=r,this._redraw()},L.prototype.getMaxZoom=function(){return this._maxZoom},L.prototype.setMaxZoom=function(r){this._maxZoom=r,this._redraw()},L.prototype.getZIndex=function(){return this._zIndex},L.prototype.setZIndex=function(r){this._zIndex!=r&&(this.zIndex=r,this._redraw())},L.prototype.getStyles=function(){return this._styles},L.prototype.setStyles=function(r){this._styles=r,this._redraw()},L.prototype.getMinClusterSize=function(){return this._minClusterSize},L.prototype.setMinClusterSize=function(r){this._minClusterSize=r,this._redraw()},L.prototype.isAverageCenter=function(){return this._isAverageCenter},L.prototype.getMap=function(){return this._map},L.prototype.getMarkers=function(){return this._markers},L.prototype.getClustersCount=function(){for(var r=0,t=0,e;e=this._clusters[t];t++)e.isReal()&&r++;return r},L.prototype._textCalculator=function(r){return r.length.toString()},L.prototype._stylesIndexCalculator=null,L.prototype.setTextCalculator=function(r){this._textCalculator=r},L.prototype.setStylesIndexCalculator=function(r){this._stylesIndexCalculator=r};function F(r){var t=this;this._markerClusterer=r,this._map=r.getMap(),this._minClusterSize=r.getMinClusterSize(),this._isAverageCenter=r.isAverageCenter(),this._center=null,this._markers=[],this._gridBounds=null,this._isReal=!1,this._clusterMarker=new _i(this._center,this._markers.length,{styles:this._markerClusterer.getStyles(),zIndex:r._zIndex}),this._clusterMarker.getStyleByText=function(e,i){if(t._markerClusterer._stylesIndexCalculator){var n=t._markerClusterer._stylesIndexCalculator(t._markers,i.length);return i[n]}return _i.prototype.getStyleByText.call(this,e,i)},this._clusterMarker.addEventListener&&this._clusterMarker.addEventListener("click",function(e){t._map.setViewport(t.getBounds())})}F.prototype.addMarker=function(r){if(this.isMarkerInCluster(r))return!1;if(!this._center)this._center=r.getPosition(),this.updateGridBounds();else if(this._isAverageCenter){var t=this._markers.length+1,e=(this._center.lat*(t-1)+r.getPosition().lat)/t,i=(this._center.lng*(t-1)+r.getPosition().lng)/t;this._center=new BMap.Point(i,e),this.updateGridBounds()}return r.isInCluster=!0,this._markers.push(r),!0},F.prototype.render=function(){var r=this._markers.length;if(r<this._minClusterSize)for(var t=0;t<r;t++)this._map.addOverlay(this._markers[t]);else this._map.addOverlay(this._clusterMarker),this._isReal=!0,this.updateClusterMarker()},F.prototype.isMarkerInCluster=function(r){if(this._markers.indexOf)return this._markers.indexOf(r)!=-1;for(var t=0,e;e=this._markers[t];t++)if(e===r)return!0;return!1},F.prototype.isMarkerInClusterBounds=function(r){return this._gridBounds.containsPoint(r.getPosition())},F.prototype.isReal=function(r){return this._isReal},F.prototype.updateGridBounds=function(){var r=new BMap.Bounds(this._center,this._center);this._gridBounds=bi(this._map,r,this._markerClusterer.getGridSize())},F.prototype.updateClusterMarker=function(){if(this._map.getZoom()>this._markerClusterer.getMaxZoom()){this._clusterMarker&&this._map.removeOverlay(this._clusterMarker);for(var r=0,t;t=this._markers[r];r++)this._map.addOverlay(t);return}if(this._markers.length<this._minClusterSize){this._clusterMarker.hide();return}this._clusterMarker.setPosition(this._center),this._clusterMarker.setText(this._markerClusterer._textCalculator(this._markers))},F.prototype.remove=function(){for(var r=0,t;t=this._markers[r];r++){var e=this._markers[r].getLabel();this._markers[r].getMap()&&this._map.removeOverlay(this._markers[r]),this._markers[r].setLabel(e)}this._map.removeOverlay(this._clusterMarker),this._markers.length=0,delete this._markers},F.prototype.getBounds=function(){for(var r=new BMap.Bounds(this._center,this._center),t=0,e;e=this._markers[t];t++)r.extend(e.getPosition());return r},F.prototype.getCenter=function(){return this._center};var ot;(r=>{function t(i){return{url:i.url,size:new BMap.Size(i.size.width,i.size.height),anchor:i.anchor&&new BMap.Size(i.anchor.x,i.anchor.y),offset:i.offset&&new BMap.Size(i.offset.x,i.offset.y),textColor:i.textColor,textSize:i.textSize}}r.toBaidu=t;function e(i){return{url:i.url,width:i.size.width,height:i.size.height,anchor:i.anchor&&[i.anchor.y,i.anchor.x],backgroundPosition:i.offset&&`${i.offset.x} ${i.offset.y}`,textColor:i.textColor,textSize:i.textSize}}r.toGoogle=e})(ot||(ot={}));class Wt{constructor(t){this.map=t}clearMarkers(){this.inner.clearMarkers()}addMarker(t){this.inner.addMarker(t.innerOverlay)}removeMarker(t){return this.inner.removeMarker(t.innerOverlay)}addMarkers(t){this.inner.addMarkers(t.map(e=>e.innerOverlay))}removeMarkers(t){return this.inner.removeMarkers(t.map(e=>e.innerOverlay))}}class Ci extends Wt{constructor(e,i){var s;super(e);f(this,"inner");this.inner=new L(e.innerMap,{gridSize:i.gridSize,maxZoom:i.maxZoom,minClusterSize:i.minClusterSize,isAverageCenter:i.averageCenter,styles:(s=i.styles)==null?void 0:s.map(l=>ot.toBaidu(l)),zIndex:i.zIndex});const n=i.stylesIndexCalculator;n&&this.inner.setStylesIndexCalculator((l,d)=>n(l.length,d)),i.markers&&this.addMarkers(i.markers)}recreate(){this.inner._redraw()}}class Oi extends Wt{constructor(e,i){var s,l;super(e);f(this,"inner");this.inner=new kr(e.innerMap,(s=i.markers)==null?void 0:s.map(d=>d.innerOverlay),{gridSize:i.gridSize,maxZoom:i.maxZoom,minimumClusterSize:i.minClusterSize,averageCenter:i.averageCenter,styles:(l=i.styles)==null?void 0:l.map(d=>ot.toGoogle(d)),zIndex:i.zIndex});const n=i.stylesIndexCalculator;n&&this.inner.setCalculator((d,o)=>({text:d.length,index:n(d.length,o)+1}))}recreate(){this.inner.repaint()}}class Ht{constructor(){}}class wi extends Ht{constructor(e,i){super();f(this,"inner");this.map=e,this.inner=new google.maps.places.PlacesService(e.innerMap)}search(e,i){return this.searchImpl(e,i instanceof w?i.toGoogle(this.map.coordType):i??this.map.innerMap.getCenter())}searchInBounds(e,i){return this.searchImpl(e,i.toGoogle(this.map.coordType))}searchNearBy(e,i,n){return this.searchImpl(e,{center:i.toGoogle(this.map.coordType),radius:n})}searchImpl(e,i){return new Promise((n,s)=>{this.inner.findPlaceFromQuery({query:e,fields:["formatted_address","geometry","name","place_id"],locationBias:i},(l,d)=>{switch(d){case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:case google.maps.places.PlacesServiceStatus.OK:{const o=(l??[]).map(c=>di(c,this.map));n(o);break}default:s(new Error(`status: ${d}`));break}})})}}class Ei extends Ht{constructor(e,i){super();f(this,"searchRequestMap",new Map);f(this,"currentSearch");this.map=e}get inner(){return this.currentSearch}search(e,i){return this.newSearch(i instanceof w?i.toBaidu(this.map.coordType):i??this.map.innerMap.getCenter(),n=>{n.search(e)})}searchInBounds(e,i){return this.newSearch(void 0,n=>{n.searchInBounds(e,i.toBaidu(this.map.coordType))})}searchNearBy(e,i,n){return this.newSearch(void 0,s=>{s.searchNearby(e,i.toBaidu(this.map.coordType),n)})}newSearch(e,i){return new Promise((n,s)=>{const l=new BMap.LocalSearch(e??this.map.innerMap,{onSearchComplete:d=>{Array.isArray(d)&&He("当前只支持一次搜索一条数据");const o=l.getStatus();switch(o){case BMAP_STATUS_SUCCESS:{const c=[];for(let u=0;u<d.getCurrentNumPois();u++){const g=d.getPoi(u);c.push({id:g.uid,city:g.city,country:"",position:w.fromBaidu(g.point,this.map.coordType),province:g.province,title:g.title,address:g.address})}n(c);break}case BMAP_STATUS_UNKNOWN_LOCATION:n([]);break;default:s(new Error(`status: ${o}`));break}}});i(l)})}}class Vt{constructor(t,e){f(this,"onData");f(this,"onError");this.map=t,this.input=e}setSearchListener(t,e){return this.onData&&I("setSearchListener只能调用一次"),this.onData=t,this.onError=e,le}}class Pi extends Vt{constructor(e,i){super(e,i.input);f(this,"searchBox");this.searchBox=new google.maps.places.SearchBox(i.input),this.searchBox.bindTo("bounds",e.innerMap)}setSearchListener(e,i){return super.setSearchListener(e,i),ti(this.searchBox,"places_changed",()=>{const n=this.searchBox.getPlaces();e((n??[]).map(s=>di(s,this.map)))})}search(){this.input.value&&(google.maps.event.trigger(this.input,"focus",{}),google.maps.event.trigger(this.input,"keydown",{keyCode:13}))}}class Li extends Vt{constructor(e,i){super(e,i.input);f(this,"autocomplete");f(this,"placesService");this.autocomplete=e.createAutocomplete({input:i.input,bindToMap:!0}),this.placesService=e.createPlacesService({})}setSearchListener(e,i){return super.setSearchListener(e,i),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(e){this.placesService.search(e).then(this.onData,this.onError)}}var Bi=(r=>(r[r.WORLD=1]="WORLD",r[r.STATE=5]="STATE",r[r.CITY=10]="CITY",r[r.STREET=15]="STREET",r[r.BUILDING=20]="BUILDING",r))(Bi||{});class at{constructor(t){f(this,"latestInfoWindow");f(this,"delegate",void 0);this.element=t,process.env.NODE_ENV!=="production"&&setTimeout(()=>{this.delegate||console.warn(`${this.constructor.name}继承了AbstractMap, 但未调用setEventTargetDelegate(delegate)`)})}setEventTargetDelegate(t){this.delegate=t.setTarget(this)}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}getLatestInfoWindow(){return this.latestInfoWindow}setLatestInfoWindowInternal(t){this.latestInfoWindow=t}addOverlayMapType(t){this.addLayer(t)}removeOverlayMapType(t){this.removeLayer(t)}addControl(t){t.addTo(this)}removeControl(t){t.removeFrom(this)}getZoom(){return this.innerMap.getZoom()??0}setZoom(t){this.innerMap.setZoom(t)}}var Dr=function(t){return $r(t)&&!zr(t)};function $r(r){return!!r&&typeof r=="object"}function zr(r){var t=Object.prototype.toString.call(r);return t==="[object RegExp]"||t==="[object Date]"||Zr(r)}var Gr=typeof Symbol=="function"&&Symbol.for,Nr=Gr?Symbol.for("react.element"):60103;function Zr(r){return r.$$typeof===Nr}function Wr(r){return Array.isArray(r)?[]:{}}function Te(r,t){return t.clone!==!1&&t.isMergeableObject(r)?de(Wr(r),r,t):r}function Hr(r,t,e){return r.concat(t).map(function(i){return Te(i,e)})}function Vr(r,t){if(!t.customMerge)return de;var e=t.customMerge(r);return typeof e=="function"?e:de}function jr(r){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r).filter(function(t){return Object.propertyIsEnumerable.call(r,t)}):[]}function Ii(r){return Object.keys(r).concat(jr(r))}function Si(r,t){try{return t in r}catch{return!1}}function Fr(r,t){return Si(r,t)&&!(Object.hasOwnProperty.call(r,t)&&Object.propertyIsEnumerable.call(r,t))}function Ur(r,t,e){var i={};return e.isMergeableObject(r)&&Ii(r).forEach(function(n){i[n]=Te(r[n],e)}),Ii(t).forEach(function(n){Fr(r,n)||(Si(r,n)&&e.isMergeableObject(t[n])?i[n]=Vr(n,e)(r[n],t[n],e):i[n]=Te(t[n],e))}),i}function de(r,t,e){e=e||{},e.arrayMerge=e.arrayMerge||Hr,e.isMergeableObject=e.isMergeableObject||Dr,e.cloneUnlessOtherwiseSpecified=Te;var i=Array.isArray(t),n=Array.isArray(r),s=i===n;return s?i?e.arrayMerge(r,t,e):Ur(r,t,e):Te(t,e)}de.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(i,n){return de(i,n,e)},{})};var Yr=de,qr=Yr;const ki=ze(qr);/*!
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('.baidu-info-box-container{transform:translateY(-11px);font-size:13px;font-weight:300;width:100vw;cursor:auto;-webkit-user-select:auto!important;user-select:auto!important}.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;-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M19%206.41L17.59%205%2012%2010.59%206.41%205%205%206.41%2010.59%2012%205%2017.59%206.41%2019%2012%2013.41%2017.59%2019%2019%2017.59%2013.41%2012z%22/%3E%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22/%3E%3C/svg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M19%206.41L17.59%205%2012%2010.59%206.41%205%205%206.41%2010.59%2012%205%2017.59%206.41%2019%2012%2013.41%2017.59%2019%2019%2017.59%2013.41%2012z%22/%3E%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22/%3E%3C/svg%3E);background-color:#000}.baidu-info-box-container__close:hover{opacity:1}.baidu-info-box-container:after{position:absolute;background-color:#fff;content:"";width:15px;height:15px;left:0;top:0;box-shadow:-2px 2px 2px #b2b2b266;transform:translate(-50%,-50%) rotate(-45deg)}.gm-style-iw-c .gm-style-iw-chr{display:block}.gm-style-iw-c .gm-style-iw-chr .gm-style-iw-ch{padding-top:12px}.gm-style-iw-c .gm-style-iw-chr button.gm-ui-hover-effect{position:absolute!important;right:-6px;top:-6px;width:14px!important;height:14px!important;margin:8px!important}.gm-style-iw-c .gm-style-iw-chr button.gm-ui-hover-effect span{width:14px!important;height:14px!important;margin:0!important}.gm-style-iw-c .gm-style-iw-d::-webkit-scrollbar{width:12px;height:12px}.element-overlay{position:absolute}.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}.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(t)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
+
(function(a,M){typeof exports=="object"&&typeof module<"u"?M(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],M):(a=typeof globalThis<"u"?globalThis:a||self,M(a.TgMap={},a.Vue))})(this,function(a,M){"use strict";var Xn=Object.defineProperty;var Jn=(a,M,I)=>M in a?Xn(a,M,{enumerable:!0,configurable:!0,writable:!0,value:I}):a[M]=I;var f=(a,M,I)=>(Jn(a,typeof M!="symbol"?M+"":M,I),I);function I(r){throw new Error(r)}function Lt(r){throw new Error(`Unsupported: ${r}`)}function oe(r,t){if(!r)throw new Error(`AssertionError: ${t}`)}function Bt(r){throw new Error(`Unexpected object: ${r}`)}const ve=(...r)=>{};function Qn(){}function It(r){return r}var St;(r=>{function t(e,i,n){const s=e.get(i);return s!==void 0?s:(e.set(i,n()),e.get(i))}r.putIfAbsent=t})(St||(St={}));var $e;(r=>{function t(y,v){return y.length==v.length&&y.every((b,h)=>b===v[h])}r.equals=t;function e(y,v){const b=new Map;for(const h of y)b.set(v(h),h);return b}r.toMapByKey=e;function i(y,v,b=ei){const h=y.findIndex(m=>b(m,v));if(h!==-1)return y.splice(h,1,v)[0];y.push(v)}r.pushOrReplace=i;function n(y,v,b=ei){if(!y.find(h=>b(h,v)))return y.push(v)}r.pushIfNotExists=n;function s(y,v){const b=y.indexOf(v);if(b!==-1)return y.splice(b,1)[0]}r.remove=s;function l(y,v,b){return g(y,h=>b(h,v))}r.removeByEquals=l;function g(y,v){const b=y.findIndex(v);if(b!==-1)return y.splice(b,1)[0]}r.removeBy=g;function o(y,v,b){return v>b?(y.splice(b,0,y[v]),y.splice(v+1,1)):(y.splice(b+1,0,y[v]),y.splice(v,1)),y}r.move=o;function c(y){return Array.isArray(y)?y[0]:y}r.first=c;function u(y){return Array.isArray(y)?y[y.length-1]:y}r.last=u;function d(y,v,b){return Array.from({length:v-y+1},(h,m)=>b(m+y))}r.fromRange=d;function p(y,v){const b=new Map;for(const h of y)St.putIfAbsent(b,v(h),()=>[]).push(h);return b}r.groupBy=p;function _(y){return y.length>0}r.isNotEmpty=_})($e||($e={}));function ei(r,t){return r===t}var ti;(r=>{function t(e){if(e)switch(e.toLowerCase()){case"true":case"y":case"1":return!0;default:return!1}}r.parse=t})(ti||(ti={}));var ii;(r=>{function t(n,s){if(s>=32){const l=(n/4294967296&-1)>>>0;return(1<<s-32&l)!==0}return(1<<s&n)!==0}r.hasFlagInIndex=t;function e(n,s){let l;if(n<0)throw new Error(`value(${n})必须为正数`);return n<2?l=1:n<256?l=8:n<131072?l=16:l=32,s<32-l?n<<s:n*Math.pow(2,s)}r.leftShift=e;function i(n,s){const l=n.toString(16);return"0x"+(s?l.padStart(s,"0"):l)}r.toHex=i})(ii||(ii={}));var ri;(r=>{function t(i,n,s){const l=i[n];return l!==void 0?l:(i[n]=s(),i[n])}r.putIfAbsent=t;function e(i){return i===null?"null":typeof i!="object"?typeof i:i.__v_isVNode?"v-node-object-3":M.isRef(i)?"ref-object":M.isReactive(i)?M.isShallow(i)?"shallow-reactive-object":"reactive-object":M.isReadonly(i)?M.isShallow(i)?"shallow-readonly-object":"readonly-object":"object"}r.vueTypeof=e})(ri||(ri={}));const Mr={basename(r,t){const e=r.endsWith("/")?r.slice(0,-1):r,i=e.lastIndexOf("/"),n=i>=0?e.substring(i+1):e;return t&&n.endsWith(t)?n.slice(0,-t.length):n},resolve(...r){let t="";for(let e of r.reverse())if(e.endsWith("/")&&(e=e.substring(0,e.length-1)),t=t?e+"/"+t:e,t.startsWith("/"))return t;return t}};var ni;(r=>{function t(e,i){for(const n of i)e.add(n);return e}r.addAll=t})(ni||(ni={}));var si;(r=>{function t(g,o,c="children"){function u(d,p=!1){const _=[];for(const y of d){const v=y[c],b=p||o(y),h=v!=null?u(v,b):v;if(b||h!=null&&h.length){const m={...y};h!=null&&(m[c]=h),_.push(m)}}return _}return u(g)}r.searchFilter=t;function e(g,o,c="children",u=[]){return g.map(d=>({...d})).filter(d=>{const p=d[c],_=p&&e(p,o,c,[...u,d]);return _&&(d[c]=_),o(d,u)||(_==null?void 0:_.length)})}r.filter=e;function i(g,o,c="children",u=[]){return g.map((d,p)=>{const _=d[c],y=_&&i(_,o,c,[...u,d]);return o(d,y,u,p)})}r.map=i;function n(g,o,c="children",u=[]){for(const d of g){o(d,u);const p=d[c];p!=null&&p.length&&n(p,o,c,[...u,d])}}r.forEach=n;function s(g,o,c="children",u=[]){for(const d of g){const p=d[c];p!=null&&p.length&&s(p,o,c,[...u,d])}return g.sort((d,p)=>o(d,p,u)),g}r.sort=s;function l(g,o,c="children",u=[]){for(const d of g){if(o(d,u))return d;const p=d[c];if(p!=null&&p.length){const _=l(p,o,c,[...u,d]);if(_)return _}}}r.find=l})(si||(si={}));function J(r,t,e){Object.keys(r).forEach(i=>{i.startsWith("update:")||e!=null&&e.includes(i)||t.addEventListener(i,r[i])})}let Tr=1;function Cr(){return Tr++}function ze(r,t){return t.__id__||(t.__id__=Cr()),`${r}::${t.__id__}`}var kt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ge(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var oi={exports:{}};(function(r){(function(t,e){r.exports?r.exports=e():t.coordtransform=e()})(kt,function(){var t=52.35987755982988,e=3.141592653589793,i=6378245,n=.006693421622965943;function s(h,m,T,C){this.west=Math.min(h,T),this.north=Math.max(m,C),this.east=Math.max(h,T),this.south=Math.min(m,C)}s.prototype.contain=function(h,m){return this.west<=h&&this.east>=h&&this.north>=m&&this.south<=m};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)],g=[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)],o=[new s(114.505238,22.138258,113.845,22.428903),new s(113.97,22.507833,114.45,22.428903)];function c(h,m,T=!0){for(var C=0;C<l.length;C++)if(l[C].contain(h,m)){for(var E=0;E<g.length;E++)if(g[E].contain(h,m))return!1;if(T){for(var E=0;E<o.length;E++)if(o[E].contain(h,m))return!1}return!0}return!1}function u(h,m){var T=h-.0065,C=m-.006,E=Math.sqrt(T*T+C*C)-2e-5*Math.sin(C*t),P=Math.atan2(C,T)-3e-6*Math.cos(T*t),B=E*Math.cos(P),D=E*Math.sin(P);return[B,D]}function d(h,m){var T=Math.sqrt(h*h+m*m)+2e-5*Math.sin(m*t),C=Math.atan2(m,h)+3e-6*Math.cos(h*t),E=T*Math.cos(C)+.0065,P=T*Math.sin(C)+.006;return[E,P]}function p(h,m){return y(h,m)}function _(h,m){var T=y(h,m);return[h*2-T[0],m*2-T[1]]}function y(h,m){var T=v(h-105,m-35),C=b(h-105,m-35),E=m/180*e,P=Math.sin(E);P=1-n*P*P;var B=Math.sqrt(P);T=T*180/(i*(1-n)/(P*B)*e),C=C*180/(i/B*Math.cos(E)*e);var D=m+T,N=h+C;return[N,D]}function v(h,m){var T=-100+2*h+3*m+.2*m*m+.1*h*m+.2*Math.sqrt(Math.abs(h));return T+=(20*Math.sin(6*h*e)+20*Math.sin(2*h*e))*2/3,T+=(20*Math.sin(m*e)+40*Math.sin(m/3*e))*2/3,T+=(160*Math.sin(m/12*e)+320*Math.sin(m*e/30))*2/3,T}function b(h,m){var T=300+h+2*m+.1*h*h+.1*h*m+.1*Math.sqrt(Math.abs(h));return T+=(20*Math.sin(6*h*e)+20*Math.sin(2*h*e))*2/3,T+=(20*Math.sin(h*e)+40*Math.sin(h/3*e))*2/3,T+=(150*Math.sin(h/12*e)+300*Math.sin(h/30*e))*2/3,T}return{rawBd09ToGcj02:u,rawGcj02ToBd09:d,rawWgs84ToGcj02:p,rawGcj02ToWgs84:_,bd09ToGcj02:u,gcj02ToBd09:d,wgs84ToGcj02:function(h,m){return c(h,m)?p(h,m):[h,m]},gcj02ToWgs84:function(h,m){return c(h,m)?_(h,m):[h,m]},bd09ToWgs84:function(h,m){if(!c(h,m,!1))return[h,m];var T=u(h,m);return _(T[0],T[1])},wgs84ToBd09:function(h,m){if(!c(h,m,!1))return[h,m];var T=p(h,m);return d(T[0],T[1])}}})})(oi);var Or=oi.exports;const ae=Ge(Or);function wr(r,t){return r instanceof t}function Er(r,t){if(r instanceof t)return r}function Ne(r,t){return(r==null?void 0:r.$options.name)===t.name}function xt(r,t){return Ne(r,t)?r:void 0}function Ze(r,t,e){let i=t;for(;i;){if(Ne(i,r))return i;if(e&&Ne(i,e))return;i=i.$parent}}function Pr(r){return r}var R=(r=>(r.wgs84="wgs84",r.gcj02="gcj02",r.bd09="bd09",r))(R||{});const At="wgs84",z=class z{constructor(t,e,i){this.lat=t,this.lng=e,this.coord=i}static _normalize(t,e){const i=e>90?90:e<-90?-90:e;return[t>180?(t+180)%360-180:t<-180?(t-180)%360+180:t,i]}static fromBaidu(t,e){return new z(t.lat,t.lng,e)}static fromGoogle(t,e){return new z(t.lat(),t.lng(),e)}static fromHere(t,e){return new z(t.lat,t.lng,e)}static fromLiteral(t){return new z(t.lat,t.lng,t.coord||At)}static fromLngLat(t,e,i=At){return new z(e,t,i)}static create(t,e,i=At){return new z(t,e,i)}to(t){const e=t;if(this.coord===e)return this;const[i,n]=this._convert(e);return new z(n,i,e)}toBaidu(t,e=!1){let i=this.lat,n=this.lng;return this.coord!==t&&([n,i]=this._convert(t)),e&&([n,i]=z._normalize(n,i)),new BMap.Point(n,i)}toGoogle(t){let e=this.lat,i=this.lng;return this.coord!==t&&([i,e]=this._convert(t)),new google.maps.LatLng(e,i)}toHere(t){let e=this.lat,i=this.lng;return this.coord!==t&&([i,e]=this._convert(t)),new H.geo.Point(e,i)}_convert(t){switch(this.coord){case"bd09":return t==="gcj02"?ae.bd09ToGcj02(this.lng,this.lat):ae.bd09ToWgs84(this.lng,this.lat);case"gcj02":return t==="wgs84"?ae.gcj02ToWgs84(this.lng,this.lat):ae.gcj02ToBd09(this.lng,this.lat);case"wgs84":return t==="bd09"?ae.wgs84ToBd09(this.lng,this.lat):ae.wgs84ToGcj02(this.lng,this.lat)}throw new Error(`不支持的坐标转换: ${this.coord}=>${t}`)}normalize(){const[t,e]=z._normalize(this.lng,this.lat);return e===this.lat&&t===this.lng?this:new z(e,t,this.coord)}equals(t){return this===t?!0:this.lat===t.lat&&this.lng===t.lng&&this.coord===t.coord}toString(){return JSON.stringify(this)}};f(z,"ZERO",z.create(0,0));let w=z;const re=class re{constructor(t,e){f(this,"coord");this.sw=t,this.ne=e,oe(t.coord===e.coord,"sw和ne的coord应该相同"),oe(Number.isFinite(t.lat)&&Number.isFinite(t.lng)&&Number.isFinite(e.lat)&&Number.isFinite(e.lng),`sw(${t})和ne(${e})不能包含NaN或Infinite`),oe(t.lat<=e.lat,`sw.lat(${t.lat})应该比ne.lat(${e.lat})小`),this.coord=t.coord}static isBetweenLng(t,e,i){return t<=e?t<=i&&i<=e:t<=i||i<=e}static fromArray(t){if(t.length===0)return;const e=new re.Builder(t[0]);for(let i=1;i<t.length;i++)e.include(t[i]);return e.build()}static from(...t){return this.fromArray(t)??I("positions中没有点")}static fromGoogle(t,e){return new re(w.fromGoogle(t.getSouthWest(),e),w.fromGoogle(t.getNorthEast(),e))}static fromBaidu(t,e){return new re(w.fromBaidu(t.getSouthWest(),e),w.fromBaidu(t.getNorthEast(),e))}static create(t,e){return this.from(t,e)}isEmpty(){return this.sw.equals(this.ne)}contains(t){const{lat:e,lng:i}=t.to(this.coord);return this.sw.lat<=e&&e<=this.ne.lat&&re.isBetweenLng(this.sw.lng,this.ne.lng,i)}getCenter(){if(this.sw.equals(this.ne))return this.sw;const t=(this.sw.lat+this.ne.lat)/2,e=(this.sw.lng+this.ne.lng+(this.sw.lng<this.ne.lng?0:360))/2;return w.create(t,e,this.coord)}toString(){return JSON.stringify(this)}equals(t){return this.sw.equals(t.sw)&&this.ne.equals(t.ne)}toRectArray(){const t=this.sw.coord;return[this.sw,w.fromLngLat(this.sw.lng,this.ne.lat,t),this.ne,w.fromLngLat(this.ne.lng,this.sw.lat,t)]}toGoogle(t){return new google.maps.LatLngBounds(this.sw.toGoogle(t),this.ne.toGoogle(t))}toBaidu(t){return new BMap.Bounds(this.sw.toBaidu(t),this.ne.toBaidu(t))}toBaiduArray(t){return[this.sw.toBaidu(t),this.ne.toBaidu(t)]}};f(re,"EMPTY",new re(w.ZERO,w.ZERO));let V=re;(r=>{class t{constructor(i){f(this,"coord");f(this,"minLat");f(this,"minLng");f(this,"maxLat");f(this,"maxLng");this.coord=i.coord,this.minLat=this.maxLat=i.lat,this.minLng=this.maxLng=i.lng}build(){return new r(w.create(this.minLat,this.minLng,this.coord),w.create(this.maxLat,this.maxLng,this.coord))}include(i){const{lat:n,lng:s}=i.to(this.coord);return this.minLat=Math.min(this.minLat,n),this.maxLat=Math.max(this.maxLat,n),r.isBetweenLng(this.minLng,this.maxLng,s)||(this.delta(this.minLng,s)<this.delta(s,this.maxLng)?this.minLng=s:this.maxLng=s),this}delta(i,n){return(i-n+360)%360}}r.Builder=t})(V||(V={})),a.Location=void 0,(r=>{function t(i,n){if(i==null)return;if(typeof i=="string")return i;const s=i.to(n);return`${s.lat},${s.lng}`}r.toString=t;function e(i){return typeof i=="string"||i==null?void 0:i.coord}r.getCoordType=e})(a.Location||(a.Location={}));function ai(){BMap.OverlayV3||(BMap.OverlayV3=BMap.Overlay)}function Lr(){const r=window.$BAIDU$;"kT"in r||Object.defineProperty(r,"kT",{get:()=>r._instances,enumerable:!0,configurable:!0})}const li={equals(r,t){return r.lat===t.lat&&r.lng===t.lng}};var Rt;(r=>{function t(e){return e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight}r.isScrollable=t})(Rt||(Rt={})),a.Arrays=void 0,(r=>{function t(n,s){for(const l of n)if(l instanceof s)return l}r.findByType=t;function e(n,s){return n.includes(s)}r.includesTyped=e;function i(n,s,l){const g=s>=0?s:n.length+s;if(l===void 0)return n[g];n[g]=l}r.at=i})(a.Arrays||(a.Arrays={})),a.MVCArrays=void 0,(r=>{function t(n,s){const l=n.getLength();for(let g=0;g<l;g++)if(n.getAt(g)===s)return g;return-1}r.indexOf=t;function e(n,s){const l=t(n,s);if(l!==-1)return n.removeAt(l)}r.remove=e;function i(n,s){return[n.addListener("insert_at",s),n.addListener("remove_at",s),n.addListener("set_at",s)]}r.listenChanged=i})(a.MVCArrays||(a.MVCArrays={}));function hi(r,t,e){return r.addListener(t,e).remove}function Br(r,t,e){return r.addEventListener(t,e),()=>r.removeEventListener(t,e)}function Ir(r,t,e,i){return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}function ci(r,t,e){return r.addEventListener(t,e),()=>r.removeEventListener(t,e)}class di{constructor(t,e){f(this,"eventMap",new Map);f(this,"target",void 0);this.inner=t,this.coordTypeSupplier=e,this.addEventListener=this.addEventListener.bind(this),this.removeEventListener=this.removeEventListener.bind(this)}setTarget(t){return this.target=t,this}}class We{constructor(t,e){f(this,"eventHub",new ui);this.delegate=t,this.options=e}notify(t){this.eventHub.notify(t)}hasListener(t){return this.eventHub.hasListener(t)}setTarget(t){return this.delegate.setTarget(t),this}addEventListener(t,e){if(a.Arrays.includesTyped(this.options.types,t)){this.eventHub.hasListener(t)||this.options.onListen(t),this.eventHub.addEventListener(t,e);return}this.delegate.addEventListener(t,e)}removeEventListener(t,e){if(a.Arrays.includesTyped(this.options.types,t)){this.eventHub.removeEventListener(t,e),this.eventHub.hasListener(t)||this.options.onCancel(t);return}this.delegate.removeEventListener(t,e)}}const Et=class Et extends di{addEventListener(t,e){const i=ze(t,e);if(this.eventMap.get(i)){console.warn("listener已经添加过了",i,e);return}const n=this.inner.addListener(Et.EVENT_TYPE_MAP[t]||t,s=>{const l={type:t,target:this.target,originalEvent:s};s!=null&&s.latLng&&(l.position=w.fromGoogle(s.latLng,this.coordTypeSupplier.coordType)),e.call(this.target,l)});this.eventMap.set(i,n)}removeEventListener(t,e){const i=ze(t,e),n=this.eventMap.get(i);n?(n.remove(),this.eventMap.delete(i)):console.warn("移除失败, 不存在该listener",i,e)}};f(Et,"EVENT_TYPE_MAP",{"center-changed":"center_changed","zoom-changed":"zoom_changed","radius-changed":"radius_changed","bounds-changed":"bounds_changed","map-type-changed":"maptypeid_changed","map-mousedown":"mousedown","map-mousemove":"mousemove","map-mouseup":"mouseup","map-dblclick":"dblclick"});let le=Et;const ke=class ke extends di{addEventListener(t,e){const i=ze(t,e);if(this.eventMap.get(i)){console.warn("listener已经添加过了",i,e);return}const n=s=>{const l={type:t,target:this.target,originalEvent:s};s.point&&(l.position=w.fromBaidu(s.point,this.coordTypeSupplier.coordType)),e.call(this.target,l)};this.inner.addEventListener(ke.EVENT_TYPE_MAP[t]||t,n),this.eventMap.set(i,n)}removeEventListener(t,e){const i=ze(t,e),n=this.eventMap.get(i);n?(this.inner.removeEventListener(ke.EVENT_TYPE_MAP[t]||t,n),this.eventMap.delete(i)):console.warn("移除失败, 不存在该listener",i,e)}};f(ke,"EVENT_TYPE_MAP",{drag:"dragging",closeclick:"clickclose",contextmenu:"rightclick","zoom-changed":"zoomend","map-type-changed":"maptypechange"});let _e=ke;class ui{constructor(){f(this,"typeMap",new Map)}addEventListener(t,e){let i=this.typeMap.get(t);i||(i=[],this.typeMap.set(t,i)),!i.includes(e)&&i.push(e)}removeEventListener(t,e){const i=this.typeMap.get(t);i&&$e.remove(i,e)}hasListener(t){const e=this.typeMap.get(t);return e!=null&&e.length>0}notify(t){const e=this.typeMap.get(t.type);e&&e.forEach(i=>i.call(t.target,t))}}class Dt{constructor(t,e){f(this,"keyToValue",new Map);f(this,"valueToKey",new Map);oe(t.length===e.length);for(let i=t.length-1;i>=0;i--)this.keyToValue.set(t[i],e[i]),this.valueToKey.set(e[i],t[i])}toKey(t){return this.valueToKey.get(t)??I()}toValue(t){return this.keyToValue.get(t)??I()}}class pi{constructor(t,e=10){f(this,"map",new Map);this.values=t,this.maxSize4Debug=e}getValueMap(t){let e=this.map.get(t);if(!e){e=new Map;for(let i=this.values.length-1;i>=0;i--){const n=this.values[i];e.set(t.call(n),n)}this.map.set(t,e),process.env.NODE_ENV!=="production"&&this.map.size>this.maxSize4Debug&&console.warn(`this.map的大小(${this.map.size})超过了设置的最大大小(${this.maxSize4Debug}), 这可能是由于你每次都创建新的keySelector造成的, 请保证相同功能的keySelector只创建一个对象`)}return e}getOrNull(t,e){return this.getValueMap(t).get(e)}get(t,e){return this.getOrNull(t,e)??I(`key(${e})不存在与valueMap(${this.getValueMap(t)})中`)}}class he{constructor(t){f(this,"value");this.creator=t}get(){return this.value===void 0&&(this.value=this.creator()),this.value}}var k=(r=>(r.TOP_LEFT="top-left",r.TOP_CENTER="top-center",r.TOP_RIGHT="top-right",r.BOTTOM_LEFT="bottom-left",r.BOTTOM_CENTER="bottom-center",r.BOTTOM_RIGHT="bottom-right",r.LEFT_TOP="left-top",r.LEFT_CENTER="left-center",r.LEFT_BOTTOM="left-bottom",r.RIGHT_TOP="right-top",r.RIGHT_CENTER="right-center",r.RIGHT_BOTTOM="right-bottom",r))(k||{});a.ControlPositionConverter=void 0,(r=>{let t,e;const i=["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 t||(t=new Dt(i,[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])),t}r.getBaidu=n;function s(){return e||(e=new Dt(i,[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])),e}r.getGoogle=s})(a.ControlPositionConverter||(a.ControlPositionConverter={}));class gi{constructor(t){f(this,"inner");this.position=t}}class He{}class mi extends He{constructor(t,e){super(),this.visible=t,this.position=e}isVisible(){return this.visible}setVisible(t){this.visible=t}getPosition(){return this.position}setPosition(t){this.position=t}addTo(t){}removeFrom(t){}}class Ve extends He{constructor(t,e){super(),this.inner=t,this.position=e}isVisible(){return this.inner.isVisible()}setVisible(t){t?this.inner.show():this.inner.hide()}getPosition(){return this.position??a.ControlPositionConverter.getBaidu().toKey(this.inner.getAnchor())}setPosition(t){this.position=t,this.inner.setAnchor(a.ControlPositionConverter.getBaidu().toValue(t))}addTo(t){t.innerMap.addControl(this.inner)}removeFrom(t){t.innerMap.removeControl(this.inner)}}class be extends He{constructor(e,i){super();f(this,"visible",!1);f(this,"map");this._type=e,this.position=i}isVisible(){return this.visible}setVisible(e){this.visible=e,this.tryUpdateOptions()}getPosition(){return this.position}setPosition(e){this.position=e,this.tryUpdateOptions()}addTo(e){this.map||(this.map=e,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 $t=(r=>(r.normal="normal",r.satellite="satellite",r.hybrid="hybrid",r))($t||{});class Z{constructor(t,e,i,n){this.id=t,this.baidu=e,this.google=i,this.googleCoordType=n}getId(){return this.id}getBaiduCoordType(){return R.bd09}asBaiduMapType(){return this.baidu()}getGoogleCoordType(){return this.googleCoordType}getGoogleMapTypeId(){return this.google()}asGoogleMapType(){Lt("google的内置地图没有对应的实例")}}class Sr{constructor(t,e){f(this,"baiduLayerCached",new he(()=>{const t=new BMap.TileLayer({});return t.getTilesUrl=(e,i)=>{const n=Math.pow(2,i-1),s=e.x+n,l=n-1-e.y;return this.options.getTileUrl({x:s,y:l},i)},t}));f(this,"baiduMapTypeCached",new he(()=>{const t=new BMap.MapType(this.options.name,this.baiduLayerCached.get(),{maxZoom:this.options.maxZoom,minZoom:this.options.minZoom,tips:this.options.describe});return t.__baidu_map_type__=this,t}));f(this,"googleCached",new he(()=>{const t=new google.maps.ImageMapType({getTileUrl:(e,i)=>this.options.getTileUrl(e,i),tileSize:new google.maps.Size(256,256),name:this.options.name,alt:this.options.describe,maxZoom:this.options.maxZoom,minZoom:this.options.minZoom});return t.__google_map_type__=this,t}));this.coordType=t,this.options=e}get id(){return this.options.id}getBaiduCoordType(){return this.coordType}asBaiduMapType(){return this.baiduMapTypeCached.get()}asBaiduLayer(){return this.baiduLayerCached.get()}getGoogleCoordType(){return this.coordType}asGoogleMapType(){return this.googleCached.get()}asGoogleLayer(){Lt("这个方法不会被调用")}}class fi{constructor(){f(this,"baiduCache",new he(()=>new BMap.TrafficLayer));f(this,"googleCache",new he(()=>new google.maps.TrafficLayer))}asBaiduLayer(){return this.baiduCache.get()}asGoogleLayer(){return this.googleCache.get()}}a.MapType=void 0,(r=>{r.NORMAL=new Z("normal",()=>BMAP_NORMAL_MAP,()=>google.maps.MapTypeId.ROADMAP,R.gcj02),r.SATELLITE=new Z("satellite",()=>BMAP_SATELLITE_MAP,()=>google.maps.MapTypeId.SATELLITE,R.wgs84),r.HYBRID=new Z("hybrid",()=>BMAP_HYBRID_MAP,()=>google.maps.MapTypeId.HYBRID,R.gcj02),r.TERRAIN=new Z("terrain",()=>BMAP_PERSPECTIVE_MAP,()=>google.maps.MapTypeId.TERRAIN,R.wgs84),r.BUILD_IN_MAP_TYPES=new pi([r.NORMAL,r.SATELLITE,r.HYBRID,r.TERRAIN])})(a.MapType||(a.MapType={}));var zt=(r=>(r.DEFAULT="default",r.HORIZONTAL="horizontal",r.DROPDOWN="dropdown",r))(zt||{});const yi=[a.MapType.NORMAL,a.MapType.SATELLITE,a.MapType.HYBRID];class je extends Ve{static create(t){const e=t.mapTypes??yi,i={default:BMAP_MAPTYPE_CONTROL_HORIZONTAL,horizontal:BMAP_MAPTYPE_CONTROL_HORIZONTAL,dropdown:BMAP_MAPTYPE_CONTROL_DROPDOWN},n=new BMap.MapTypeControl({type:t.type&&i[t.type],mapTypes:e.map(s=>s.asBaiduMapType())});return t.position&&n.setAnchor(a.ControlPositionConverter.getBaidu().toValue(t.position)),new je(n,t.position)}}const se=class se extends be{constructor(t="default",e=k.TOP_LEFT,i=yi){super("mapType",e),this.type=t,this.mapTypes=i,se.type2google||(se.type2google={default:google.maps.MapTypeControlStyle.DEFAULT,horizontal:google.maps.MapTypeControlStyle.HORIZONTAL_BAR,dropdown:google.maps.MapTypeControlStyle.DROPDOWN_MENU})}static create(t){return new se(t.type,t.position,t.mapTypes)}onCreateOptions(){const t=super.onCreateOptions();return t.style=se.type2google[this.type],t.mapTypeIds=this.mapTypes.map(e=>e instanceof Z?e.getGoogleMapTypeId():e.id),t}addTo(t){super.addTo(t),this.mapTypes.forEach(e=>{e instanceof Z||t.innerMap.mapTypes.set(e.id,e.asGoogleMapType())})}};f(se,"type2google");let Fe=se;class Ue extends Ve{static create(t){const e=new BMap.ScaleControl({anchor:t.position&&a.ControlPositionConverter.getBaidu().toValue(t.position)});return new Ue(e,t.position)}}class Ye extends be{static create(t){return new Ye(t.position)}constructor(t=k.BOTTOM_RIGHT){super("scale",t)}}class qe extends mi{static create(t){return new qe(!0,t.position??k.RIGHT_BOTTOM)}}class Ke extends be{static create(t){return new Ke(t.position)}constructor(t=k.RIGHT_BOTTOM){super("streetView",t)}}class Xe extends Ve{static create(t){const e=new BMap.NavigationControl({type:BMAP_NAVIGATION_CONTROL_ZOOM,anchor:t.position&&a.ControlPositionConverter.getBaidu().toValue(t.position)});return new Xe(e,t.position)}}class Je extends be{static create(t){return new Je(t.position)}constructor(t=k.RIGHT_BOTTOM){super("zoom",t)}}function kr(r){let t,e,i;const n="The Google Maps JavaScript API",s="google",l="importLibrary",g="__ib__",o=document,c=window,u=c[s]||(c[s]={}),d=u.maps||(u.maps={}),p=new Set,_=new URLSearchParams,y=()=>t||(t=new Promise(async(v,b)=>{var h;await(e=o.createElement("script")),_.set("libraries",[...p]+"");for(i in r)_.set(i.replace(/[A-Z]/g,m=>"_"+m[0].toLowerCase()),r[i]);_.set("callback",s+".maps."+g),e.src=`https://maps.${s}apis.com/maps/api/js?`+_,d[g]=v,e.onerror=()=>t=b(Error(n+" could not load.")),e.nonce=((h=o.querySelector("script[nonce]"))==null?void 0:h.nonce)||"",o.head.append(e)}));d[l]?console.warn(n+" only loads once. Ignoring:",r):d[l]=(v,...b)=>p.add(v)&&y().then(()=>d[l](v,...b))}let xr,Ar;const ie={get LATLNG_ZERO(){return xr??(xr=new google.maps.LatLng({lat:0,lng:0}))},get BOUNDS_ZERO(){return Ar??(Ar=new google.maps.LatLngBounds(this.LATLNG_ZERO,this.LATLNG_ZERO))}};function vi(r,t={country:"",province:"",city:"",district:"",street:"",streetNumber:""}){for(const e of r)for(const i of e.types)switch(i){case"street_number":t.streetNumber=e.long_name;break;case"route":t.street=e.long_name;break;case"locality":t.city=e.long_name;break;case"sublocality":t.district=e.long_name;break;case"administrative_area_level_1":t.province=e.long_name;break;case"country":t.country=e.long_name;break}return t}function _i(r,t){var i;const e=r.address_components&&vi(r.address_components);return{country:(e==null?void 0:e.country)??"",province:(e==null?void 0:e.province)??"",city:(e==null?void 0:e.city)??"",id:r.place_id??"",address:r.formatted_address??"",position:w.fromGoogle(((i=r.geometry)==null?void 0:i.location)??ie.LATLNG_ZERO,t.coordType),title:r.name??""}}class Gt{}class bi extends Gt{constructor(e,i){super();f(this,"inner");this.map=e,this.inner=new google.maps.places.Autocomplete(i.input,{fields:["address_components","name"]}),i.bindToMap&&this.inner.bindTo("bounds",e.innerMap)}setBounds(e){this.inner.setBounds(e.toGoogle(this.map.coordType))}addResultListener(e){return hi(this.inner,"place_changed",()=>{const i=this.inner.getPlace(),n={title:i.name??"",province:"",city:"",district:"",street:"",streetNumber:"",country:""};i.address_components&&vi(i.address_components,n),e(n)})}}class Mi extends Gt{constructor(e,i){super();f(this,"inner");f(this,"input");f(this,"removeableArray",[]);if(this.map=e,this.input=i.input,this.inner=new BMap.Autocomplete({input:i.input,location:i.bindToMap?e.innerMap:void 0}),i.bindToMap){const n=()=>{this.inner.setLocation(this.map.innerMap)};this.removeableArray.push(ci(this.map,"center-changed",n)),this.removeableArray.push(ci(this.map,"zoom-changed",n))}}setBounds(e){this.inner.setLocation(e.getCenter().toBaidu(this.map.coordType))}addResultListener(e){let i=0;const n=Br(this.inner,"confirm",l=>{const g=l.item.value;i=Date.now(),e(Object.assign({title:g.business,country:""},g))}),s=Ir(this.input,"keyup",l=>{l.key==="Enter"&&Date.now()-i>100&&e({title:this.input.value,country:"",city:"",district:"",province:"",street:"",streetNumber:""})});return()=>{s(),n()}}}var Ti={exports:{}};(function(r,t){(function(e,i){r.exports=i()})(kt,function(){const e=function(){var s={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.45:"rgb(0,0,255)",.55:"rgb(0,255,255)",.65:"rgb(0,255,0)",.95:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},l=function(){var _=function(b){this._coordinator={},this._data=[],this._radi=[],this._min=0,this._max=1,this._xField=b.xField||b.defaultXField,this._yField=b.yField||b.defaultYField,this._valueField=b.valueField||b.defaultValueField,b.radius&&(this._cfgRadius=b.radius)},y=s.defaultRadius;return _.prototype={_organiseData:function(v,b){var h=v[this._xField],m=v[this._yField],T=this._radi,C=this._data,E=this._max,P=this._min,B=v[this._valueField]||1,D=v.radius||this._cfgRadius||y;return C[h]||(C[h]=[],T[h]=[]),C[h][m]?C[h][m]+=B:(C[h][m]=B,T[h][m]=D),C[h][m]>E?(b?this.setDataMax(C[h][m]):this._max=C[h][m],!1):{x:h,y:m,value:B,radius:D,min:P,max:E}},_unOrganizeData:function(){var v=[],b=this._data,h=this._radi;for(var m in b)for(var T in b[m])v.push({x:m,y:T,radius:h[m][T],value:b[m][T]});return{min:this._min,max:this._max,data:v}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(arguments[0].length>0)for(var v=arguments[0],b=v.length;b--;)this.addData.call(this,v[b]);else{var h=this._organiseData(arguments[0],!0);h&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[h]})}return this},setData:function(v){var b=v.data,h=b.length;this._data=[],this._radi=[];for(var m=0;m<h;m++)this._organiseData(b[m],!1);return this._max=v.max,this._min=v.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(v){return this._max=v,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(v){return this._min=v,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(v){this._coordinator=v},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},_}(),g=function(){var _=function(h){var m=h.gradient||h.defaultGradient,T=document.createElement("canvas"),C=T.getContext("2d");T.width=256,T.height=1;var E=C.createLinearGradient(0,0,256,1);for(var P in m)E.addColorStop(P,m[P]);return C.fillStyle=E,C.fillRect(0,0,256,1),C.getImageData(0,0,256,1).data},y=function(h,m){var T=document.createElement("canvas"),C=T.getContext("2d"),E=h,P=h;if(T.width=T.height=h*2,m==1)C.beginPath(),C.arc(E,P,h,0,2*Math.PI,!1),C.fillStyle="rgba(0,0,0,1)",C.fill();else{var B=C.createRadialGradient(E,P,h*m,E,P,h);B.addColorStop(0,"rgba(0,0,0,1)"),B.addColorStop(1,"rgba(0,0,0,0)"),C.fillStyle=B,C.fillRect(0,0,2*h,2*h)}return T},v=function(P){for(var m=[],T=P.min,C=P.max,E=P.radi,P=P.data,B=Object.keys(P),D=B.length;D--;)for(var N=B[D],S=Object.keys(P[N]),ee=S.length;ee--;){var A=S[ee],Y=P[N][A],te=E[N][A];m.push({x:N,y:A,value:Y,radius:te})}return{min:T,max:C,data:m}};function b(h){var m=h.element,T=this.shadowCanvas=document.createElement("canvas"),C=this.canvas=h.canvas||document.createElement("canvas");this._renderBoundaries=[1e4,1e4,0,0];var E=getComputedStyle(h.element)||{};C.className="heatmap-canvas",this._width=C.width=T.width=+E.width.replace(/px/,""),this._height=C.height=T.height=+E.height.replace(/px/,""),this.shadowCtx=T.getContext("2d"),this.ctx=C.getContext("2d"),C.style.cssText=T.style.cssText="position:absolute;left:0;top:0;",m.style.position="relative",m.appendChild(C),this._palette=_(h),this._templates={},this._setStyles(h)}return b.prototype={renderPartial:function(h){this._drawAlpha(h),this._colorize()},renderAll:function(h){this._clear(),this._drawAlpha(v(h)),this._colorize()},_updateGradient:function(h){this._palette=_(h)},updateConfig:function(h,m){h.gradient!==m.gradient&&this._updateGradient(h),this._setStyles(h)},setDimensions:function(h,m){this._width=h,this._height=m,this.canvas.width=this.shadowCanvas.width=h,this.canvas.height=this.shadowCanvas.height=m},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(h){this._blur=h.blur==0?0:h.blur||h.defaultBlur,h.backgroundColor&&(this.canvas.style.backgroundColor=h.backgroundColor),this._opacity=(h.opacity||0)*255,this._maxOpacity=(h.maxOpacity||h.defaultMaxOpacity)*255,this._minOpacity=(h.minOpacity||h.defaultMinOpacity)*255,this._useGradientOpacity=!!h.useGradientOpacity},_drawAlpha:function(C){for(var m=this._min=C.min,T=this._max=C.max,C=C.data||[],E=C.length,P=1-this._blur;E--;){var B=C[E],D=B.x,N=B.y,S=B.radius,ee=Math.min(B.value,T),A=D-S,Y=N-S,te=this.shadowCtx,q;this._templates[S]?q=this._templates[S]:this._templates[S]=q=y(S,P),te.globalAlpha=(ee-m)/(T-m),te.drawImage(q,A,Y),A<this._renderBoundaries[0]&&(this._renderBoundaries[0]=A),Y<this._renderBoundaries[1]&&(this._renderBoundaries[1]=Y),A+2*S>this._renderBoundaries[2]&&(this._renderBoundaries[2]=A+2*S),Y+2*S>this._renderBoundaries[3]&&(this._renderBoundaries[3]=Y+2*S)}},_colorize:function(){var h=this._renderBoundaries[0],m=this._renderBoundaries[1],T=this._renderBoundaries[2]-h,C=this._renderBoundaries[3]-m,E=this._width,P=this._height,B=this._opacity,D=this._maxOpacity,N=this._minOpacity,S=this._useGradientOpacity;h<0&&(h=0),m<0&&(m=0),h+T>E&&(T=E-h),m+C>P&&(C=P-m);for(var ee=this.shadowCtx.getImageData(h,m,T,C),A=ee.data,Y=A.length,te=this._palette,q=3;q<Y;q+=4){var Pt=A[q],Re=Pt*4;if(Re){var De;B>0?De=B:Pt<D?Pt<N?De=N:De=Pt:De=D,A[q-3]=te[Re],A[q-2]=te[Re+1],A[q-1]=te[Re+2],A[q]=S?te[Re+3]:De}}this.ctx.putImageData(ee,h,m),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(h){var m,T=this.shadowCtx,C=T.getImageData(h.x,h.y,1,1),E=C.data[3],P=this._max,B=this._min;return m=Math.abs(P-B)*(E/255)>>0,m},getDataURL:function(){return this.canvas.toDataURL()}},b}(),o=function(){var _=!1;return s.defaultRenderer==="canvas2d"&&(_=g),_}(),c={merge:function(){for(var p={},_=arguments.length,y=0;y<_;y++){var v=arguments[y];for(var b in v)p[b]=v[b]}return p}},u=function(){var _=function(){function h(){this.cStore={}}return h.prototype={on:function(m,T,C){var E=this.cStore;E[m]||(E[m]=[]),E[m].push(function(P){return T.call(C,P)})},emit:function(m,T){var C=this.cStore;if(C[m])for(var E=C[m].length,P=0;P<E;P++){var B=C[m][P];B(T)}}},h}(),y=function(b){var h=b._renderer,m=b._coordinator,T=b._store;m.on("renderpartial",h.renderPartial,h),m.on("renderall",h.renderAll,h),m.on("extremachange",function(C){b._config.onExtremaChange&&b._config.onExtremaChange({min:C.min,max:C.max,gradient:b._config.gradient||b._config.defaultGradient})}),T.setCoordinator(m)};function v(){var b=this._config=c.merge(s,arguments[0]||{});if(this._coordinator=new _,b.plugin){var h=b.plugin;if(s.plugins[h]){var m=s.plugins[h];this._renderer=new m.renderer(b),this._store=new m.store(b)}else throw new Error("Plugin '"+h+"' not found. Maybe it was not registered.")}else this._renderer=new o(b),this._store=new l(b);y(this)}return v.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(b){const h=this._config;return this._config=c.merge(this._config,b),this._renderer.updateConfig(this._config,h),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(b){return this._store.getValueAt?this._store.getValueAt(b):this._renderer.getValueAt?this._renderer.getValueAt(b):null}},v}(),d={create:function(p){return new u(p)},register:function(p,_){s.plugins[p]=_}};return d}();var i=function(s){Reflect.getPrototypeOf(i.prototype)!==BMap.Overlay.prototype&&Reflect.setPrototypeOf(i.prototype,BMap.Overlay.prototype),this.conf=s,this.conf.visible=s.visible===void 0?!0:s.visible,this.heatmap=null,this.latlngs=[],this.bounds=null};i.prototype=Object.create(typeof BMap>"u"?null:BMap.Overlay.prototype),i.prototype.initialize=function(s){this._map=s;var l=document.createElement("div");if(l.style.position="absolute",l.style.top=0,l.style.left=0,l.style.border=0,l.style.width=this._map.getSize().width+"px",l.style.height=this._map.getSize().height+"px",this.conf.element=l,!n())return l;s.getPanes().mapPane.appendChild(l),this.conf.valueField=this.conf.valueField||"count",this.heatmap=e.create(this.conf);var g=this;return s.addEventListener("resize",function(o){var c=o.size;l.style.width=c.width+"px",l.style.height=c.height+"px",g.heatmap._renderer.setDimensions(c.width,c.height),g.draw()}),this._div=l,l},i.prototype.draw=function(){if(n()){var s=this._map.getBounds();if(!s.equals(this.bounds)){this.bounds=s;var l=this._map.pointToOverlayPixel(s.getNorthEast()),g=this._map.pointToOverlayPixel(s.getSouthWest()),o=l.y,c=g.x,u=g.y-l.y,d=l.x-g.x;if(this.conf.element.style.left=c+"px",this.conf.element.style.top=o+"px",this.conf.element.style.width=d+"px",this.conf.element.style.height=u+"px",this.latlngs.length>0){this.heatmap.removeData();var p=this.latlngs.length;const h={max:this.heatmap._store.getData().max,data:[]};for(;p--;){var _=this.latlngs[p].latlng;if(s.containsPoint(_)){var y=this._map.pointToOverlayPixel(_),c=this._map.pointToOverlayPixel(s.getSouthWest()).x,o=this._map.pointToOverlayPixel(s.getNorthEast()).y,v=new BMap.Pixel(y.x-c,y.y-o),b=this.pixelTransform(v);h.data.push({x:b.x,y:b.y,count:this.latlngs[p].c})}}this.conf.radiusChangeByZoom&&(this.heatmap._store._cfgRadius=this.conf.radiusChangeByZoom(this._map.getZoom())),this.heatmap.setData(h)}}}},i.prototype.pixelTransform=function(s){for(var l=this.heatmap.width,g=this.heatmap.height;s.x<0;)s.x+=l;for(;s.x>l;)s.x-=l;for(;s.y<0;)s.y+=g;for(;s.y>g;)s.y-=g;return s.x=s.x>>0,s.y=s.y>>0,s},i.prototype.setDataSet=function(s){if(this.data=s,!!n()){var l=this._map.getBounds(),g={max:s.max,data:[]},o=s.data,c=o.length;for(this.latlngs=[],this.heatmap.removeData(),this.conf.radiusChangeByZoom&&(this.heatmap._store._cfgRadius=this.conf.radiusChangeByZoom(this._map.getZoom()));c--;){var u=new BMap.Point(o[c].lng,o[c].lat);if(this.latlngs.push({latlng:u,c:o[c].count}),!!l.containsPoint(u)){var d=this._map.pointToOverlayPixel(u),p=this._map.pointToOverlayPixel(l.getSouthWest()).x,_=this._map.pointToOverlayPixel(l.getNorthEast()).y,y=new BMap.Pixel(d.x-p,d.y-_),v=this.pixelTransform(y);g.data.push({x:v.x,y:v.y,count:o[c].count})}}this.heatmap.setData(g)}},i.prototype.addDataPoint=function(s,l,g){if(n()){this.data&&this.data.data&&this.data.data.push({lng:s,lat:l,count:g});var o=new BMap.Point(s,l),c=this.pixelTransform(this._map.pointToOverlayPixel(o));this.heatmap.store.addDataPoint(c.x,c.y,g),this.latlngs.push({latlng:o,c:g})}},i.prototype.toggle=function(){n()&&(this.conf.visible===!0?this.conf.visible=!1:this.conf.visible=!0,this.conf.visible?this.conf.element.style.display="block":this.conf.element.style.display="none")},i.prototype.setOptions=function(s){if(n()){for(var l in s)l=="radius"&&(this.heatmap._store._cfgRadius=s[l]);this.heatmap.configure(s),this.data&&this.setDataSet(this.data)}};function n(){var s=document.createElement("canvas");return!!(s.getContext&&s.getContext("2d"))}return i})})(Ti);var Rr=Ti.exports;const Dr=Ge(Rr),Ci=10,Qe={toGoogle:(r,t)=>({opacity:r.opacity,radius:r.radius??Ci,gradient:r.gradient&&Object.entries(r.gradient).sort(([e],[i])=>+e-+i).map(([e,i])=>i),maxIntensity:r.maxIntensity,data:et.toGoogle(r.data,t)}),toBaidu:(r,t,e)=>({opacity:r.opacity,radius:r.radius??Ci,gradient:r.gradient,data:et.toBaidu(r.data,t,e)})},et={toGoogle:(r,t)=>r.map(e=>"weight"in e?{weight:e.weight,location:e.position.toGoogle(t)}:e.toGoogle(t)),toBaidu:(r,t,e)=>{let i=1;return{data:r.map(s=>{let l,g;return"weight"in s?(l=s.position.to(t),g=s.weight):(l=s.to(t),g=1),i<g&&(i=g),{lng:l.lng,lat:l.lat,count:g}}),max:e??i}}};class Nt{}class Oi extends Nt{constructor(e,i){super();f(this,"inner");this.map=e,this.inner=new google.maps.visualization.HeatmapLayer(Qe.toGoogle(i,this.map.coordType)),this.inner.setMap(e.innerMap)}setData(e){this.inner.setData(et.toGoogle(e,this.map.coordType))}setOptions(e){this.inner.setOptions(Qe.toGoogle(e,this.map.coordType))}remove(){this.inner.setMap(null)}}class wi extends Nt{constructor(e,i){super();f(this,"inner");this.map=e;const n=Qe.toBaidu(i,this.map.coordType,i.maxIntensity);this.inner=new Dr(n),e.innerMap.addOverlay(this.inner),this.inner.setDataSet(n.data)}get innerDataMax(){var e;return(e=this.inner.data)==null?void 0:e.max}set innerDataMax(e){var i;((i=this.inner).data??(i.data={})).max=e}setData(e){this.inner.setDataSet(et.toBaidu(e,this.map.coordType,this.innerDataMax))}setOptions(e){const i=Qe.toBaidu(e,this.map.coordType,e.maxIntensity??this.innerDataMax);e.data!==this.inner.data?this.inner.setDataSet(i.data):e.maxIntensity&&(this.innerDataMax=e.maxIntensity),this.inner.setOptions(i)}remove(){this.map.innerMap.removeOverlay(this.inner)}}class Zt{constructor(t){this.options=t}}function Me(r,t,e){const i=new URL(t,r),n=new URLSearchParams(Object.entries(e).filter(Yi));return i.search="?"+n.toString(),i}function Wt(){const r=window.location.hostname.split(".").filter(t=>!a.Strings.isInt(t));return r.length===3?r.join("."):[...r,"tg","map","urls"].slice(0,3).join(".")}const xe=class xe extends Zt{directions(t,e,i){return Me(xe.BASE_URL,"dir/",{api:"1",origin:a.Location.toString(t,R.gcj02),destination:a.Location.toString(e,R.gcj02),travelmode:i})}search(t){return Me(xe.BASE_URL,"search/",{api:"1",query:a.Location.toString(t,R.gcj02)})}};f(xe,"BASE_URL","https://www.google.com/maps/");let tt=xe;const ye=class ye extends Zt{directions(t,e,i="driving"){const n=a.Location.getCoordType(e)??a.Location.getCoordType(t)??R.bd09,s=a.Location.toString(e,n);return Me(ye.BASE_URL,"direction",{origin:a.Location.toString(t,n)??(typeof e!="string"?`name:请选择起点|latlng:${s}`:s),destination:s,coord_type:n===R.bd09?void 0:n,mode:i,output:"html",region:"中国",src:Wt()})}search(t){return typeof t=="string"?this.geocoderApi(t):this.latlngApi(t)}latlngApi(t){const e=t.to(R.bd09);return new URL(`https://map.baidu.com/?latlng=${e.lat},${e.lng}`)}markerApi(t,e,i){return Me(ye.BASE_URL,"marker",{location:`${t.lat},${t.lng}`,coord_type:t.coord===R.bd09?void 0:t.coord,title:e,content:i,output:"html",src:Wt()})}geocoderApi(t){return Me(ye.BASE_URL,"geocoder",{...typeof t=="string"?{address:t}:{location:`${t.lat},${t.lng}`,coord_type:t.coord===R.bd09?void 0:t.coord},output:"html",src:Wt()})}};f(ye,"BASE_URL","https://api.map.baidu.com/");let it=ye,$r=class br{constructor(t,e,i){this.extend(br,google.maps.OverlayView),this.map_=t,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=i||{};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(t),this.prevZoom_=this.map_.getZoom();var s=this;google.maps.event.addListener(this.map_,"zoom_changed",function(){var l=s.map_.getZoom(),g=s.map_.minZoom||0,o=Math.min(s.map_.maxZoom||100,s.map_.mapTypes[s.map_.getMapTypeId()].maxZoom);l=Math.min(Math.max(l,g),o),s.prevZoom_!=l&&(s.prevZoom_=l,s.resetViewport())}),google.maps.event.addListener(this.map_,"idle",function(){s.redraw()}),e&&(e.length||Object.keys(e).length)&&this.addMarkers(e,!1)}extend(t,e){return(function(i){for(var n in i.prototype)this.prototype[n]=i.prototype[n];return this}).apply(t,[e])}onAdd(){this.setReady_(!0)}draw(){}setupStyles_(){if(!this.styles_.length)for(var t=0,e;e=this.sizes[t];t++)this.styles_.push({url:this.imagePath_+(t+1)+"."+this.imageExtension_,height:e,width:e})}fitMapToMarkers(){for(var t=this.getMarkers(),e=new google.maps.LatLngBounds,i=0,n;n=t[i];i++)e.extend(n.getPosition());this.map_.fitBounds(e)}setZIndex(t){this.zIndex_=t}getZIndex(){return this.zIndex_}setStyles(t){this.styles_=t}getStyles(){return this.styles_}isZoomOnClick(){return this.zoomOnClick_}isAverageCenter(){return this.averageCenter_}getMarkers(){return this.markers_}getTotalMarkers(){return this.markers_.length}setMaxZoom(t){this.maxZoom_=t}getMaxZoom(){return this.maxZoom_}calculator_(t,e){for(var i=0,n=t.length,s=n;s!==0;)s=parseInt(s/10,10),i++;return i=Math.min(i,e),{text:n,index:i}}setCalculator(t){this.calculator_=t}getCalculator(){return this.calculator_}addMarkers(t,e){if(t.length)for(let i=0,n;n=t[i];i++)this.pushMarkerTo_(n);else if(Object.keys(t).length)for(let i in t)this.pushMarkerTo_(t[i]);e||this.redraw()}pushMarkerTo_(t){if(t.isAdded=!1,t.draggable){var e=this;google.maps.event.addListener(t,"dragend",function(){t.isAdded=!1,e.repaint()})}this.markers_.push(t)}addMarker(t,e){this.pushMarkerTo_(t),e||this.redraw()}removeMarker_(t){var e=-1;if(this.markers_.indexOf)e=this.markers_.indexOf(t);else for(var i=0,n;n=this.markers_[i];i++)if(n==t){e=i;break}return e==-1?!1:(t.setMap(null),this.markers_.splice(e,1),!0)}removeMarker(t,e){var i=this.removeMarker_(t);return!e&&i?(this.resetViewport(),this.redraw(),!0):!1}removeMarkers(t,e){for(var i=t===this.getMarkers()?t.slice():t,n=!1,s=0,l;l=i[s];s++){var g=this.removeMarker_(l);n=n||g}if(!e&&n)return this.resetViewport(),this.redraw(),!0}setReady_(t){this.ready_||(this.ready_=t,this.createClusters_())}getTotalClusters(){return this.clusters_.length}getMap(){return this.map_}setMap(t){this.map_=t}getGridSize(){return this.gridSize_}setGridSize(t){this.gridSize_=t}getMinClusterSize(){return this.minClusterSize_}setMinClusterSize(t){this.minClusterSize_=t}getExtendedBounds(t){var e=this.getProjection(),i=new google.maps.LatLng(t.getNorthEast().lat(),t.getNorthEast().lng()),n=new google.maps.LatLng(t.getSouthWest().lat(),t.getSouthWest().lng()),s=e.fromLatLngToDivPixel(i);s.x+=this.gridSize_,s.y-=this.gridSize_;var l=e.fromLatLngToDivPixel(n);l.x-=this.gridSize_,l.y+=this.gridSize_;var g=e.fromDivPixelToLatLng(s),o=e.fromDivPixelToLatLng(l);return t.extend(g),t.extend(o),t}isMarkerInBounds_(t,e){return e.contains(t.getPosition())}clearMarkers(){this.resetViewport(!0),this.markers_=[]}resetViewport(t){for(let e=0,i;i=this.clusters_[e];e++)i.remove();for(let e=0,i;i=this.markers_[e];e++)i.isAdded=!1,t&&i.setMap(null);this.clusters_=[]}repaint(){var t=this.clusters_.slice();this.clusters_.length=0,this.resetViewport(),this.redraw(),setTimeout(function(){for(var e=0,i;i=t[e];e++)i.remove()},0)}redraw(){this.createClusters_()}distanceBetweenPoints_(t,e){if(!t||!e)return 0;var i=6371,n=(e.lat()-t.lat())*Math.PI/180,s=(e.lng()-t.lng())*Math.PI/180,l=Math.sin(n/2)*Math.sin(n/2)+Math.cos(t.lat()*Math.PI/180)*Math.cos(e.lat()*Math.PI/180)*Math.sin(s/2)*Math.sin(s/2),g=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),o=i*g;return o}addToClosestCluster_(t){for(var e=4e4,i=null,n=0,s;s=this.clusters_[n];n++){var l=s.getCenter();if(l){var g=this.distanceBetweenPoints_(l,t.getPosition());g<e&&(e=g,i=s)}}if(i&&i.isMarkerInClusterBounds(t))i.addMarker(t);else{var o=new zr(this);o.addMarker(t),this.clusters_.push(o)}}createClusters_(){if(this.ready_)for(var t=new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast()),e=this.getExtendedBounds(t),i=0,n;n=this.markers_[i];i++)!n.isAdded&&this.isMarkerInBounds_(n,e)&&this.addToClosestCluster_(n)}},zr=class{constructor(t){this.markerClusterer_=t,this.map_=t.getMap(),this.gridSize_=t.getGridSize(),this.minClusterSize_=t.getMinClusterSize(),this.averageCenter_=t.isAverageCenter(),this.center_=null,this.markers_=[],this.bounds_=null,this.clusterIcon_=new Ht(this,t.getStyles(),t.getGridSize())}isMarkerAlreadyAdded(t){if(this.markers_.indexOf)return this.markers_.indexOf(t)!=-1;for(var e=0,i;i=this.markers_[e];e++)if(i==t)return!0;return!1}addMarker(t){if(this.isMarkerAlreadyAdded(t))return!1;if(!this.center_)this.center_=t.getPosition(),this.calculateBounds_();else if(this.averageCenter_){var e=this.markers_.length+1,i=(this.center_.lat()*(e-1)+t.getPosition().lat())/e,n=(this.center_.lng()*(e-1)+t.getPosition().lng())/e;this.center_=new google.maps.LatLng(i,n),this.calculateBounds_()}t.isAdded=!0,this.markers_.push(t);var s=this.markers_.length;if(s<this.minClusterSize_&&t.getMap()!=this.map_&&t.setMap(this.map_),s==this.minClusterSize_)for(var l=0;l<s;l++)this.markers_[l].setMap(null);return s>=this.minClusterSize_&&t.setMap(null),this.updateIcon(),!0}getMarkerClusterer(){return this.markerClusterer_}getBounds(){for(var t=new google.maps.LatLngBounds(this.center_,this.center_),e=this.getMarkers(),i=0,n;n=e[i];i++)t.extend(n.getPosition());return t}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 t=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(t)}isMarkerInClusterBounds(t){return this.bounds_.contains(t.getPosition())}getMap(){return this.map_}updateIcon(){var t=this.map_.getZoom(),e=this.markerClusterer_.getMaxZoom();if(e&&t>e){for(var i=0,n;n=this.markers_[i];i++)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 Ht{constructor(t,e,i){t.getMarkerClusterer().extend(Ht,google.maps.OverlayView),this.styles_=e,this.padding_=i||0,this.cluster_=t,this.center_=null,this.map_=t.getMap(),this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(this.map_)}triggerClusterClick(){var t=this.cluster_.getBounds(),e=this.cluster_.getMarkerClusterer();google.maps.event.trigger(e.map_,"clusterclick",this.cluster_),e.isZoomOnClick()&&(this.map_.fitBounds(t),this.map_.setCenter(t.getCenter()))}onAdd(){if(this.div_=document.createElement("DIV"),this.visible_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(t),this.div_.innerHTML=this.sums_.text}var e=this.getPanes();e.overlayMouseTarget.appendChild(this.div_);var i=this;google.maps.event.addDomListener(this.div_,"click",function(){i.triggerClusterClick()})}getPosFromLatLng_(t){var e=this.getProjection().fromLatLngToDivPixel(t);return e.x-=parseInt(this.width_/2,10),e.y-=parseInt(this.height_/2,10),e}draw(){if(this.visible_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.top=t.y+"px",this.div_.style.left=t.x+"px"}}hide(){this.div_&&(this.div_.style.display="none"),this.visible_=!1}show(){if(this.div_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(t),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(t){this.sums_=t,this.text_=t.text,this.index_=t.index,this.div_&&(this.div_.innerHTML=t.text),this.useStyle()}useStyle(){var t=Math.max(0,this.sums_.index-1);t=Math.min(this.styles_.length-1,t);var e=this.styles_[t];this.url_=e.url,this.height_=e.height,this.width_=e.width,this.textColor_=e.textColor,this.anchor_=e.anchor,this.textSize_=e.textSize,this.backgroundPosition_=e.backgroundPosition}setCenter(t){this.center_=t}createCss(t){var e=[];e.push("z-index:"+this.cluster_.markerClusterer_.getZIndex()+";"),e.push("background-image:url("+this.url_+");");var i=this.backgroundPosition_?this.backgroundPosition_:"0 0";e.push("background-position:"+i+";"),typeof this.anchor_=="object"?(typeof this.anchor_[0]=="number"&&this.anchor_[0]>0&&this.anchor_[0]<this.height_?e.push("height:"+(this.height_-this.anchor_[0])+"px; padding-top:"+this.anchor_[0]+"px;"):e.push("height:"+this.height_+"px; line-height:"+this.height_+"px;"),typeof this.anchor_[1]=="number"&&this.anchor_[1]>0&&this.anchor_[1]<this.width_?e.push("width:"+(this.width_-this.anchor_[1])+"px; padding-left:"+this.anchor_[1]+"px;"):e.push("width:"+this.width_+"px; text-align:center;")):e.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 e.push("cursor:pointer; top:"+t.y+"px; left:"+t.x+"px; color:"+n+"; position:absolute; font-size:"+s+"px; font-family:Arial,sans-serif; font-weight:bold"),e.join("")}}var Ei={exports:{}};(function(r,t){(function(e,i){r.exports=i()})(kt,function(){var e,i=e=i||{version:"1.3.8"},n={};i.guid="$BAIDU$",n[i.guid]=n[i.guid]||{},i.dom=i.dom||{},i.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},i.g=i.G=i.dom.g,i.dom.getDocument=function(o){return o=i.dom.g(o),o.nodeType==9?o:o.ownerDocument||o.document},i.lang=i.lang||{},i.lang.isString=function(o){return Object.prototype.toString.call(o)=="[object String]"},i.isString=i.lang.isString,i.dom._g=function(o){return i.lang.isString(o)?document.getElementById(o):o},i._g=i.dom._g,i.browser=i.browser||{},/msie (\d+\.\d)/i.test(navigator.userAgent)&&(i.browser.ie=i.ie=document.documentMode||+RegExp.$1),i.dom.getComputedStyle=function(o,c){o=i.dom._g(o);var u=i.dom.getDocument(o),d;return u.defaultView&&u.defaultView.getComputedStyle&&(d=u.defaultView.getComputedStyle(o,null),d)?d[c]||d.getPropertyValue(c):""},i.dom._styleFixer=i.dom._styleFixer||{},i.dom._styleFilter=i.dom._styleFilter||[],i.dom._styleFilter.filter=function(o,c,u){for(var d=0,p=i.dom._styleFilter,_;_=p[d];d++)(_=_[u])&&(c=_(o,c));return c},i.string=i.string||{},i.string.toCamelCase=function(o){return o.indexOf("-")<0&&o.indexOf("_")<0?o:o.replace(/[-_][^-_]/g,function(c){return c.charAt(1).toUpperCase()})},i.dom.getStyle=function(o,c){var u=i.dom;o=u.g(o),c=i.string.toCamelCase(c);var d=o.style[c]||(o.currentStyle?o.currentStyle[c]:"")||u.getComputedStyle(o,c);if(!d){var p=u._styleFixer[c];p&&(d=p.get?p.get(o):i.dom.getStyle(o,p))}return(p=u._styleFilter)&&(d=p.filter(c,d,"get")),d},i.getStyle=i.dom.getStyle,/opera\/(\d+\.\d)/i.test(navigator.userAgent)&&(i.browser.opera=+RegExp.$1),i.browser.isWebkit=/webkit/i.test(navigator.userAgent),i.browser.isGecko=/gecko/i.test(navigator.userAgent)&&!/like gecko/i.test(navigator.userAgent),i.browser.isStrict=document.compatMode=="CSS1Compat",i.dom.getPosition=function(o){o=i.dom.g(o);var c=i.dom.getDocument(o),u=i.browser,d=i.dom.getStyle;u.isGecko>0&&c.getBoxObjectFor&&d(o,"position")=="absolute"&&(o.style.top===""||o.style.left);var p={left:0,top:0},_=u.ie&&!u.isStrict?c.body:c.documentElement,y,v;if(o==_)return p;if(o.getBoundingClientRect){v=o.getBoundingClientRect(),p.left=Math.floor(v.left)+Math.max(c.documentElement.scrollLeft,c.body.scrollLeft),p.top=Math.floor(v.top)+Math.max(c.documentElement.scrollTop,c.body.scrollTop),p.left-=c.documentElement.clientLeft,p.top-=c.documentElement.clientTop;var b=c.body,h=parseInt(d(b,"borderLeftWidth")),m=parseInt(d(b,"borderTopWidth"));u.ie&&!u.isStrict&&(p.left-=isNaN(h)?2:h,p.top-=isNaN(m)?2:m)}else{y=o;do{if(p.left+=y.offsetLeft,p.top+=y.offsetTop,u.isWebkit>0&&d(y,"position")=="fixed"){p.left+=c.body.scrollLeft,p.top+=c.body.scrollTop;break}y=y.offsetParent}while(y&&y!=o);for((u.opera>0||u.isWebkit>0&&d(o,"position")=="absolute")&&(p.top-=c.body.offsetTop),y=o.offsetParent;y&&y!=c.body;)p.left-=y.scrollLeft,(!u.opera||y.tagName!="TR")&&(p.top-=y.scrollTop),y=y.offsetParent}return p},i.event=i.event||{},i.event._listeners=i.event._listeners||[],i.event.on=function(o,c,u){c=c.replace(/^on/i,""),o=i.dom._g(o);var d=function(b){u.call(o,b)},p=i.event._listeners,_=i.event._eventFilter,y,v=c;return c=c.toLowerCase(),_&&_[c]&&(y=_[c](o,c,d),v=y.type,d=y.listener),o.addEventListener?o.addEventListener(v,d,!1):o.attachEvent&&o.attachEvent("on"+v,d),p[p.length]=[o,c,u,d,v],o},i.on=i.event.on,function(){var o=n[i.guid];i.lang.guid=function(){return"TANGRAM__"+(o._counter++).toString(36)},o._counter=o._counter||1}(),n[i.guid]._instances=n[i.guid]._instances||{},i.lang.isFunction=function(o){return Object.prototype.toString.call(o)=="[object Function]"},i.lang.Class=function(o){this.guid=o||i.lang.guid(),n[i.guid]._instances[this.guid]=this},n[i.guid]._instances=n[i.guid]._instances||{},i.lang.Class.prototype.dispose=function(){delete n[i.guid]._instances[this.guid];for(var o in this)i.lang.isFunction(this[o])||delete this[o];this.disposed=!0},i.lang.Class.prototype.toString=function(){return"[object "+(this._className||"Object")+"]"},i.lang.Event=function(o,c){this.type=o,this.returnValue=!0,this.target=c||null,this.currentTarget=null},i.lang.Class.prototype.addEventListener=function(o,c,u){if(i.lang.isFunction(c)){!this.__listeners&&(this.__listeners={});var d=this.__listeners,p;if(typeof u=="string"&&u){if(/[^\w\-]/.test(u))throw"nonstandard key:"+u;c.hashCode=u,p=u}o.indexOf("on")!=0&&(o="on"+o),typeof d[o]!="object"&&(d[o]={}),p=p||i.lang.guid(),c.hashCode=p,d[o][p]=c}},i.lang.Class.prototype.removeEventListener=function(o,c){if(!(typeof c<"u"&&(i.lang.isFunction(c)&&!(c=c.hashCode)||!i.lang.isString(c)))){!this.__listeners&&(this.__listeners={}),o.indexOf("on")!=0&&(o="on"+o);var u=this.__listeners;if(u[o])if(typeof c<"u")u[o][c]&&delete u[o][c];else for(var d in u[o])delete u[o][d]}},i.lang.Class.prototype.dispatchEvent=function(o,c){i.lang.isString(o)&&(o=new i.lang.Event(o)),!this.__listeners&&(this.__listeners={}),c=c||{};for(var u in c)o[u]=c[u];var u,d=this.__listeners,p=o.type;if(o.target=o.target||this,o.currentTarget=this,p.indexOf("on")!=0&&(p="on"+p),i.lang.isFunction(this[p])&&this[p].apply(this,arguments),typeof d[p]=="object")for(u in d[p])d[p][u].apply(this,arguments);return o.returnValue},i.lang.inherits=function(o,c,u){var d,p,_=o.prototype,y=new Function;y.prototype=c.prototype,p=o.prototype=new y;for(d in _)p[d]=_[d];o.prototype.constructor=o,o.superClass=c.prototype,typeof u=="string"&&(p._className=u)},i.inherits=i.lang.inherits;var s="http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m",l="png",g=function(o,c,u){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}e.lang.inherits(g,BMap.Overlay,"TextIconOverlay"),this._position=o,this._text=c,this._options=u||{},this._styles=this._options.styles||[],this._zIndex=this._options.zIndex,!this._styles.length&&this._setupDefaultStyles()};return g.prototype._setupDefaultStyles=function(){for(var o=[53,56,66,78,90],c=0,u;u=o[c];c++)this._styles.push({url:s+c+"."+l,size:new BMap.Size(u,u)})},g.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},g.prototype.draw=function(){this._map&&this._updatePosition()},g.prototype.getText=function(){return this._text},g.prototype.setText=function(o){o&&(!this._text||this._text.toString()!=o.toString())&&(this._text=o,this._updateText(),this._updateCss(),this._updatePosition())},g.prototype.getPosition=function(){return this._position},g.prototype.setPosition=function(o){o&&(!this._position||!this._position.equals(o))&&(this._position=o,this._updatePosition())},g.prototype.getStyleByText=function(o,c){var u=parseInt(o),d=parseInt(u/10);return d=Math.max(0,d),d=Math.min(d,c.length-1),c[d]},g.prototype._updateCss=function(){if(this._domElement){var o=this.getStyleByText(this._text,this._styles);this._domElement.style.cssText=this._buildCssText(o)}},g.prototype._updateText=function(){this._domElement&&(this._domElement.innerHTML=this._text)},g.prototype._updatePosition=function(){if(this._domElement&&this._position){var o=this._domElement.style,c=this._map.pointToOverlayPixel(this._position);c.x-=Math.ceil(parseInt(o.width)/2),c.y-=Math.ceil(parseInt(o.height)/2),o.left=c.x+"px",o.top=c.y+"px"}},g.prototype._buildCssText=function(o){var c=o.url,u=o.size,d=o.anchor,p=o.offset,_=o.textColor||"black",y=o.textSize||10,v=[];if(this._zIndex&&v.push("z-index:"+this._zIndex+";"),e.browser.ie<7)v.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="'+c+'");');else{v.push("background-image:url("+c+");");var b="0 0";p instanceof BMap.Size&&(b=p.width+"px "+p.height+"px"),v.push("background-position:"+b+";")}return u instanceof BMap.Size&&(d instanceof BMap.Size?(d.height>0&&d.height<u.height&&v.push("height:"+(u.height-d.height)+"px; padding-top:"+d.height+"px;"),d.width>0&&d.width<u.width&&v.push("width:"+(u.width-d.width)+"px; padding-left:"+d.width+"px;")):(v.push("height:"+u.height+"px; line-height:"+u.height+"px;"),v.push("width:"+u.width+"px; text-align:center;"))),v.push("cursor:pointer; color:"+_+"; position:absolute; font-size:"+y+"px; font-family:Arial,sans-serif; font-weight:bold"),v.join("")},g.prototype._bind=function(){if(!this._domElement)return;var o=this,c=this._map,u=e.lang.Event;function d(p,_){var y=p.srcElement||p.target,v=p.clientX||p.pageX,b=p.clientY||p.pageY;if(p&&_&&v&&b&&y){var h=e.dom.getPosition(c.getContainer());_.pixel=new BMap.Pixel(v-h.left,b-h.top),_.point=c.pixelToPoint(_.pixel)}return _}e.event.on(this._domElement,"mouseover",function(p){o.dispatchEvent(d(p,new u("onmouseover")))}),e.event.on(this._domElement,"mouseout",function(p){o.dispatchEvent(d(p,new u("onmouseout")))}),e.event.on(this._domElement,"click",function(p){o.dispatchEvent(d(p,new u("onclick")))})},g})})(Ei);var Gr=Ei.exports;const Pi=Ge(Gr);var Li=function(r,t,e){t=Nr(t);var i=r.pointToPixel(t.getNorthEast()),n=r.pointToPixel(t.getSouthWest());i.x+=e,i.y-=e,n.x-=e,n.y+=e;var s=r.pixelToPoint(i),l=r.pixelToPoint(n);return new BMap.Bounds(l,s)},Nr=function(r){var t=rt(r.getNorthEast().lng,-180,180),e=rt(r.getSouthWest().lng,-180,180),i=rt(r.getNorthEast().lat,-74,74),n=rt(r.getSouthWest().lat,-74,74);return new BMap.Bounds(new BMap.Point(e,n),new BMap.Point(t,i))},rt=function(r,t,e){return t&&(r=Math.max(r,t)),e&&(r=Math.min(r,e)),r},Bi=function(r){return Object.prototype.toString.call(r)==="[object Array]"},Ii=function(r,t){var e=-1;if(Bi(t)){if(t.indexOf)e=t.indexOf(r);else for(var i=0,n;n=t[i];i++)if(n===r){e=i;break}}return e},L=function(r,t){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}if(r){this._map=r,this._markers=[],this._clusters=[];var e=t||{};this._zIndex=e.zIndex,this._gridSize=e.gridSize||60,this._maxZoom=e.maxZoom||18,this._minClusterSize=e.minClusterSize||2,this._isAverageCenter=!1,e.isAverageCenter!=null&&(this._isAverageCenter=e.isAverageCenter),this._styles=e.styles||[];var i=this;this._map.addEventListener("zoomend",function(){i._redraw()}),this._map.addEventListener("moveend",function(){i._redraw()});var n=e.markers;Bi(n)&&this.addMarkers(n)}};L.prototype.addMarkers=function(r){if(r.length){for(var t=0,e=r.length;t<e;t++)this._pushMarkerTo(r[t]);this._createClusters()}},L.prototype._pushMarkerTo=function(r){var t=Ii(r,this._markers);t===-1&&(r.isInCluster=!1,this._markers.push(r))},L.prototype.addMarker=function(r){this._pushMarkerTo(r),this._createClusters()},L.prototype._createClusters=function(){var r=this._map.getBounds();if(r.getCenter()){for(var t=Li(this._map,r,this._gridSize),e=0,i;i=this._markers[e];e++)!i.isInCluster&&t.containsPoint(i.getPosition())&&this._addToClosestCluster(i);for(var n=this._markers.length,e=0;e<n;e++)this._clusters[e]&&this._clusters[e].render()}},L.prototype._addToClosestCluster=function(r){var t=4e6,e=null;r.getPosition();for(var i=0,n;n=this._clusters[i];i++){var s=n.getCenter();if(s){var l=this._map.getDistance(s,r.getPosition());l<t&&(t=l,e=n)}}if(e&&e.isMarkerInClusterBounds(r))e.addMarker(r);else{var n=new j(this);n.addMarker(r),this._clusters.push(n)}},L.prototype._clearLastClusters=function(){for(var r=0,t;t=this._clusters[r];r++)t.remove();this._clusters=[],this._removeMarkersFromCluster()},L.prototype._removeMarkersFromCluster=function(){for(var r=0,t;t=this._markers[r];r++)t.isInCluster=!1},L.prototype._removeMarkersFromMap=function(){for(var r=0,t;t=this._markers[r];r++){t.isInCluster=!1;var e=t.getLabel();this._map.removeOverlay(t),t.setLabel(e)}},L.prototype._removeMarker=function(r){var t=Ii(r,this._markers);return t===-1?!1:(this._map.removeOverlay(r),this._markers.splice(t,1),!0)},L.prototype.removeMarker=function(r){var t=this._removeMarker(r);return t&&(this._clearLastClusters(),this._createClusters()),t},L.prototype.removeMarkers=function(r){for(var t=!1,e=0;e<r.length;e++){var i=this._removeMarker(r[e]);t=t||i}return t&&(this._clearLastClusters(),this._createClusters()),t},L.prototype.clearMarkers=function(){this._clearLastClusters(),this._removeMarkersFromMap(),this._markers=[]},L.prototype._redraw=function(){this._clearLastClusters(),this._createClusters()},L.prototype.getGridSize=function(){return this._gridSize},L.prototype.setGridSize=function(r){this._gridSize=r,this._redraw()},L.prototype.getMaxZoom=function(){return this._maxZoom},L.prototype.setMaxZoom=function(r){this._maxZoom=r,this._redraw()},L.prototype.getZIndex=function(){return this._zIndex},L.prototype.setZIndex=function(r){this._zIndex!=r&&(this.zIndex=r,this._redraw())},L.prototype.getStyles=function(){return this._styles},L.prototype.setStyles=function(r){this._styles=r,this._redraw()},L.prototype.getMinClusterSize=function(){return this._minClusterSize},L.prototype.setMinClusterSize=function(r){this._minClusterSize=r,this._redraw()},L.prototype.isAverageCenter=function(){return this._isAverageCenter},L.prototype.getMap=function(){return this._map},L.prototype.getMarkers=function(){return this._markers},L.prototype.getClustersCount=function(){for(var r=0,t=0,e;e=this._clusters[t];t++)e.isReal()&&r++;return r},L.prototype._textCalculator=function(r){return r.length.toString()},L.prototype._stylesIndexCalculator=null,L.prototype.setTextCalculator=function(r){this._textCalculator=r},L.prototype.setStylesIndexCalculator=function(r){this._stylesIndexCalculator=r};function j(r){var t=this;this._markerClusterer=r,this._map=r.getMap(),this._minClusterSize=r.getMinClusterSize(),this._isAverageCenter=r.isAverageCenter(),this._center=null,this._markers=[],this._gridBounds=null,this._isReal=!1,this._clusterMarker=new Pi(this._center,this._markers.length,{styles:this._markerClusterer.getStyles(),zIndex:r._zIndex}),this._clusterMarker.getStyleByText=function(e,i){if(t._markerClusterer._stylesIndexCalculator){var n=t._markerClusterer._stylesIndexCalculator(t._markers,i.length);return i[n]}return Pi.prototype.getStyleByText.call(this,e,i)},this._clusterMarker.addEventListener&&this._clusterMarker.addEventListener("click",function(e){t._map.setViewport(t.getBounds())})}j.prototype.addMarker=function(r){if(this.isMarkerInCluster(r))return!1;if(!this._center)this._center=r.getPosition(),this.updateGridBounds();else if(this._isAverageCenter){var t=this._markers.length+1,e=(this._center.lat*(t-1)+r.getPosition().lat)/t,i=(this._center.lng*(t-1)+r.getPosition().lng)/t;this._center=new BMap.Point(i,e),this.updateGridBounds()}return r.isInCluster=!0,this._markers.push(r),!0},j.prototype.render=function(){var r=this._markers.length;if(r<this._minClusterSize)for(var t=0;t<r;t++)this._map.addOverlay(this._markers[t]);else this._map.addOverlay(this._clusterMarker),this._isReal=!0,this.updateClusterMarker()},j.prototype.isMarkerInCluster=function(r){if(this._markers.indexOf)return this._markers.indexOf(r)!=-1;for(var t=0,e;e=this._markers[t];t++)if(e===r)return!0;return!1},j.prototype.isMarkerInClusterBounds=function(r){return this._gridBounds.containsPoint(r.getPosition())},j.prototype.isReal=function(r){return this._isReal},j.prototype.updateGridBounds=function(){var r=new BMap.Bounds(this._center,this._center);this._gridBounds=Li(this._map,r,this._markerClusterer.getGridSize())},j.prototype.updateClusterMarker=function(){if(this._map.getZoom()>this._markerClusterer.getMaxZoom()){this._clusterMarker&&this._map.removeOverlay(this._clusterMarker);for(var r=0,t;t=this._markers[r];r++)this._map.addOverlay(t);return}if(this._markers.length<this._minClusterSize){this._clusterMarker.hide();return}this._clusterMarker.setPosition(this._center),this._clusterMarker.setText(this._markerClusterer._textCalculator(this._markers))},j.prototype.remove=function(){for(var r=0,t;t=this._markers[r];r++){var e=this._markers[r].getLabel();this._markers[r].getMap()&&this._map.removeOverlay(this._markers[r]),this._markers[r].setLabel(e)}this._map.removeOverlay(this._clusterMarker),this._markers.length=0,delete this._markers},j.prototype.getBounds=function(){for(var r=new BMap.Bounds(this._center,this._center),t=0,e;e=this._markers[t];t++)r.extend(e.getPosition());return r},j.prototype.getCenter=function(){return this._center};var nt;(r=>{function t(i){return{url:i.url,size:new BMap.Size(i.size.width,i.size.height),anchor:i.anchor&&new BMap.Size(i.anchor.x,i.anchor.y),offset:i.offset&&new BMap.Size(i.offset.x,i.offset.y),textColor:i.textColor,textSize:i.textSize}}r.toBaidu=t;function e(i){return{url:i.url,width:i.size.width,height:i.size.height,anchor:i.anchor&&[i.anchor.y,i.anchor.x],backgroundPosition:i.offset&&`${i.offset.x} ${i.offset.y}`,textColor:i.textColor,textSize:i.textSize}}r.toGoogle=e})(nt||(nt={}));class Vt{constructor(t){this.map=t}clearMarkers(){this.inner.clearMarkers()}addMarker(t){this.inner.addMarker(t.innerOverlay)}removeMarker(t){return this.inner.removeMarker(t.innerOverlay)}addMarkers(t){this.inner.addMarkers(t.map(e=>e.innerOverlay))}removeMarkers(t){return this.inner.removeMarkers(t.map(e=>e.innerOverlay))}}class Si extends Vt{constructor(e,i){var s;super(e);f(this,"inner");this.inner=new L(e.innerMap,{gridSize:i.gridSize,maxZoom:i.maxZoom,minClusterSize:i.minClusterSize,isAverageCenter:i.averageCenter,styles:(s=i.styles)==null?void 0:s.map(l=>nt.toBaidu(l)),zIndex:i.zIndex});const n=i.stylesIndexCalculator;n&&this.inner.setStylesIndexCalculator((l,g)=>n(l.length,g)),i.markers&&this.addMarkers(i.markers)}recreate(){this.inner._redraw()}}class ki extends Vt{constructor(e,i){var s,l;super(e);f(this,"inner");this.inner=new $r(e.innerMap,(s=i.markers)==null?void 0:s.map(g=>g.innerOverlay),{gridSize:i.gridSize,maxZoom:i.maxZoom,minimumClusterSize:i.minClusterSize,averageCenter:i.averageCenter,styles:(l=i.styles)==null?void 0:l.map(g=>nt.toGoogle(g)),zIndex:i.zIndex});const n=i.stylesIndexCalculator;n&&this.inner.setCalculator((g,o)=>({text:g.length,index:n(g.length,o)+1}))}recreate(){this.inner.repaint()}}class jt{constructor(){}}class xi extends jt{constructor(e,i){super();f(this,"inner");this.map=e,this.inner=new google.maps.places.PlacesService(e.innerMap)}search(e,i){return this.searchImpl(e,i instanceof w?i.toGoogle(this.map.coordType):i??this.map.innerMap.getCenter())}searchInBounds(e,i){return this.searchImpl(e,i.toGoogle(this.map.coordType))}searchNearBy(e,i,n){return this.searchImpl(e,{center:i.toGoogle(this.map.coordType),radius:n})}searchImpl(e,i){return new Promise((n,s)=>{this.inner.findPlaceFromQuery({query:e,fields:["formatted_address","geometry","name","place_id"],locationBias:i},(l,g)=>{switch(g){case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:case google.maps.places.PlacesServiceStatus.OK:{const o=(l??[]).map(c=>_i(c,this.map));n(o);break}default:s(new Error(`status: ${g}`));break}})})}}class Ai extends jt{constructor(e,i){super();f(this,"searchRequestMap",new Map);f(this,"currentSearch");this.map=e}get inner(){return this.currentSearch}search(e,i){return this.newSearch(i instanceof w?i.toBaidu(this.map.coordType):i??this.map.innerMap.getCenter(),n=>{n.search(e)})}searchInBounds(e,i){return this.newSearch(void 0,n=>{n.searchInBounds(e,i.toBaidu(this.map.coordType))})}searchNearBy(e,i,n){return this.newSearch(void 0,s=>{s.searchNearby(e,i.toBaidu(this.map.coordType),n)})}newSearch(e,i){return new Promise((n,s)=>{const l=new BMap.LocalSearch(e??this.map.innerMap,{onSearchComplete:g=>{Array.isArray(g)&&Lt("当前只支持一次搜索一条数据");const o=l.getStatus();switch(o){case BMAP_STATUS_SUCCESS:{const c=[];for(let u=0;u<g.getCurrentNumPois();u++){const d=g.getPoi(u);c.push({id:d.uid,city:d.city,country:"",position:w.fromBaidu(d.point,this.map.coordType),province:d.province,title:d.title,address:d.address})}n(c);break}case BMAP_STATUS_UNKNOWN_LOCATION:n([]);break;default:s(new Error(`status: ${o}`));break}}});i(l)})}}class Ft{constructor(t,e){f(this,"onData");f(this,"onError");this.map=t,this.input=e}setSearchListener(t,e){return this.onData&&I("setSearchListener只能调用一次"),this.onData=t,this.onError=e,ve}}class Ri extends Ft{constructor(e,i){super(e,i.input);f(this,"searchBox");this.searchBox=new google.maps.places.SearchBox(i.input),this.searchBox.bindTo("bounds",e.innerMap)}setSearchListener(e,i){return super.setSearchListener(e,i),hi(this.searchBox,"places_changed",()=>{const n=this.searchBox.getPlaces();e((n??[]).map(s=>_i(s,this.map)))})}search(){this.input.value&&(google.maps.event.trigger(this.input,"focus",{}),google.maps.event.trigger(this.input,"keydown",{keyCode:13}))}}class Di extends Ft{constructor(e,i){super(e,i.input);f(this,"autocomplete");f(this,"placesService");this.autocomplete=e.createAutocomplete({input:i.input,bindToMap:!0}),this.placesService=e.createPlacesService({})}setSearchListener(e,i){return super.setSearchListener(e,i),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(e){this.placesService.search(e).then(this.onData,this.onError)}}var $i=(r=>(r[r.WORLD=1]="WORLD",r[r.STATE=5]="STATE",r[r.CITY=10]="CITY",r[r.STREET=15]="STREET",r[r.BUILDING=20]="BUILDING",r))($i||{});class st{constructor(t){f(this,"latestInfoWindow");f(this,"delegate",void 0);this.element=t,process.env.NODE_ENV!=="production"&&setTimeout(()=>{this.delegate||console.warn(`${this.constructor.name}继承了AbstractMap, 但未调用setEventTargetDelegate(delegate)`)})}setEventTargetDelegate(t){this.delegate=t.setTarget(this)}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}getLatestInfoWindow(){return this.latestInfoWindow}setLatestInfoWindowInternal(t){this.latestInfoWindow=t}addOverlayMapType(t){this.addLayer(t)}removeOverlayMapType(t){this.removeLayer(t)}addControl(t){t.addTo(this)}removeControl(t){t.removeFrom(this)}getZoom(){return this.innerMap.getZoom()??0}setZoom(t){this.innerMap.setZoom(t)}}var Zr=function(t){return Wr(t)&&!Hr(t)};function Wr(r){return!!r&&typeof r=="object"}function Hr(r){var t=Object.prototype.toString.call(r);return t==="[object RegExp]"||t==="[object Date]"||Fr(r)}var Vr=typeof Symbol=="function"&&Symbol.for,jr=Vr?Symbol.for("react.element"):60103;function Fr(r){return r.$$typeof===jr}function Ur(r){return Array.isArray(r)?[]:{}}function Te(r,t){return t.clone!==!1&&t.isMergeableObject(r)?ce(Ur(r),r,t):r}function Yr(r,t,e){return r.concat(t).map(function(i){return Te(i,e)})}function qr(r,t){if(!t.customMerge)return ce;var e=t.customMerge(r);return typeof e=="function"?e:ce}function Kr(r){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r).filter(function(t){return Object.propertyIsEnumerable.call(r,t)}):[]}function zi(r){return Object.keys(r).concat(Kr(r))}function Gi(r,t){try{return t in r}catch{return!1}}function Xr(r,t){return Gi(r,t)&&!(Object.hasOwnProperty.call(r,t)&&Object.propertyIsEnumerable.call(r,t))}function Jr(r,t,e){var i={};return e.isMergeableObject(r)&&zi(r).forEach(function(n){i[n]=Te(r[n],e)}),zi(t).forEach(function(n){Xr(r,n)||(Gi(r,n)&&e.isMergeableObject(t[n])?i[n]=qr(n,e)(r[n],t[n],e):i[n]=Te(t[n],e))}),i}function ce(r,t,e){e=e||{},e.arrayMerge=e.arrayMerge||Yr,e.isMergeableObject=e.isMergeableObject||Zr,e.cloneUnlessOtherwiseSpecified=Te;var i=Array.isArray(t),n=Array.isArray(r),s=i===n;return s?i?e.arrayMerge(r,t,e):Jr(r,t,e):Te(t,e)}ce.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(i,n){return ce(i,n,e)},{})};var Qr=ce,en=Qr;const Ni=Ge(en);/*!
|
|
3
3
|
* isobject <https://github.com/jonschlinkert/isobject>
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
6
6
|
* Released under the MIT License.
|
|
7
|
-
*/function
|
|
7
|
+
*/function tn(r){return r!=null&&typeof r=="object"&&Array.isArray(r)===!1}/*!
|
|
8
8
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
9
9
|
*
|
|
10
10
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
11
11
|
* Released under the MIT License.
|
|
12
|
-
*/function xi(r){return Kr(r)===!0&&Object.prototype.toString.call(r)==="[object Object]"}function Ai(r){var t,e;return!(xi(r)===!1||(t=r.constructor,typeof t!="function")||(e=t.prototype,xi(e)===!1)||e.hasOwnProperty("isPrototypeOf")===!1)}a.Objects=void 0,(r=>{function t(u,g){return u.reduce((m,v)=>(m[g(v)]=v,m),{})}r.fromArray=t;function e(u){return u.reduce((g,m)=>(g[m[0]]=m[1],g),{})}r.fromEntries=e;function i(u){return JSON.stringify(u,(g,m)=>typeof m=="object"&&Object.getPrototypeOf(m)!==Object.prototype?m.toString!==Object.prototype.toString?m.toString():`[object ${Object.getPrototypeOf(m).constructor.name}]`:m)}r.toJsonSafely=i;function n(u){Ai(u)&&Object.keys(u).forEach(g=>{u[g]===void 0?delete u[g]:n(u[g])})}r.deleteUndefinedPropertyOnPlainObjectDeeply=n;function s(u,g,m){let v=u[g];return v===void 0&&(v=m(),u[g]=v),v}r.putIfAbsent=s;function l(u,...g){const m=Ri(g),v={};for(const C in u)m(C)||(v[C]=u[C]);return v}r.omit=l;function d(u,...g){const m=Ri(g),v={};for(const C in u)m(C)&&(v[C]=u[C]);return v}r.pick=d;function o(u,g){const m=typeof g=="string"?g.split("."):g;let v=u;for(const C of m){if(v==null)return;v=v[C]}return v}r.get=o;function c(u,g){const m=typeof g=="string"?g.split("."):g,v=o(u,m.slice(0,-1)),C=m[m.length-1];v!=null&&delete v[C]}r.del=c})(a.Objects||(a.Objects={}));function Ri(r){if(r.length<=4)return r.includes.bind(r);{const t=new Set(r);return t.has.bind(t)}}a.Objects.toJsonSafely;const Di=["single","multi"];var X=(r=>(r.auto="auto",r.none="none",r.greedy="greedy",r.cooperative="cooperative",r))(X||{});a.MapOptions=void 0,(r=>{function t(e){a.Objects.deleteUndefinedPropertyOnPlainObjectDeeply(e);const i={center:w.ZERO,zoom:5};return ki(i,e||{},{isMergeableObject:Ai})}r.create=t})(a.MapOptions||(a.MapOptions={}));class jt{constructor(t,e){f(this,"_delegate");this.innerOverlay=t,this.coordType=e}get delegate(){return this._delegate??(this._delegate=this.createDelegate().setTarget(this)),this._delegate}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}remove(){this.map.removeOverlay(this)}}class lt extends jt{constructor(t,e,i){super(t,e),this.map=i}createDelegate(){return new he(this.innerOverlay,this.map)}isVisible(){return this.innerOverlay.getVisible()}setVisible(t){this.innerOverlay.setVisible(t)}}class Ce extends jt{constructor(t,e,i){super(t,e),this.map=i}createDelegate(){return new _e(this.innerOverlay,this.map)}get overlay(){return this.innerOverlay}isVisible(){return this.overlay.isVisible()}setVisible(t){t?this.overlay.show():this.overlay.hide()}visibleOptionInternal(t){return t!==void 0&&(t||this.setVisible(!1)),this}}const Ae=class Ae extends Ce{constructor(t,e,i,n){super(t,e,i),this.state=n}isEditable(){return this.state.editable}setEditable(t){this.state.editable=t,t?this.innerOverlay.enableEditing():this.innerOverlay.disableEditing()}setStrokeColor(t){this.innerOverlay.setStrokeColor(t)}setStrokeOpacity(t){this.innerOverlay.setStrokeOpacity(t+Ae.OPACITY_DELTA)}setStrokeWeight(t){this.innerOverlay.setStrokeWeight(t)}setFillColor(t){this.innerOverlay.setFillColor(t)}setFillOpacity(t){this.innerOverlay.setFillOpacity(t+Ae.OPACITY_DELTA)}};f(Ae,"OPACITY_DELTA",.001);let U=Ae;class ht extends lt{isEditable(){return this.innerOverlay.getEditable()}setEditable(t){this.innerOverlay.setEditable(t)}setStrokeColor(t){this.innerOverlay.setOptions({strokeColor:t})}setStrokeOpacity(t){this.innerOverlay.setOptions({strokeOpacity:t})}setStrokeWeight(t){this.innerOverlay.setOptions({strokeWeight:t})}setFillColor(t){this.innerOverlay.setOptions({fillColor:t})}setFillOpacity(t){this.innerOverlay.setOptions({fillOpacity:t})}}class ct extends U{constructor(){super(...arguments);f(this,"prevCenter");f(this,"prevRadius");f(this,"isDoingSetCenter",!1);f(this,"isDoingSetRadius",!1);f(this,"eventHubDelegate");f(this,"onRadiusChanged",()=>{var i;const e=this.innerOverlay.getRadius();this.prevRadius!==e&&(this.isDoingSetRadius||(i=this.eventHubDelegate)==null||i.notify({type:"radius-changed",target:this}),this.prevRadius=e)});f(this,"onCenterChanged",()=>{var i;const e=this.innerOverlay.getCenter();this.prevCenter!==e&&(this.isDoingSetCenter||(i=this.eventHubDelegate)==null||i.notify({type:"center-changed",target:this}),this.prevCenter=e)});f(this,"resetEditableTimeoutId")}static create(e){const i=this.coordType,n=new BMap.Circle(e.center.toBaidu(i),e.radius,{enableClicking:e.clickable,enableEditing:!1,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+U.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity!=null?e.fillOpacity+U.OPACITY_DELTA:void 0}),s=new ct(n,i,this,{editable:!!e.editable}).visibleOptionInternal(e.visible);return s.state.editable&&setTimeout(()=>{s.state.editable&&n.enableEditing()},0),s}createDelegate(){return this.eventHubDelegate=new Ve(super.createDelegate(),{types:["radius-changed","center-changed"],onListen:e=>{e==="radius-changed"?(this.prevRadius=this.innerOverlay.getRadius(),this.innerOverlay.addEventListener("lineupdate",this.onRadiusChanged)):(this.prevCenter=this.innerOverlay.getCenter(),this.innerOverlay.addEventListener("lineupdate",this.onCenterChanged))},onCancel:e=>{this.innerOverlay.removeEventListener("lineupdate",e==="radius-changed"?this.onRadiusChanged:this.onCenterChanged)}})}setCenter(e){this.coordType=this.map.coordType,this.isDoingSetCenter=!0,this.innerOverlay.setCenter(e.toBaidu(this.coordType)),this.isDoingSetCenter=!1,this.state.editable&&(clearTimeout(this.resetEditableTimeoutId),this.resetEditableTimeoutId=setTimeout(()=>{this.state.editable&&(this.innerOverlay.disableEditing(),this.innerOverlay.enableEditing())},0))}getCenter(){return w.fromBaidu(this.innerOverlay.getCenter(),this.coordType)}setRadius(e){this.isDoingSetRadius=!0,this.innerOverlay.setRadius(e),this.isDoingSetRadius=!1}getRadius(){return this.innerOverlay.getRadius()}}class dt extends ht{static create(t){const e=this.coordType,i=new google.maps.Circle({center:t.center.toGoogle(e),radius:t.radius,clickable:t.clickable,editable:t.editable,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,strokeWeight:t.strokeWeight,fillColor:t.fillColor,fillOpacity:t.fillOpacity,visible:t.visible});return new dt(i,e,this)}setCenter(t){this.coordType=this.map.coordType,this.innerOverlay.setCenter(t.toGoogle(this.coordType))}getCenter(){return w.fromGoogle(this.innerOverlay.getCenter()??ie.LATLNG_ZERO,this.coordType)}setRadius(t){this.innerOverlay.setRadius(t)}getRadius(){return this.innerOverlay.getRadius()}}function $i(){BMap.OverlayV3||(BMap.OverlayV3=BMap.Overlay)}const zi={equals(r,t){return r.lat===t.lat&&r.lng===t.lng}};a.Point=void 0,(r=>{r.ZERO={x:0,y:0}})(a.Point||(a.Point={}));let Ft;function Xr(r,t,e,i,n,s){return Ft||(Ft=Jr()),new Ft(r,t,e,i,n,s)}function Jr(){$i();const r=new BMap.Point(0,0);return class extends BMap.OverlayV3{constructor(i,n=r,s=a.Point.ZERO,l,d=654,o=""){super();f(this,"container");f(this,"border");f(this,"inner");f(this,"map");f(this,"marker");this.content=i,this.position=n,this.offset=s;const c="baidu-info-box-container";this.container=document.createElement("div"),this.container.className=c,this.container.style.position="absolute";const u=m=>m.stopPropagation();this.container.onclick=u,this.container.ondblclick=u,this.container.oncontextmenu=u,this.container.onmousedown=u,this.container.onmousemove=u,this.container.onmousewheel=u,this.border=document.createElement("div"),this.border.className=`${c}__border ${o}`,this.inner=document.createElement("div"),this.inner.className=c+"__inner";const g=document.createElement("span");g.className=c+"__close",g.addEventListener("click",()=>{this.close(),this.dispatchEvent({type:"onclickclose"})}),this.inner.appendChild(i),this.border.appendChild(this.inner),this.border.appendChild(g),this.container.appendChild(this.border),l&&this.setZIndex(l),this.setMaxWidth(d),this.onMarkerPositionChanged=this.onMarkerPositionChanged.bind(this)}initialize(i){return this.map=i,i.getPanes().floatPane.appendChild(this.container),this.container}draw(){if(!this.map)return;const i=this.marker?this.marker.getPosition():this.position,n=this.map.pointToOverlayPixel(i),s=n.x+this.offset.x,l=n.y+this.offset.y;this.container.style.left=`${s}px`,this.container.style.top=`${l}px`}open(i,n){n&&n===this.marker||(this.marker&&this.detachMarker(this.marker),this.marker=n,this.marker&&this.attachMarker(this.marker),this.isOpen()?this.draw():this.marker&&!this.marker.getMap()||i.addOverlay(this))}attachMarker(i){i.__info_box__=this,i.addEventListener("dragging",this.onMarkerPositionChanged),i.addEventListener("dragend",this.onMarkerPositionChanged)}detachMarker(i){i.__info_box__=void 0,i.removeEventListener("dragging",this.onMarkerPositionChanged),i.removeEventListener("dragend",this.onMarkerPositionChanged)}close(){this.map&&(this.map.removeOverlay(this),this.marker&&(this.detachMarker(this.marker),this.marker=void 0),this.map=void 0)}isOpen(){return this.map&&this.map.getPanes().floatPane===this.container.parentNode}onMarkerPositionChanged(){this.draw()}setZIndex(i){this.container.style.zIndex=`${i}`}setMaxWidth(i){this.border.style.maxWidth=`${i}px`}setPosition(i){this.marker||(this.position=i,this.draw())}getPosition(){return this.position}setOffset(i){this.offset=i,this.draw()}getOffset(){return this.offset}}}class ut{constructor(t){this.delegate=t,this.delegate.setTarget(this)}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}}class pt extends ut{constructor(t,e,i){super(new _e(t,e)),this.inner=t,this.map=e,this.state=i}static create(t){const e=t.position||w.ZERO,i=new BMap.InfoWindow(t.content,{maxWidth:t.maxWidth,offset:t.offset&&new BMap.Size(t.offset.x,t.offset.y),enableAutoPan:!t.disableAutoPan});return new pt(i,this,{position:e})}isOpen(){return this.inner.isOpen()}open(t){t?t.innerOverlay.openInfoWindow(this.inner):this.map.innerMap.openInfoWindow(this.inner,(this.state.position||w.ZERO).toBaidu(this.map.coordType)),this.map.setLatestInfoWindowInternal(this)}close(){this.inner.isOpen()&&this.map.innerMap.closeInfoWindow()}getPosition(){const t=this.inner.getPosition();return t&&w.fromBaidu(t,this.map.coordType)||this.state.position||w.ZERO}setPosition(t){this.state.position=t,this.inner.isOpen()&&this.open()}}class gt extends ut{constructor(e,i){super(new he(e,i));f(this,"eventHub",new ni);f(this,"isOpened",!1);this.inner=e,this.map=i,e.addListener("closeclick",()=>{this.isOpened=!1,this.eventHub.hasListener("close")&&this.eventHub.notify({type:"close",target:this})}),e.addListener("map_changed",()=>{const n=this.isOpened;this.isOpened=!!e.getMap(),n&&!this.isOpened&&this.eventHub.hasListener("close")&&this.eventHub.notify({type:"close",target:this})})}static create(e){const i=e.position||w.ZERO,n=new google.maps.InfoWindow({content:e.content,maxWidth:e.maxWidth,pixelOffset:e.offset&&new google.maps.Size(e.offset.x,e.offset.y),position:i.toGoogle(this.coordType),disableAutoPan:e.disableAutoPan});return new gt(n,this)}isOpen(){return this.isOpened}addEventListener(e,i){if(e==="open"||e==="close"){this.eventHub.addEventListener(e,i);return}super.addEventListener(e,i)}removeEventListener(e,i){if(e==="open"||e==="close"){this.eventHub.removeEventListener(e,i);return}super.removeEventListener(e,i)}open(e){if(!this.isOpened){if(this.map.mapOptions.infoWindowMode==="single"){const i=this.map.getLatestInfoWindow();i&&i.close()}this.inner.open(this.map.innerMap,e==null?void 0:e.innerOverlay),this.isOpened=!0,this.map.setLatestInfoWindowInternal(this),this.eventHub.notify({type:"open",target:this})}}close(){this.isOpened&&(this.isOpened=!1,this.inner.close(),this.eventHub.notify({type:"close",target:this}))}getPosition(){return w.fromGoogle(this.inner.getPosition()??ie.LATLNG_ZERO,this.map.coordType)}setPosition(e){this.inner.setPosition(e.toGoogle(this.map.coordType))}}class mt extends Ce{constructor(t,e,i){super(t,e,i),this.baiduMap=i}static create(t){var n;const e=this.coordType,i=Xr(t.content,(n=t.position)==null?void 0:n.toBaidu(e),t.offset,t.zIndex,t.maxWidth,t.borderClass);return new mt(i,e,this)}open(t){this.innerOverlay.open(this.baiduMap.innerMap,t==null?void 0:t.innerOverlay)}close(){this.innerOverlay.close()}getPosition(){return w.fromBaidu(this.innerOverlay.getPosition(),this.coordType)}setPosition(t){this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toBaidu(this.coordType))}setMaxWidth(t){this.innerOverlay.setMaxWidth(t)}setZIndex(t){this.innerOverlay.setZIndex(t)}}class ft extends ut{constructor(t,e,i){super(new he(t,i)),this.inner=t,this.coordType=e,this.map=i}static create(t){var s;const e=this.coordType,i=new google.maps.InfoWindow({content:t.content,position:(s=t.position)==null?void 0:s.toGoogle(e),pixelOffset:t.offset&&new google.maps.Size(t.offset.x,t.offset.y),zIndex:t.zIndex,maxWidth:t.maxWidth}),n=t.borderClass;return n&&i.addListener("domready",()=>{var d;const l=(d=t.content.parentElement)==null?void 0:d.parentElement;l&&l.className.includes("gm-style-iw-c")&&!l.className.includes(n)&&(l.className+=` ${n}`)}),new ft(i,e,this)}open(t){this.inner.open(this.map.innerMap,t==null?void 0:t.innerOverlay)}close(){this.inner.close()}getPosition(){return w.fromGoogle(this.inner.getPosition()??ie.LATLNG_ZERO,this.coordType)}setPosition(t){this.coordType=this.map.coordType,this.inner.setPosition(t.toGoogle(this.coordType))}isOpen(){return this.inner.getMap()!=null}setMaxWidth(t){if(this.isOpen()){const e=this.inner.getMap(),i=this.inner.getAnchor();this.inner.close(),this.inner.setOptions({maxWidth:t}),this.inner.open(e,i)}else this.inner.setOptions({maxWidth:t})}setZIndex(t){this.inner.setZIndex(t)}}a.Strings=void 0,(r=>{function t(s,l){if(s!==void 0)return Object.values(l).includes(s)?s:void 0}r.toEnumOrNull=t;function e(s){return s.split(`
|
|
12
|
+
*/function Zi(r){return tn(r)===!0&&Object.prototype.toString.call(r)==="[object Object]"}function Wi(r){var t,e;return!(Zi(r)===!1||(t=r.constructor,typeof t!="function")||(e=t.prototype,Zi(e)===!1)||e.hasOwnProperty("isPrototypeOf")===!1)}a.Objects=void 0,(r=>{function t(u,d){return u.reduce((p,_)=>(p[d(_)]=_,p),{})}r.fromArray=t;function e(u){return u.reduce((d,p)=>(d[p[0]]=p[1],d),{})}r.fromEntries=e;function i(u){return JSON.stringify(u,(d,p)=>typeof p=="object"&&Object.getPrototypeOf(p)!==Object.prototype?p.toString!==Object.prototype.toString?p.toString():`[object ${Object.getPrototypeOf(p).constructor.name}]`:p)}r.toJsonSafely=i;function n(u){Wi(u)&&Object.keys(u).forEach(d=>{u[d]===void 0?delete u[d]:n(u[d])})}r.deleteUndefinedPropertyOnPlainObjectDeeply=n;function s(u,d,p){let _=u[d];return _===void 0&&(_=p(),u[d]=_),_}r.putIfAbsent=s;function l(u,...d){const p=Hi(d),_={};for(const y in u)p(y)||(_[y]=u[y]);return _}r.omit=l;function g(u,...d){const p=Hi(d),_={};for(const y in u)p(y)&&(_[y]=u[y]);return _}r.pick=g;function o(u,d){const p=typeof d=="string"?d.split("."):d;let _=u;for(const y of p){if(_==null)return;_=_[y]}return _}r.get=o;function c(u,d){const p=typeof d=="string"?d.split("."):d,_=o(u,p.slice(0,-1)),y=p[p.length-1];_!=null&&delete _[y]}r.del=c})(a.Objects||(a.Objects={}));function Hi(r){if(r.length<=4)return r.includes.bind(r);{const t=new Set(r);return t.has.bind(t)}}a.Objects.toJsonSafely;const Vi=["single","multi"];var K=(r=>(r.auto="auto",r.none="none",r.greedy="greedy",r.cooperative="cooperative",r))(K||{});a.MapOptions=void 0,(r=>{function t(e){a.Objects.deleteUndefinedPropertyOnPlainObjectDeeply(e);const i={center:w.ZERO,zoom:5};return Ni(i,e||{},{isMergeableObject:Wi})}r.create=t})(a.MapOptions||(a.MapOptions={}));class Ut{constructor(t,e){f(this,"_delegate");this.innerOverlay=t,this.coordType=e}get delegate(){return this._delegate??(this._delegate=this.createDelegate().setTarget(this)),this._delegate}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}remove(){this.map.removeOverlay(this)}}class ot extends Ut{constructor(t,e,i){super(t,e),this.map=i}createDelegate(){return new le(this.innerOverlay,this.map)}isVisible(){return this.innerOverlay.getVisible()}setVisible(t){this.innerOverlay.setVisible(t)}}class Ce extends Ut{constructor(t,e,i){super(t,e),this.map=i}createDelegate(){return new _e(this.innerOverlay,this.map)}get overlay(){return this.innerOverlay}isVisible(){return this.overlay.isVisible()}setVisible(t){t?this.overlay.show():this.overlay.hide()}visibleOptionInternal(t){return t!==void 0&&(t||this.setVisible(!1)),this}}const Ae=class Ae extends Ce{constructor(t,e,i,n){super(t,e,i),this.state=n}isEditable(){return this.state.editable}setEditable(t){this.state.editable=t,t?this.innerOverlay.enableEditing():this.innerOverlay.disableEditing()}setStrokeColor(t){this.innerOverlay.setStrokeColor(t)}setStrokeOpacity(t){this.innerOverlay.setStrokeOpacity(t+Ae.OPACITY_DELTA)}setStrokeWeight(t){this.innerOverlay.setStrokeWeight(t)}setFillColor(t){this.innerOverlay.setFillColor(t)}setFillOpacity(t){this.innerOverlay.setFillOpacity(t+Ae.OPACITY_DELTA)}};f(Ae,"OPACITY_DELTA",.001);let F=Ae;class at extends ot{isEditable(){return this.innerOverlay.getEditable()}setEditable(t){this.innerOverlay.setEditable(t)}setStrokeColor(t){this.innerOverlay.setOptions({strokeColor:t})}setStrokeOpacity(t){this.innerOverlay.setOptions({strokeOpacity:t})}setStrokeWeight(t){this.innerOverlay.setOptions({strokeWeight:t})}setFillColor(t){this.innerOverlay.setOptions({fillColor:t})}setFillOpacity(t){this.innerOverlay.setOptions({fillOpacity:t})}}class lt extends F{constructor(){super(...arguments);f(this,"prevCenter");f(this,"prevRadius");f(this,"isDoingSetCenter",!1);f(this,"isDoingSetRadius",!1);f(this,"eventHubDelegate");f(this,"onRadiusChanged",()=>{var i;const e=this.innerOverlay.getRadius();this.prevRadius!==e&&(this.isDoingSetRadius||(i=this.eventHubDelegate)==null||i.notify({type:"radius-changed",target:this}),this.prevRadius=e)});f(this,"onCenterChanged",()=>{var i;const e=this.innerOverlay.getCenter();this.prevCenter!==e&&(this.isDoingSetCenter||(i=this.eventHubDelegate)==null||i.notify({type:"center-changed",target:this}),this.prevCenter=e)});f(this,"resetEditableTimeoutId")}static create(e){const i=this.coordType,n=new BMap.Circle(e.center.toBaidu(i),e.radius,{enableClicking:e.clickable,enableEditing:!1,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+F.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity!=null?e.fillOpacity+F.OPACITY_DELTA:void 0}),s=new lt(n,i,this,{editable:!!e.editable}).visibleOptionInternal(e.visible);return s.state.editable&&setTimeout(()=>{s.state.editable&&n.enableEditing()},0),s}createDelegate(){return this.eventHubDelegate=new We(super.createDelegate(),{types:["radius-changed","center-changed"],onListen:e=>{e==="radius-changed"?(this.prevRadius=this.innerOverlay.getRadius(),this.innerOverlay.addEventListener("lineupdate",this.onRadiusChanged)):(this.prevCenter=this.innerOverlay.getCenter(),this.innerOverlay.addEventListener("lineupdate",this.onCenterChanged))},onCancel:e=>{this.innerOverlay.removeEventListener("lineupdate",e==="radius-changed"?this.onRadiusChanged:this.onCenterChanged)}})}setCenter(e){this.coordType=this.map.coordType,this.isDoingSetCenter=!0,this.innerOverlay.setCenter(e.toBaidu(this.coordType)),this.isDoingSetCenter=!1,this.state.editable&&(clearTimeout(this.resetEditableTimeoutId),this.resetEditableTimeoutId=setTimeout(()=>{this.state.editable&&(this.innerOverlay.disableEditing(),this.innerOverlay.enableEditing())},0))}getCenter(){return w.fromBaidu(this.innerOverlay.getCenter(),this.coordType)}setRadius(e){this.isDoingSetRadius=!0,this.innerOverlay.setRadius(e),this.isDoingSetRadius=!1}getRadius(){return this.innerOverlay.getRadius()}}class ht extends at{static create(t){const e=this.coordType,i=new google.maps.Circle({center:t.center.toGoogle(e),radius:t.radius,clickable:t.clickable,editable:t.editable,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,strokeWeight:t.strokeWeight,fillColor:t.fillColor,fillOpacity:t.fillOpacity,visible:t.visible});return new ht(i,e,this)}setCenter(t){this.coordType=this.map.coordType,this.innerOverlay.setCenter(t.toGoogle(this.coordType))}getCenter(){return w.fromGoogle(this.innerOverlay.getCenter()??ie.LATLNG_ZERO,this.coordType)}setRadius(t){this.innerOverlay.setRadius(t)}getRadius(){return this.innerOverlay.getRadius()}}a.Point=void 0,(r=>{r.ZERO={x:0,y:0}})(a.Point||(a.Point={}));let Yt;function rn(r,t,e,i,n,s){return Yt||(Yt=nn()),new Yt(r,t,e,i,n,s)}function nn(){ai();const r=new BMap.Point(0,0);return class extends BMap.OverlayV3{constructor(i,n=r,s=a.Point.ZERO,l,g=654,o=""){super();f(this,"container");f(this,"border");f(this,"inner");f(this,"map");f(this,"marker");this.content=i,this.position=n,this.offset=s;const c="baidu-info-box-container";this.container=document.createElement("div"),this.container.className=c,this.container.style.position="absolute";const u=p=>p.stopPropagation();this.container.onclick=u,this.container.ondblclick=u,this.container.oncontextmenu=u,this.container.onmousedown=u,this.container.onmousemove=u,this.container.onmousewheel=u,this.border=document.createElement("div"),this.border.className=`${c}__border ${o}`,this.inner=document.createElement("div"),this.inner.className=c+"__inner";const d=document.createElement("span");d.className=c+"__close",d.addEventListener("click",()=>{this.close(),this.dispatchEvent({type:"onclickclose"})}),this.inner.appendChild(i),this.border.appendChild(this.inner),this.border.appendChild(d),this.container.appendChild(this.border),l&&this.setZIndex(l),this.setMaxWidth(g),this.onMarkerPositionChanged=this.onMarkerPositionChanged.bind(this)}initialize(i){return this.map=i,i.getPanes().floatPane.appendChild(this.container),this.container}draw(){if(!this.map)return;const i=this.marker?this.marker.getPosition():this.position,n=this.map.pointToOverlayPixel(i),s=n.x+this.offset.x,l=n.y+this.offset.y;this.container.style.left=`${s}px`,this.container.style.top=`${l}px`}open(i,n){n&&n===this.marker||(this.marker&&this.detachMarker(this.marker),this.marker=n,this.marker&&this.attachMarker(this.marker),this.isOpen()?this.draw():this.marker&&!this.marker.getMap()||i.addOverlay(this))}attachMarker(i){i.__info_box__=this,i.addEventListener("dragging",this.onMarkerPositionChanged),i.addEventListener("dragend",this.onMarkerPositionChanged)}detachMarker(i){i.__info_box__=void 0,i.removeEventListener("dragging",this.onMarkerPositionChanged),i.removeEventListener("dragend",this.onMarkerPositionChanged)}close(){this.map&&(this.map.removeOverlay(this),this.marker&&(this.detachMarker(this.marker),this.marker=void 0),this.map=void 0)}isOpen(){return this.map&&this.map.getPanes().floatPane===this.container.parentNode}onMarkerPositionChanged(){this.draw()}setZIndex(i){this.container.style.zIndex=`${i}`}setMaxWidth(i){this.border.style.maxWidth=`${i}px`}setPosition(i){this.marker||(this.position=i,this.draw())}getPosition(){return this.position}setOffset(i){this.offset=i,this.draw()}getOffset(){return this.offset}}}class ct{constructor(t){this.delegate=t,this.delegate.setTarget(this)}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}}class dt extends ct{constructor(t,e,i){super(new _e(t,e)),this.inner=t,this.map=e,this.state=i}static create(t){const e=t.position||w.ZERO,i=new BMap.InfoWindow(t.content,{maxWidth:t.maxWidth,offset:t.offset&&new BMap.Size(t.offset.x,t.offset.y),enableAutoPan:!t.disableAutoPan});return new dt(i,this,{position:e})}isOpen(){return this.inner.isOpen()}open(t){t?t.innerOverlay.openInfoWindow(this.inner):this.map.innerMap.openInfoWindow(this.inner,(this.state.position||w.ZERO).toBaidu(this.map.coordType)),this.map.setLatestInfoWindowInternal(this)}close(){this.inner.isOpen()&&this.map.innerMap.closeInfoWindow()}getPosition(){const t=this.inner.getPosition();return t&&w.fromBaidu(t,this.map.coordType)||this.state.position||w.ZERO}setPosition(t){this.state.position=t,this.inner.isOpen()&&this.open()}}class ut extends ct{constructor(e,i){super(new le(e,i));f(this,"eventHub",new ui);f(this,"isOpened",!1);this.inner=e,this.map=i,e.addListener("closeclick",()=>{this.isOpened=!1,this.eventHub.hasListener("close")&&this.eventHub.notify({type:"close",target:this})}),e.addListener("map_changed",()=>{const n=this.isOpened;this.isOpened=!!e.getMap(),n&&!this.isOpened&&this.eventHub.hasListener("close")&&this.eventHub.notify({type:"close",target:this})})}static create(e){const i=e.position||w.ZERO,n=new google.maps.InfoWindow({content:e.content,maxWidth:e.maxWidth,pixelOffset:e.offset&&new google.maps.Size(e.offset.x,e.offset.y),position:i.toGoogle(this.coordType),disableAutoPan:e.disableAutoPan});return new ut(n,this)}isOpen(){return this.isOpened}addEventListener(e,i){if(e==="open"||e==="close"){this.eventHub.addEventListener(e,i);return}super.addEventListener(e,i)}removeEventListener(e,i){if(e==="open"||e==="close"){this.eventHub.removeEventListener(e,i);return}super.removeEventListener(e,i)}open(e){if(!this.isOpened){if(this.map.mapOptions.infoWindowMode==="single"){const i=this.map.getLatestInfoWindow();i&&i.close()}this.inner.open(this.map.innerMap,e==null?void 0:e.innerOverlay),this.isOpened=!0,this.map.setLatestInfoWindowInternal(this),this.eventHub.notify({type:"open",target:this})}}close(){this.isOpened&&(this.isOpened=!1,this.inner.close(),this.eventHub.notify({type:"close",target:this}))}getPosition(){return w.fromGoogle(this.inner.getPosition()??ie.LATLNG_ZERO,this.map.coordType)}setPosition(e){this.inner.setPosition(e.toGoogle(this.map.coordType))}}class pt extends Ce{constructor(t,e,i){super(t,e,i),this.baiduMap=i}static create(t){var n;const e=this.coordType,i=rn(t.content,(n=t.position)==null?void 0:n.toBaidu(e),t.offset,t.zIndex,t.maxWidth,t.borderClass);return new pt(i,e,this)}open(t){this.innerOverlay.open(this.baiduMap.innerMap,t==null?void 0:t.innerOverlay)}close(){this.innerOverlay.close()}getPosition(){return w.fromBaidu(this.innerOverlay.getPosition(),this.coordType)}setPosition(t){this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toBaidu(this.coordType))}setMaxWidth(t){this.innerOverlay.setMaxWidth(t)}setZIndex(t){this.innerOverlay.setZIndex(t)}}class gt extends ct{constructor(t,e,i){super(new le(t,i)),this.inner=t,this.coordType=e,this.map=i}static create(t){var s;const e=this.coordType,i=new google.maps.InfoWindow({content:t.content,position:(s=t.position)==null?void 0:s.toGoogle(e),pixelOffset:t.offset&&new google.maps.Size(t.offset.x,t.offset.y),zIndex:t.zIndex,maxWidth:t.maxWidth}),n=t.borderClass;return n&&i.addListener("domready",()=>{var g;const l=(g=t.content.parentElement)==null?void 0:g.parentElement;l&&l.className.includes("gm-style-iw-c")&&!l.className.includes(n)&&(l.className+=` ${n}`)}),new gt(i,e,this)}open(t){this.inner.open(this.map.innerMap,t==null?void 0:t.innerOverlay)}close(){this.inner.close()}getPosition(){return w.fromGoogle(this.inner.getPosition()??ie.LATLNG_ZERO,this.coordType)}setPosition(t){this.coordType=this.map.coordType,this.inner.setPosition(t.toGoogle(this.coordType))}isOpen(){return this.inner.getMap()!=null}setMaxWidth(t){if(this.isOpen()){const e=this.inner.getMap(),i=this.inner.getAnchor();this.inner.close(),this.inner.setOptions({maxWidth:t}),this.inner.open(e,i)}else this.inner.setOptions({maxWidth:t})}setZIndex(t){this.inner.setZIndex(t)}}a.Strings=void 0,(r=>{function t(s,l){if(s!==void 0)return Object.values(l).includes(s)?s:void 0}r.toEnumOrNull=t;function e(s){return s.split(`
|
|
13
13
|
`).map(l=>l.trim()).join(`
|
|
14
|
-
`)}r.trimIndent=e;function i(s){return s.replace(/([^A-Z]?)([A-Z])/g,(l,
|
|
15
|
-
为了保证Label的位置正确, 请将SymbolIcon(${
|
|
14
|
+
`)}r.trimIndent=e;function i(s){return s.replace(/([^A-Z]?)([A-Z])/g,(l,g,o)=>g?`${g}-${o.toLowerCase()}`:o.toLowerCase())}r.pascal2kebab=i;function n(s){return/^-?\d+$/.test(s)}r.isInt=n})(a.Strings||(a.Strings={}));var de=(r=>(r.map="map",r.overlay="overlay",r.overlayMouseTarget="overlayMouseTarget",r.float="float",r))(de||{});a.MapPanes=void 0,(r=>{function t(i,n){switch(i){case"float":return n.floatPane;case"overlayMouseTarget":return n.overlayMouseTarget;case"overlay":return n.overlayLayer;case"map":return n.mapPane;default:Bt(i)}}r.toGoogle=t;function e(i,n){switch(i){case"float":return n.floatPane;case"overlayMouseTarget":return n.markerMouseTarget;case"overlay":return n.markerPane;case"map":return n.mapPane;default:Bt(i)}}r.toBaidu=e})(a.MapPanes||(a.MapPanes={}));class ji{constructor(t,e){f(this,"baidu");f(this,"google");f(this,"projection");f(this,"element",void 0);f(this,"mapPane");this.map=t,this.mapPane=e.mapPane}create(){return this.element=this.onCreate(),this.element.className+=" element-overlay",this.element}draw(){this.projection&&this.onDraw(this.projection)}getProjection(){return this.projection}asBaidu(){if(!this.baidu){const t=this;ai();class e extends BMap.OverlayV3{initialize(s){var o;const l=t.create(),g=s.getPanes();return(o=a.MapPanes.toBaidu(t.mapPane,g))==null||o.appendChild(l),l}draw(){t.draw()}}this.baidu=new e;const i=t.map.innerMap;this.projection={fromLatLngToOverlayPoint(n){return i.pointToOverlayPixel(n.toBaidu(t.map.coordType))},fromOverlayPointToLatLng(n){return w.fromBaidu(i.overlayPixelToPoint(new BMap.Pixel(n.x,n.y)),t.map.coordType)}}}return this.baidu}asGoogle(){if(!this.google){const t=this;class e extends google.maps.OverlayView{onAdd(){const n=t.create(),s=this.getPanes()??I("onAdd回调中一定会有panes");a.MapPanes.toGoogle(t.mapPane,s).appendChild(n)}draw(){t.draw()}onRemove(){var n;(n=t.element.parentNode)==null||n.removeChild(t.element)}}this.google=new e,this.projection={fromLatLngToOverlayPoint(i){return t.google.getProjection().fromLatLngToDivPixel(i.toGoogle(t.map.coordType))??a.Point.ZERO},fromOverlayPointToLatLng(i){return w.fromGoogle(t.google.getProjection().fromDivPixelToLatLng(new google.maps.Point(i.x,i.y))??ie.LATLNG_ZERO,t.map.coordType)}}}return this.google}}let qt;function sn(r,t,e,i,n){return qt||(qt=on()),new qt(r,t,e,i,n)}function on(){return class extends google.maps.OverlayView{constructor(e,i,n,s=de.overlayMouseTarget,l){super();f(this,"container");this.position=i,this.offset=n,this._mapPane=s,this.container=document.createElement("div"),this.container.className="label-container",this.container.style.position="absolute",l&&this.setZIndex(l),this.container.addEventListener("click",()=>{google.maps.event.trigger(this,"click")}),this.setElement(e)}setZIndex(e){this.container.style.zIndex=`${e}`}setElement(e){const i=this.container.firstChild;i!==e&&(i?this.container.replaceChild(i,e):this.container.appendChild(e))}onAdd(){const e=this.getPanes()??I("onAdd回调中一定能够获取panes");a.MapPanes.toGoogle(this._mapPane,e).appendChild(this.container)}draw(){var e,i;if(this.container.style.display=this.position?"block":"none",this.position){const n=this.getProjection();if(n){const s=n.fromLatLngToDivPixel(this.position);s&&(this.container.style.left=`${s.x+(((e=this.offset)==null?void 0:e.x)??0)}px`,this.container.style.top=`${s.y+(((i=this.offset)==null?void 0:i.y)??0)}px`)}}}onRemove(){var e;(e=this.container.parentNode)==null||e.removeChild(this.container)}setPosition(e){this.position=e,this.draw()}getPosition(){return this.position}setOffset(e){this.offset=e,this.draw()}getOffset(){return this.offset}getVisible(){return this.container.style.visibility!=="hidden"}setVisible(e){this.container.style.visibility=e?"visible":"hidden"}}}var ue;(r=>{function t(i){return typeof i=="string"?i:i.outerHTML}r.toString=t;function e(i){if(typeof i=="string"){const n=document.createElement("div");return n.innerHTML=i,n}return i}r.toElement=e})(ue||(ue={}));class Kt extends Ce{constructor(e,i,n,s){super(e,i,n);f(this,"icon");f(this,"iconAnchor");f(this,"content",void 0);f(this,"contentObserver");this.setContentInternal(s,!0)}static create(e){var l;const i=this.coordType,n=new BMap.Label(ue.toString(e.content),{position:(l=e.position)==null?void 0:l.toBaidu(i),offset:e.offset&&new BMap.Size(e.offset.x,e.offset.y)});e.zIndex&&n.setZIndex(e.zIndex),n.setStyle({border:"0px",padding:"0px",backgroundColor:"unset"});const s=new Kt(n,i,this,e.content);return n.__label__=s,s}setContentInternal(e,i=!1){this.content!==e&&(this.contentObserver&&(this.contentObserver.disconnect(),this.contentObserver=void 0),typeof e!="string"&&(this.contentObserver=new MutationObserver(()=>{this.innerOverlay.setContent(e.outerHTML)}),this.contentObserver.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})),i||this.innerOverlay.setContent(ue.toString(e)),this.content=e)}setZIndex(e){this.innerOverlay.setZIndex(e)}getPosition(){return w.fromBaidu(this.innerOverlay.getPosition(),this.coordType)}setPosition(e){this.coordType=this.map.coordType,this.innerOverlay.setPosition(e.toBaidu(this.coordType))}getOffset(){const e=this.innerOverlay.getOffset();let i=0,n=0;return this.iconAnchor&&(i=this.iconAnchor.width,n=this.iconAnchor.height),{x:e.width-i,y:e.height-n}}setOffset(e){let i=0,n=0;this.iconAnchor&&(i=this.iconAnchor.width,n=this.iconAnchor.height),this.innerOverlay.setOffset(new BMap.Size(e.x+i,e.y+n))}setContent(e){this.setContentInternal(e)}attachIcon(e){var g;let i;if(e instanceof BMap.Icon)i=e.anchor;else if(e)if(e.anchor)i=e.anchor;else{const o=((g=e.__icon__)==null?void 0:g.baiduLabelOffset)??{x:0,y:0};i={width:e.style.anchor.width+o.x,height:e.style.anchor.height+o.y},process.env.NODE_ENV!=="production"&&setTimeout(()=>{var d,p;if(oe(e.__icon__,`${e}必须是由'SymbolIcon.toBaidu()'创建的`),!e.anchor){console.log("BaiduLabelOverlay.attachIcon","Bmap.Symbol.anchor尚未计算完成");return}const c=e.anchor.width-e.style.anchor.width,u=e.anchor.height-e.style.anchor.height;if(o.x!==c||o.y!==u){const _=[(d=e.__icon__.anchor)==null?void 0:d.x,(p=e.__icon__.anchor)==null?void 0:p.y,e.__icon__.rotation,e.__icon__.scale,e.__icon__.strokeWeight].map(y=>y??"").join(",");console.warn("BaiduLabelOverlay.attachIcon",e.__icon__,a.Strings.trimIndent(`
|
|
15
|
+
为了保证Label的位置正确, 请将SymbolIcon(${_})中baiduLabelOffset的值改写成:
|
|
16
16
|
${JSON.stringify({x:c,y:u})}
|
|
17
|
-
`))}},1)}const n=this.innerOverlay.getOffset();let s=n.width,l=n.height;this.iconAnchor&&(s-=this.iconAnchor.width,l-=this.iconAnchor.height),i&&(s+=i.width,l+=i.height),this.innerOverlay.setOffset(new BMap.Size(s,l)),this.icon=e,this.iconAnchor=i}}class qt extends lt{static create(t){var n;const e=this.coordType,i=Qr(pe.toElement(t.content),(n=t.position)==null?void 0:n.toGoogle(e),t.offset,t.mapPane,t.zIndex);return new qt(i,e,this)}setZIndex(t){this.innerOverlay.setZIndex(t)}setContent(t){this.innerOverlay.setElement(pe.toElement(t))}getPosition(){const t=this.innerOverlay.getPosition();return t?w.fromGoogle(t,this.coordType):w.ZERO}setPosition(t){this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toGoogle(this.coordType))}getOffset(){return this.innerOverlay.getOffset()??a.Point.ZERO}setOffset(t){this.innerOverlay.setOffset(t)}}const Oe={toGoogle:r=>"url"in r?a.Icon.toGoogle(r):a.SymbolIcon.toGoogle(r),toBaidu:r=>"url"in r?a.Icon.toBaidu(r):a.SymbolIcon.toBaidu(r)};a.Icon=void 0,(r=>{function t(i){return{url:i.url,size:new google.maps.Size(i.size.width,i.size.height),origin:i.origin&&new google.maps.Point(i.origin.x,i.origin.y),scaledSize:i.scaledSize&&new google.maps.Size(i.scaledSize.width,i.scaledSize.height),anchor:i.anchor&&new google.maps.Point(i.anchor.x,i.anchor.y)}}r.toGoogle=t;function e(i){return new BMap.Icon(i.url,new BMap.Size(i.size.width,i.size.height),{imageOffset:i.origin&&new BMap.Size(-i.origin.x,-i.origin.y),imageSize:i.scaledSize&&new BMap.Size(i.scaledSize.width,i.scaledSize.height),anchor:i.anchor?new BMap.Size(i.anchor.x,i.anchor.y):new BMap.Size(i.size.width/2,i.size.height)})}r.toBaidu=e})(a.Icon||(a.Icon={})),a.SymbolIcon=void 0,(r=>{function t(i){return{path:typeof i.path=="string"?i.path:i.path.google(),anchor:i.anchor&&new google.maps.Point(i.anchor.x,i.anchor.y),fillColor:i.fillColor,fillOpacity:i.fillOpacity,scale:i.scale,rotation:i.rotation,strokeColor:i.strokeColor,strokeOpacity:i.strokeOpacity,strokeWeight:i.strokeWeight}}r.toGoogle=t;function e(i){const n=new BMap.Symbol(typeof i.path=="string"?i.path:i.path.baidu(),{anchor:i.anchor&&new BMap.Size(i.anchor.x,i.anchor.y),fillColor:i.fillColor,fillOpacity:i.fillOpacity,scale:i.scale,rotation:i.rotation,strokeColor:i.strokeColor,strokeOpacity:i.strokeOpacity,strokeWeight:i.strokeWeight});return n.__icon__=i,n}r.toBaidu=e})(a.SymbolIcon||(a.SymbolIcon={}));const tn={CIRCLE:{baidu:()=>BMap_Symbol_SHAPE_CIRCLE,google:()=>google.maps.SymbolPath.CIRCLE},BACKWARD_CLOSED_ARROW:{baidu:()=>BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW,google:()=>google.maps.SymbolPath.BACKWARD_CLOSED_ARROW},BACKWARD_OPEN_ARROW:{baidu:()=>BMap_Symbol_SHAPE_BACKWARD_OPEN_ARROW,google:()=>google.maps.SymbolPath.BACKWARD_OPEN_ARROW},FORWARD_CLOSED_ARROW:{baidu:()=>BMap_Symbol_SHAPE_FORWARD_CLOSED_ARROW,google:()=>google.maps.SymbolPath.FORWARD_CLOSED_ARROW},FORWARD_OPEN_ARROW:{baidu:()=>BMap_Symbol_SHAPE_FORWARD_OPEN_ARROW,google:()=>google.maps.SymbolPath.FORWARD_OPEN_ARROW}};a.IconSequence=void 0,(r=>{function t(i){return{icon:a.SymbolIcon.toGoogle(i.icon),offset:i.offset,repeat:i.repeat,fixedRotation:i.fixedRotation}}r.toGoogle=t;function e(i){return new BMap.IconSequence(a.SymbolIcon.toBaidu(i.icon),i.offset,i.repeat??"",i.fixedRotation)}r.toBaidu=e})(a.IconSequence||(a.IconSequence={}));class ge extends Ce{constructor(t,e,i,n){super(t,e,i),this.state=n}static create(t){const e=this.coordType,i=t.icon,n={title:t.title,icon:i&&Oe.toBaidu(i),enableClicking:t.clickable,enableDragging:t.draggable,raiseOnDrag:t.crossOnDrag===void 0?!0:t.crossOnDrag,draggingCursor:t.cursor},s=new BMap.Marker(t.position.toBaidu(e,t.normalizePositionForBaidu),n);s.__create_by_tg__=!0,t.zIndex!==void 0&&s.setZIndex(t.zIndex);const l=t.clickable===void 0?!0:t.clickable,d=!!t.draggable;return new ge(s,e,this,{clickable:l,draggable:d,zIndex:t.zIndex,normalize:t.normalizePositionForBaidu}).visibleOptionInternal(t.visible)}getPosition(){return w.fromBaidu(this.innerOverlay.getPosition(),this.coordType)}setPosition(t){var e;this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toBaidu(this.coordType,this.state.normalize)),(e=this.innerOverlay.__info_box__)==null||e.onMarkerPositionChanged()}setTitle(t){this.innerOverlay.setTitle(t)}getTitle(){return this.innerOverlay.getTitle()}setIcon(t){const e=Oe.toBaidu(t);this.innerOverlay.setIcon(e);const i=this.getLabel();i&&i.attachIcon(e)}getIcon(){return this.innerOverlay.getIcon()}setClickable(t){this.state.clickable=t}isClickable(){return this.state.clickable}setDraggable(t){this.state.draggable=t,t?this.innerOverlay.enableDragging():this.innerOverlay.disableDragging()}isDraggable(){return this.state.draggable}setZIndex(t){this.state.zIndex=t,this.innerOverlay.setZIndex(t||0)}getZIndex(){return this.state.zIndex}setLabel(t){const e=this.getLabel();e&&e.attachIcon(void 0),t&&t.attachIcon(this.innerOverlay.getIcon()),this.innerOverlay.setLabel(t==null?void 0:t.innerOverlay)}getLabel(){var t;return(t=this.innerOverlay.getLabel())==null?void 0:t.__label__}}class yt extends lt{constructor(){super(...arguments);f(this,"label");f(this,"labelPositionListener");f(this,"labelVisibleListener");f(this,"labelMapChangedListener")}static create(e){const i=this.coordType,n=e.icon,s={position:e.position.toGoogle(i),title:e.title,zIndex:e.zIndex,visible:e.visible,icon:n&&Oe.toGoogle(n),clickable:e.clickable,draggable:e.draggable,crossOnDrag:e.crossOnDrag,cursor:e.cursor,anchorPoint:new google.maps.Point(0,0)};return new yt(new google.maps.Marker(s),i,this)}getPosition(){return w.fromGoogle(this.innerOverlay.getPosition(),this.coordType)}setPosition(e){this.coordType=this.map.coordType,this.innerOverlay.setPosition(e.toGoogle(this.coordType))}setTitle(e){this.innerOverlay.setTitle(e)}getTitle(){return this.innerOverlay.getTitle()||""}setIcon(e){this.innerOverlay.setIcon(Oe.toGoogle(e))}getIcon(){return this.innerOverlay.getIcon()}setClickable(e){this.innerOverlay.setClickable(e)}isClickable(){return this.innerOverlay.getClickable()}setDraggable(e){this.innerOverlay.setDraggable(e)}isDraggable(){return!!this.innerOverlay.getDraggable()}setZIndex(e){this.innerOverlay.setZIndex(e===void 0?null:e)}getZIndex(){const e=this.innerOverlay.getZIndex();return e===null?void 0:e}setLabel(e){if(this.label&&this.map.removeOverlay(this.label),this.labelPositionListener&&this.labelPositionListener.remove(),this.labelVisibleListener&&this.labelVisibleListener.remove(),this.labelMapChangedListener&&this.labelMapChangedListener.remove(),e){const i=()=>{e.innerOverlay.setPosition(this.innerOverlay.getPosition())},n=()=>{e.innerOverlay.setVisible(this.innerOverlay.getVisible())},s=()=>{this.innerOverlay.getMap()?this.map.addOverlay(e):this.map.removeOverlay(e)};s(),i(),n(),this.label=e,this.labelMapChangedListener=this.innerOverlay.addListener("map_changed",s),this.labelPositionListener=this.innerOverlay.addListener("position_changed",i),this.labelVisibleListener=this.innerOverlay.addListener("visible_changed",n)}else this.label=void 0,this.labelPositionListener=void 0,this.labelVisibleListener=void 0,this.labelMapChangedListener=void 0}}class vt extends U{constructor(){super(...arguments);f(this,"eventHubDelegate");f(this,"prevPath");f(this,"isDoingSetPath",!1);f(this,"onLineUpdate",()=>{var i;const e=this.innerOverlay.getPath();e!==this.prevPath&&(this.isDoingSetPath||(i=this.eventHubDelegate)==null||i.notify({type:this.pathEditedEventType,target:this,originalEvent:{prevPath:this.prevPath,path:e}}),this.prevPath=e)})}setPathInternal(e){this.isDoingSetPath=!0,this.innerOverlay.setPath(e),this.isDoingSetPath=!1}createDelegate(){return this.eventHubDelegate=new Ve(super.createDelegate(),{types:[this.pathEditedEventType],onListen:()=>{this.prevPath=this.innerOverlay.getPath(),this.innerOverlay.addEventListener("lineupdate",this.onLineUpdate)},onCancel:()=>{this.innerOverlay.removeEventListener("lineupdate",this.onLineUpdate),this.prevPath=void 0}})}}class _t extends vt{constructor(){super(...arguments);f(this,"pathEditedEventType","path-edited")}static create(e){var s,l;const i=this.coordType,n=new BMap.Polyline(e.path.map(d=>d.toBaidu(i)),{enableClicking:e.clickable,enableEditing:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+U.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,icons:(s=e.icons)==null?void 0:s.map(a.IconSequence.toBaidu)});return new _t(n,i,this,{editable:!!e.editable,symbolIcons:(l=e.icons)==null?void 0:l.map(d=>d.icon)}).visibleOptionInternal(e.visible)}getPath(){return this.innerOverlay.getPath().map(e=>w.fromBaidu(e,this.coordType))}setPath(e){this.coordType=this.map.coordType,this.setPathInternal(e.map(i=>i.toBaidu(this.coordType)))}remove(){var e;super.remove(),(e=this.state.symbolIcons)!=null&&e.length&&this.map.innerMap.getOverlays().filter(n=>{var o;if(!(n instanceof BMap.Marker))return!1;const s=n;if(s.__create_by_tg__)return!1;const l=s.getIcon();if(!(l instanceof BMap.Symbol))return!1;const d=l;return d.__icon__?(o=this.state.symbolIcons)==null?void 0:o.includes(d.__icon__):!1}).forEach(n=>this.map.innerMap.removeOverlay(n))}}class bt extends ht{constructor(){super(...arguments);f(this,"pathChangedListeners");f(this,"eventHubDelegate")}static create(e){var s;const i=this.coordType,n=new google.maps.Polyline({path:e.path.map(l=>l.toGoogle(i)),clickable:e.clickable,editable:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity,strokeWeight:e.strokeWeight,visible:e.visible,icons:(s=e.icons)==null?void 0:s.map(a.IconSequence.toGoogle)});return new bt(n,i,this)}setupPathChangedListeners(){const e=()=>{var n;return(n=this.eventHubDelegate)==null?void 0:n.notify({type:"path-edited",target:this})},i=this.innerOverlay.getPath();this.pathChangedListeners=a.MVCArrays.listenChanged(i,e)}clearPathChangedListeners(){var e;(e=this.pathChangedListeners)==null||e.forEach(i=>i.remove()),this.pathChangedListeners=void 0}createDelegate(){return this.eventHubDelegate=new Ve(super.createDelegate(),{types:["path-edited"],onListen:()=>this.setupPathChangedListeners(),onCancel:()=>this.clearPathChangedListeners()})}getPath(){const e=[];return this.innerOverlay.getPath().forEach(i=>{e.push(w.fromGoogle(i,this.coordType))}),e}setPath(e){var i;this.coordType=this.map.coordType,this.innerOverlay.setPath(e.map(n=>n.toGoogle(this.coordType))),(i=this.eventHubDelegate)!=null&&i.hasListener("path-edited")&&this.setupPathChangedListeners()}}class Mt extends vt{constructor(){super(...arguments);f(this,"pathEditedEventType","paths-edited")}static create(e){const i=this.coordType;e.paths.length>1&&console.warn("baidu不支持多path, 只会显示paths[0]");const n=e.paths[0]||[],s=new BMap.Polygon(n.map(l=>l.toBaidu(i)),{enableClicking:e.clickable,enableEditing:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+U.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity!=null?e.fillOpacity+U.OPACITY_DELTA:void 0});return new Mt(s,i,this,{editable:!!e.editable}).visibleOptionInternal(e.visible)}getPaths(){return[this.innerOverlay.getPath().map(e=>w.fromBaidu(e,this.coordType))]}setPaths(e){e.length>1&&console.warn("baidu不支持多path, 只会显示paths[0]"),this.coordType=this.map.coordType,this.setPathInternal((e[0]||[]).map(i=>i.toBaidu(this.coordType)))}}class Tt extends ht{constructor(){super(...arguments);f(this,"pathChangedListeners");f(this,"eventHubDelegate")}static create(e){const i=this.coordType,n=new google.maps.Polygon({paths:e.paths.map(s=>s.map(l=>l.toGoogle(i))),clickable:e.clickable,editable:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity,visible:e.visible});return new Tt(n,i,this)}setupPathChangedListeners(){const e=()=>{var n;return(n=this.eventHubDelegate)==null?void 0:n.notify({type:"paths-edited",target:this})},i=this.innerOverlay.getPaths();this.pathChangedListeners=[],i.forEach(n=>{this.pathChangedListeners.push(...a.MVCArrays.listenChanged(n,e))})}clearPathChangedListeners(){var e;(e=this.pathChangedListeners)==null||e.forEach(i=>i.remove()),this.pathChangedListeners=void 0}createDelegate(){return this.eventHubDelegate=new Ve(super.createDelegate(),{types:["paths-edited"],onListen:()=>this.setupPathChangedListeners(),onCancel:()=>this.clearPathChangedListeners()})}getPaths(){const e=this.innerOverlay.getPaths(),i=[];return e.forEach(n=>{const s=[];i.push(s),n.forEach(l=>{s.push(w.fromGoogle(l,this.coordType))})}),i}setPaths(e){var i;this.coordType=this.map.coordType,this.innerOverlay.setPaths(e.map(n=>n.map(s=>s.toGoogle(this.coordType)))),(i=this.eventHubDelegate)!=null&&i.hasListener("paths-edited")&&this.setupPathChangedListeners()}}class Ct extends vt{constructor(e,i,n,s){super(e,i,n,s);f(this,"pathEditedEventType","bounds-changed");f(this,"isDoingUpdateRectangle",!1);f(this,"onBoundsChanged",({originalEvent:e})=>{if(this.isDoingUpdateRectangle)return;const i=e.prevPath??[],n=e.path;setTimeout(()=>{let s=n;const l=n.length;if(i.length===4)if(l>i.length){for(let o=0;o<l;o++)if(i[o]==null||!zi.equals(n[o],i[o])){const c=n[(o-2+l)%l],u=n[(o-1+l)%l],g=n[o],m=n[(o+1)%l],v=n[(o+2)%l];let C;u.lat===m.lat?C=new BMap.Point(u.lng,g.lat):u.lng===m.lng?C=new BMap.Point(g.lng,u.lat):C=g,s=[c,v,C];break}}else if(l===i.length){for(let o=0;o<l;o++)if(!zi.equals(n[o],i[o])){s=[n[o],n[(o+2)%4]];break}}else l<i.length;const d=j.fromArray(s.map(o=>w.fromBaidu(o,this.coordType)));d&&(this.isDoingUpdateRectangle=!0,this.innerOverlay.setPath(d.toRectArray().map(o=>o.toBaidu(this.coordType))),this.isDoingUpdateRectangle=!1)},0)});this.addEventListener("bounds-changed",this.onBoundsChanged)}static create(e){const i=this.coordType,n=new BMap.Polygon(e.bounds.toRectArray().map(s=>s.toBaidu(i)),{enableClicking:e.clickable,enableEditing:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+U.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity!=null?e.fillOpacity+U.OPACITY_DELTA:void 0});return new Ct(n,i,this,{editable:!!e.editable}).visibleOptionInternal(e.visible)}getBounds(){return j.fromBaidu(this.innerOverlay.getBounds(),this.coordType)}setBounds(e){const i=e.toRectArray();this.innerOverlay.getPath().length===i.length?e.toRectArray().forEach((n,s)=>{this.innerOverlay.setPositionAt(s,n.toBaidu(this.coordType))}):this.setPathInternal(i.map(n=>n.toBaidu(this.coordType)))}}class Ot extends ht{static create(t){const e=this.coordType,i=new google.maps.Rectangle({bounds:t.bounds.toGoogle(e),clickable:t.clickable,editable:t.editable,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,strokeWeight:t.strokeWeight,fillColor:t.fillColor,fillOpacity:t.fillOpacity,visible:t.visible});return new Ot(i,e,this)}getBounds(){return j.fromGoogle(this.innerOverlay.getBounds()??ie.BOUNDS_ZERO,this.coordType)}setBounds(t){const e=t.toGoogle(this.coordType);e.equals(this.innerOverlay.getBounds())||this.innerOverlay.setBounds(e)}}const se=1;class rn extends at{constructor(e,i){var n;super(e);f(this,"buildInMapTypeId2BIMT");f(this,"baiduMapType2BIMT");f(this,"map");f(this,"createLabel",Yt.create);f(this,"createCircle",ct.create);f(this,"createPolygon",Mt.create);f(this,"createPolyline",_t.create);f(this,"createRectangle",Ct.create);f(this,"createInfoWindow",pt.create);f(this,"createInfoBox",mt.create);f(this,"createMarker",ge.create);f(this,"createMapTypeControl",Ue.create);f(this,"createZoomControl",Qe.create);f(this,"createStreetViewControl",Xe.create);f(this,"createScaleControl",qe.create);this.buildInMapTypeId2BIMT=a.MapType.BUILD_IN_MAP_TYPES.getValueMap(W.prototype.getId),this.baiduMapType2BIMT=a.MapType.BUILD_IN_MAP_TYPES.getValueMap(W.prototype.asBaiduMapType),this.map=new BMap.Map(e,{minZoom:i.minZoom&&i.minZoom+se,maxZoom:i.maxZoom&&i.maxZoom+se,mapType:i.buildInMapTypeId&&((n=this.buildInMapTypeId2BIMT.get(i.buildInMapTypeId))==null?void 0:n.asBaiduMapType()),enableMapClick:!1}),this.map.centerAndZoom(i.center.toBaidu(this.coordType),i.zoom+se),this.setGestureHandling(i.gestureHandling),i.infoWindowMode==="multi"&&console.warn("baidu不支持多个InfoWindow, 可能会出现未知问题"),i.mapStyle&&this.map.setMapStyleV2(i.mapStyle.baidu),this.setEventTargetDelegate(new _e(this.map,this)),this.map.addEventListener("addoverlay",s=>{const l=s.target.__info_box__;l&&(console.debug("add:info-box",l),this.map.addOverlay(l))}),this.map.addEventListener("removeoverlay",s=>{const l=s.target.__info_box__;l&&(console.debug("remove:info-box",l),this.map.removeOverlay(l))})}setGestureHandling(e=X.auto){switch(e===X.auto&&(e=this.element.parentElement&&xt.isScrollable(this.element.parentElement)?X.cooperative:X.greedy),e){case X.cooperative:this.map.disableScrollWheelZoom(),this.map.enableDragging(),this.map.enableDoubleClickZoom();break;case X.greedy:this.map.enableScrollWheelZoom(),this.map.enableDragging(),this.map.enableDoubleClickZoom();break;case X.none:this.map.disableDragging(),this.map.disableScrollWheelZoom(),this.map.disableDoubleClickZoom();break}}get innerMap(){return this.map}get coordType(){return this.getMapType().getBaiduCoordType()}addEventListener(e,i){if(e==="center-changed"){super.addEventListener("movestart",i),super.addEventListener("moving",i),super.addEventListener("moveend",i),super.addEventListener("zoomend",i);return}super.addEventListener(e,i)}removeEventListener(e,i){if(e==="center-changed"){super.removeEventListener("movestart",i),super.removeEventListener("moving",i),super.removeEventListener("moveend",i),super.removeEventListener("zoomend",i);return}super.removeEventListener(e,i)}fromContainerPointToLatLng(e){return w.fromBaidu(this.innerMap.pixelToPoint(new BMap.Pixel(e.x,e.y)),this.coordType)}fromLatLngToContainerPoint(e){return this.innerMap.pointToPixel(e.toBaidu(this.coordType))}setDefaultCursor(e){this.innerMap.setDefaultCursor(e)}setDraggable(e){e?this.innerMap.enableDragging():this.innerMap.disableDragging()}setDoubleClickZoom(e){e?this.map.enableDoubleClickZoom():this.map.disableDoubleClickZoom()}getCenter(){return w.fromBaidu(this.map.getCenter(),this.coordType)}setCenter(e){this.map.setCenter(e.toBaidu(this.coordType))}getZoom(){return super.getZoom()-se}setZoom(e){return super.setZoom(e+se)}setMinZoom(e){this.map.setMinZoom(e+se)}setMaxZoom(e){this.map.setMaxZoom(e+se)}setMapStyle(e){this.map.setMapStyleV2((e==null?void 0:e.baidu)??{styleJson:[]})}setBuildInMapTypeId(e){var n;const i=(n=this.buildInMapTypeId2BIMT.get(e))==null?void 0:n.asBaiduMapType();this.map.setMapType(i??I("理论上来说不可能为空"))}setMapType(e){this.map.setMapType(e.asBaiduMapType())}getMapType(){const e=this.map.getMapType(),i=this.baiduMapType2BIMT.get(e);return i||(e.__baidu_map_type__??I("实现asBaiduMapType()时, 忘了给实例设置__baidu_map_type__?"))}addLayer(e){this.map.addTileLayer(e.asBaiduLayer())}removeLayer(e){this.map.removeTileLayer(e.asBaiduLayer())}panTo(e){this.map.panTo(e.toBaidu(this.coordType))}panBy(e,i){this.map.panBy(e,i)}fitBounds(e,i){this.map.setViewport(e.toBaiduArray(this.coordType),{margins:i&&[i.top,i.right,i.bottom,i.left]})}getBounds(){return j.fromBaidu(this.map.getBounds(),this.coordType)}addElementOverlay(e){this.map.addOverlay(e.asBaidu())}removeElementOverlay(e){this.map.removeOverlay(e.asBaidu())}addOverlay(e){this.map.addOverlay(e.innerOverlay)}removeOverlay(e){this.map.removeOverlay(e.innerOverlay)}addCustomControl(e){if(!e.inner){const i=class extends BMap.Control{constructor(){super(...arguments);f(this,"defaultAnchor",a.ControlPositionConverter.getBaidu().toValue(e.position));f(this,"defaultOffset",new BMap.Size(0,0))}initialize(s){const l=e.onCreateElement();return s.getContainer().appendChild(l),l}};e.inner=new i,this.map.addControl(e.inner)}}removeCustomControl(e){e.inner&&(ne(e.inner instanceof BMap.Control,`control.inner(${e.inner})需要是BMap.Control`),this.map.removeControl(e.inner))}createMarkerClusterer(e){return new Ci(this,e)}createHeatmap(e){return new yi(this,e)}createAutocomplete(e){return new pi(this,e)}createSearchBox(e){return new Li(this,e)}createPlacesService(e){return new Ei(this,e)}createMapUrls(e){return new nt(e)}}class nn extends at{constructor(e,i){var s,l;super(e);f(this,"buildInMapTypeId2BIMT");f(this,"googleMapTypeId2BIMT");f(this,"map");f(this,"createLabel",qt.create);f(this,"createCircle",dt.create);f(this,"createPolygon",Tt.create);f(this,"createPolyline",bt.create);f(this,"createRectangle",Ot.create);f(this,"createInfoWindow",gt.create);f(this,"createInfoBox",ft.create);f(this,"createMarker",yt.create);f(this,"createMapTypeControl",Ye.create);f(this,"createZoomControl",et.create);f(this,"createStreetViewControl",Je.create);f(this,"createScaleControl",Ke.create);this.mapOptions=i,this.buildInMapTypeId2BIMT=a.MapType.BUILD_IN_MAP_TYPES.getValueMap(W.prototype.getId),this.googleMapTypeId2BIMT=a.MapType.BUILD_IN_MAP_TYPES.getValueMap(W.prototype.getGoogleMapTypeId);const n=i.buildInMapTypeId&&this.buildInMapTypeId2BIMT.get(i.buildInMapTypeId);this.map=new google.maps.Map(e,{center:i.center.toGoogle((n??a.MapType.NORMAL).getGoogleCoordType()),zoom:i.zoom,disableDefaultUI:!0,gestureHandling:i.gestureHandling,minZoom:i.minZoom,maxZoom:i.maxZoom,styles:(s=i.mapStyle)==null?void 0:s.google.styles,mapId:(l=i.mapStyle)==null?void 0:l.google.mapId,mapTypeId:n==null?void 0:n.getGoogleMapTypeId()}),this.setEventTargetDelegate(new he(this.map,this))}setGestureHandling(e){this.map.setOptions({gestureHandling:e})}get innerMap(){return this.map}get coordType(){return this.getMapType().getGoogleCoordType()}fromContainerPointToLatLng(e){const i=this.innerMap.getProjection(),n=this.innerMap.getBounds();if(i==null||n==null)return w.ZERO;const s=i.fromLatLngToPoint(n.getSouthWest()),l=i.fromLatLngToPoint(n.getNorthEast()),d=this.innerMap.getZoom();if(s==null||l==null||d==null)return w.ZERO;const o=Math.pow(2,d),c=new google.maps.Point(e.x/o+s.x,e.y/o+l.y);return w.fromGoogle(i.fromPointToLatLng(c)??ie.LATLNG_ZERO,this.coordType)}fromLatLngToContainerPoint(e){const i=this.innerMap.getProjection(),n=this.innerMap.getBounds();if(i==null||n==null)return a.Point.ZERO;const s=i.fromLatLngToPoint(n.getSouthWest()),l=i.fromLatLngToPoint(n.getNorthEast()),d=this.innerMap.getZoom();if(s==null||l==null||d==null)return a.Point.ZERO;const o=Math.pow(2,d),c=i.fromLatLngToPoint(e.toGoogle(this.coordType));return c==null?a.Point.ZERO:{x:(c.x-s.x)*o,y:(c.y-l.y)*o}}setDefaultCursor(e){this.innerMap.setOptions({draggableCursor:e})}setDraggable(e){this.innerMap.setOptions({draggable:e})}setDoubleClickZoom(e){this.map.setOptions({disableDoubleClickZoom:!e})}getCenter(){return w.fromGoogle(this.map.getCenter()??ie.LATLNG_ZERO,this.coordType)}setCenter(e){this.map.setCenter(e.toGoogle(this.coordType))}setMinZoom(e){this.map.setOptions({minZoom:e})}setMaxZoom(e){this.map.setOptions({maxZoom:e})}setMapStyle(e){this.map.setOptions({styles:e==null?void 0:e.google.styles,mapId:e==null?void 0:e.google.mapId})}setBuildInMapTypeId(e){var n;const i=(n=this.buildInMapTypeId2BIMT.get(e))==null?void 0:n.getGoogleMapTypeId();this.map.setMapTypeId(i??I("理论上来说不可能为空"))}setMapType(e){e instanceof W?this.map.setMapTypeId(e.getGoogleMapTypeId()):(this.map.mapTypes.set(e.id,e.asGoogleMapType()),this.map.setMapTypeId(e.id))}getMapType(){const e=this.map.getMapTypeId()??google.maps.MapTypeId.ROADMAP,i=this.googleMapTypeId2BIMT.get(e);return i||(this.map.mapTypes.get(e).__google_map_type__??I(`实现${e}的asGoogleMapType()时, 忘了给实例设置__google_map_type__?`))}addOverlayMapType(e){this.map.overlayMapTypes.push(e.asGoogleMapType())}removeOverlayMapType(e){a.MVCArrays.remove(this.map.overlayMapTypes,e.asGoogleMapType())}addLayer(e){e.asGoogleLayer().setMap(this.map)}removeLayer(e){e.asGoogleLayer().setMap(null)}panTo(e){this.map.panTo(e.toGoogle(this.coordType))}panBy(e,i){this.map.panBy(e,i)}fitBounds(e,i){this.map.fitBounds(e.toGoogle(this.coordType),i)}getBounds(){const e=this.map.getBounds();return e?j.fromGoogle(e,this.coordType):j.EMPTY}addElementOverlay(e){e.asGoogle().setMap(this.map)}removeElementOverlay(e){e.asGoogle().setMap(null)}addOverlay(e){e.innerOverlay.setMap(this.map)}removeOverlay(e){e.innerOverlay.setMap(null)}addCustomControl(e){e.inner||(e.inner=e.onCreateElement(),this.map.controls[a.ControlPositionConverter.getGoogle().toValue(e.position)].push(e.inner))}removeCustomControl(e){if(e.inner){const i=this.map.controls[a.ControlPositionConverter.getGoogle().toValue(e.position)];a.MVCArrays.remove(i,e.inner)}}createMarkerClusterer(e){return new Oi(this,e)}createHeatmap(e){return new fi(this,e)}createAutocomplete(e){return new ui(this,e)}createSearchBox(e){return new Pi(this,e)}createPlacesService(e){return new wi(this,e)}createMapUrls(e){return new rt(e)}}const wt=["3.0"],sn={baidu:{version:"3.0",key:"kXOq8Hg9BZbZEWAjXKuzd1oGreynup8h"},google:{version:"quarterly",key:"AIzaSyBcyzMel3dYFNcfcr0LOklbBQNpWycyZXo",language:"en-us",libraries:["places","visualization"]},here:{version:wt[0],key:""}};let Zi;function Kt(){return Zi||I("请先安装: Vue<PartialTgMapConfig>.use(TgMap, {})")}function Wi(r){r!=null&&(Zi=ki(sn,r))}class on extends at{constructor(e,i){var l;super(e);f(this,"map");f(this,"defaultLayers");this.mapOptions=i;const n=Kt().here;wt.includes(n.version)||I(`不支持${n.version}, HereMap当前只支持如下版本: ${wt}`);const s=new H.service.Platform({app_id:n.key.split(",")[0],app_code:n.key.split(",")[1]});this.defaultLayers=s.createDefaultLayers(),this.map=new H.Map(e,this.defaultLayers.normal.map,{zoom:i.zoom,center:(l=i.center)==null?void 0:l.toHere(this.coordType)}),new H.mapevents.Behavior(new H.mapevents.MapEvents(this.map)),H.ui.UI.createDefault(this.map,this.defaultLayers)}get innerMap(){return this.map}get coordType(){return R.wgs84}getCenter(){return w.fromHere(this.map.getCenter(),this.coordType)}setCenter(e){this.map.setCenter(e.toHere(this.coordType))}setGestureHandling(e){throw new Error("Method not implemented.")}fromContainerPointToLatLng(e){throw new Error("Method not implemented.")}fromLatLngToContainerPoint(e){throw new Error("Method not implemented.")}setDefaultCursor(e){throw new Error("Method not implemented.")}setDraggable(e){throw new Error("Method not implemented.")}setDoubleClickZoom(e){throw new Error("Method not implemented.")}setMinZoom(e){throw new Error("Method not implemented.")}setMaxZoom(e){throw new Error("Method not implemented.")}setMapStyle(e){throw new Error("Method not implemented.")}setBuildInMapTypeId(e){throw new Error("Method not implemented.")}setMapType(e){throw new Error("Method not implemented.")}getMapType(){throw new Error("Method not implemented.")}addLayer(e){throw new Error("Method not implemented.")}removeLayer(e){throw new Error("Method not implemented.")}panTo(e){throw new Error("Method not implemented.")}panBy(e,i){throw new Error("Method not implemented.")}fitBounds(e,i){throw new Error("Method not implemented.")}getBounds(){throw new Error("Method not implemented.")}addElementOverlay(e){throw new Error("Method not implemented.")}removeElementOverlay(e){throw new Error("Method not implemented.")}addOverlay(e){throw new Error("Method not implemented.")}removeOverlay(e){throw new Error("Method not implemented.")}createMarker(e){throw new Error("Method not implemented.")}createMarkerClusterer(e){throw new Error("Method not implemented.")}createHeatmap(e){throw new Error("Method not implemented.")}createAutocomplete(e){throw new Error("Method not implemented.")}createSearchBox(e){throw new Error("Method not implemented.")}createPlacesService(e){throw new Error("Method not implemented.")}createMapUrls(e){throw new Error("Method not implemented.")}createInfoWindow(e){throw new Error("Method not implemented.")}createInfoBox(e){throw new Error("Method not implemented.")}createPolyline(e){throw new Error("Method not implemented.")}createPolygon(e){throw new Error("Method not implemented.")}createRectangle(e){throw new Error("Method not implemented.")}createCircle(e){throw new Error("Method not implemented.")}createLabel(e){throw new Error("Method not implemented.")}addCustomControl(e){throw new Error("Method not implemented.")}removeCustomControl(e){throw new Error("Method not implemented.")}createMapTypeControl(e){throw new Error("Method not implemented.")}createZoomControl(e){throw new Error("Method not implemented.")}createStreetViewControl(e){throw new Error("Method not implemented.")}createScaleControl(e){throw new Error("Method not implemented.")}}var Y=(r=>(r.google="google",r.baidu="baidu",r.here="here",r))(Y||{});a.TgMapFactory=void 0,(r=>{function t(e,i,n){const s=a.MapOptions.create(n);switch(e){case"google":return new nn(i,s);case"baidu":return new rn(i,s);case"here":return new on(i,s)}}r.createMap=t})(a.TgMapFactory||(a.TgMapFactory={}));var an={VITE_APP_DEV_KEY_BAIDU:"kXOq8Hg9BZbZEWAjXKuzd1oGreynup8h",VITE_APP_DEV_KEY_GOOGLE:"AIzaSyBcyzMel3dYFNcfcr0LOklbBQNpWycyZXo",VITE_APP_DEV_KEY_HERE:"",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const ln={};function Hi(r){return a.Objects.putIfAbsent(ln,r,()=>ei(()=>hn({type:r,config:Kt()[r]})))()}function hn({type:r,config:t}){const e=window,i=cn(r);if(a.Objects.get(e,i))return Promise.resolve();switch(r!==Y.here&&!t.key&&I(`请先配置${r}地图的key`),r){case Y.google:return an.VITE_FALSE?(Pr({key:t.key,v:"3.52"}),google.maps.importLibrary("core")):Vi(`https://maps.googleapis.com/maps/api/js?key=${t.key}&language=${t.language}&v=${t.version}&libraries=${t.libraries.join(",")}`);case Y.baidu:return Vi(`https://api.map.baidu.com/api?v=${t.version}&ak=${t.key}`);case Y.here:return Ee(we("core",t.version)).then(()=>Promise.all([Ee(we("service",t.version)),Ee(we("mapevents",t.version)),Ee(we("clustering",t.version)),Ee(we("ui",t.version))])).catch(n=>(a.Objects.del(e,i),Promise.reject(n)));default:Ge(r)}}function we(r,t=wt[0]){return`https://js.api.here.com/v3/${t}/mapsjs-${r}.js`}function cn(r){switch(r){case Y.google:return"google.maps";case Y.baidu:return"BMap";case Y.here:return"H"}}let dn=0;function Vi(r,t="callback"){return new Promise((e,i)=>{const n=`__callback${dn++}`;window[n]=e;const s=document.createElement("script");s.src=`${r}&${t}=${n}`,s.onerror=i,document.body.appendChild(s)})}function Ee(r){return new Promise((t,e)=>{const i=document.createElement("script");i.src=r,i.onload=t,i.onerror=e,document.body.appendChild(i)})}function V(r,t){return{type:String,default:t,validator:e=>Object.values(r).includes(e)}}function ji(r,t){return{type:String,default:t,validator:e=>r.includes(e)}}function N(r){return{type:r,required:!0}}function T(r,t){return{type:r,default:t}}function un(r){const t={};return Object.entries(r).forEach(([e,i])=>{const n=`__${e}`;t[e]={get(){const s=this[n];return s===void 0?i:s},set(s){this[n]=s}}}),t}const Pe={enumerable:!0,configurable:!0,get:le,set:le};function Fi(r){return Object.keys(r).forEach(t=>{const e=r[t];let i=!1;typeof e=="function"?(Pe.get=e,Pe.set=le,i=!0):typeof e=="object"&&typeof e.get=="function"&&(Pe.get=e.get,Pe.set=e.set,i=!0),i&&(r[t]=Object.defineProperty(r,t,Pe))}),r}function pn(r){return Fi(r)}function Le(){return y.createCommentVNode()}function Be(r,t){const e=r.$options[t];if(e)for(const i of e)i.call(r)}function gn(r,t){for(const e of r)if(e.$options.name===t.name)return e}function mn(r,t){if(!r.default)return;const e=r.default();for(const i of e)if((i==null?void 0:i.type).name===t.name)return i}function Ui(r,t){const e={},i={},n={};return Object.keys(r).forEach(s=>{s.startsWith("on")?e[a.Strings.pascal2kebab(s.substring(2))]=r[s]:i[s]=r[s]}),t&&Object.keys(t).forEach(s=>{s.startsWith("on")&&(n[a.Strings.pascal2kebab(s.substring(2))]=t[s])}),{binds:i,listeners:e,listenerProps:n}}function J(r,t){return y.computed(()=>Ui(r,t))}function x(){return Function}const fn=()=>{let r,t;function e(n){console.log(n),r=n&&n.type,t=Date.now()}function i(n){((n&&n.type)!==r||Date.now()-(t??0)>1e3)&&e(n)}return{eventLog:e,eventLogLess:i}},Et="$map",me="onCreate",fe="onDestroy",z=y.defineComponent({inject:[Et],mounted(){Be(this,me)},beforeUnmount(){Be(this,fe)},methods:{recreate(){Be(this,fe),Be(this,me)}},render(){return Le()}}),yn=y.defineComponent({name:"tg-map",provide(){return{[Et]:y.computed(()=>this.map)}},inheritAttrs:!1,props:{type:V(Y,Y.google),center:N(w),centerSyncDelay:T(Number,300),currentCenter:T(w),lastCenter:T(w),zoom:N(Number),infoWindowMode:ji(Di),gestureHandling:V(X),minZoom:T(Number),maxZoom:T(Number),mapStyle:T(Object),mapTypeId:V(Rt),mapType:T(Object),hideLogo:T(Boolean),onLoad:x(),"onUpdate:center":x(),"onUpdate:current-center":x(),"onUpdate:last-center":x(),"onUpdate:map-type":x(),"onUpdate:map-type-id":x(),"onUpdate:zoom":x(),onError:x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),centerSyncTimeoutId:void 0}},data(){return{map:Ne(),isDestroyed:!1}},computed:{propsJson(){return a.Objects.toJsonSafely(this.$props)}},watch:{gestureHandling(r){var t;r&&((t=this.map)==null||t.setGestureHandling(r))},minZoom(r){var t;(t=this.map)==null||t.setMinZoom(r)},maxZoom(r){var t;(t=this.map)==null||t.setMaxZoom(r)},mapStyle(r){var t;(t=this.map)==null||t.setMapStyle(r)},mapTypeId(r){var t;r&&((t=this.map)==null||t.setBuildInMapTypeId(r))},mapType(r){var t;(t=this.map)==null||t.setMapType(r??a.MapType.NORMAL)}},async mounted(){const r=this.type;try{await Hi(r)}catch(n){this.$emit("error",n);return}if(this.isDestroyed){console.warn(`tg-map(type=${r})已销毁, 不需要继续执行`);return}const t=a.TgMapFactory.createMap(r,this.$refs.map,{center:this.center,zoom:this.zoom,infoWindowMode:this.infoWindowMode,gestureHandling:this.gestureHandling,minZoom:this.minZoom,maxZoom:this.maxZoom,mapStyle:this.mapStyle,buildInMapTypeId:this.mapTypeId});if(this.map=y.markRaw(t),this.mapType&&t.setMapType(this.mapType),"ready"in this.attrs.listeners&&console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"),$(this.attrs.listeners,t,["load"]),this.$emit("load",t),y.watch([()=>this.zoom,()=>this.center],([n,s],[l,d])=>{n!==l&&t.setZoom(n),s!==d&&(t.getCenter().equals(s)||t.setCenter(s))}),this.attrs.listenerProps["update:center"]){const n=()=>this.$emit("update:center",t.getCenter());t.addEventListener("center-changed",()=>{this.centerSyncDelay>0?(clearTimeout(this.centerSyncTimeoutId),this.centerSyncTimeoutId=setTimeout(n,this.centerSyncDelay)):n()})}this.attrs.listenerProps["update:current-center"]&&(this.$emit("update:current-center",this.center),t.addEventListener("center-changed",()=>{this.$emit("update:current-center",t.getCenter())})),this.attrs.listenerProps["update:zoom"]&&t.addEventListener("zoom-changed",()=>{this.$emit("update:zoom",t.getZoom())});const e=this.attrs.listenerProps["update:map-type"],i=this.attrs.listenerProps["update:map-type-id"];(e||i)&&t.addEventListener("map-type-changed",()=>{const n=t.getMapType();e&&this.$emit("update:map-type",n),i&&this.$emit("update:map-type-id",n.id)})},unmounted(){this.isDestroyed=!0,this.map&&(this.attrs.listenerProps["update:last-center"]&&this.$emit("update:last-center",this.map.getCenter()),this.attrs.listenerProps["update:center"]&&(clearTimeout(this.centerSyncTimeoutId),this.$emit("update:center",this.map.getCenter())))},methods:{}}),Q=(r,t)=>{const e=r.__vccOpts||r;for(const[i,n]of t)e[i]=n;return e};function vn(r,t,e,i,n,s){return y.openBlock(),y.createElementBlock("div",y.mergeProps({class:"tg-map"},r.attrs.binds),[y.createElementVNode("div",{ref:"map",class:y.normalizeClass({"tg-map__map":!0,[`tg-map__map--hide-logo-${r.type}`]:r.hideLogo})},null,2),y.createCommentVNode("",!0),r.map?y.renderSlot(r.$slots,"default",{key:1}):y.createCommentVNode("",!0),y.renderSlot(r.$slots,"overlay")],16)}const ye=Q(yn,[["render",vn]]);function _n(r){if(r==null)return;let t;if(typeof r=="string"){if(t=+r,Number.isNaN(t))return r}else t=r;return`${t}px`}const bn=y.defineComponent({name:"tg-map-widget",props:{left:{type:[Number,String],default:null},top:{type:[Number,String],default:null},right:{type:[Number,String],default:null},bottom:{type:[Number,String],default:null}},computed:{topValue(){return this.top==null&&this.bottom==null?0:this.top}},methods:{dimen:_n}});function Mn(r,t,e,i,n,s){return y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(r.$options.name),style:y.normalizeStyle({left:r.dimen(r.left),top:r.dimen(r.topValue),right:r.dimen(r.right),bottom:r.dimen(r.bottom)})},[y.renderSlot(r.$slots,"default")],6)}const Yi=Q(bn,[["render",Mn]]),Tn=y.defineComponent({name:"tg-custom-control",mixins:[z],props:{position:V(k,k.RIGHT_BOTTOM)},setup(){return{control:void 0}},watch:{position(){this.recreate()}},onCreate(){St(this.$parent,ye)||console.warn("请将tg-custom-control放到tg-map中");const{$el:r}=this,t=class extends oi{onCreateElement(){return r}};this.control=new t(this.position),this.$map.addCustomControl(this.control)},onDestroy(){this.$map.removeCustomControl(this.control)}});function Cn(r,t,e,i,n,s){return y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(r.$options.name)},[y.renderSlot(r.$slots,"default")],2)}const qi=Q(Tn,[["render",Cn]]),Ki=y.defineComponent({name:"tg-map-type-control",mixins:[z],props:{position:V(k,k.TOP_LEFT),type:V(Dt),mapTypes:T(Array)},setup(){return{control:void 0}},watch:{position(r){this.control.setPosition(r)},type(){this.recreate()},mapTypes:{handler(){this.recreate()},deep:!0}},onCreate(){this.control=this.$map.createMapTypeControl(this),this.$map.addControl(this.control)},onDestroy(){this.$map.removeControl(this.control)}}),Xi=y.defineComponent({name:"tg-scale-control",mixins:[z],props:{position:V(k,k.BOTTOM_RIGHT)},setup(){return{control:void 0}},watch:{position(r){this.control.setPosition(r)}},onCreate(){this.control=this.$map.createScaleControl(this),this.$map.addControl(this.control)},onDestroy(){this.$map.removeControl(this.control)}});function Ji(){var e;const r=(e=y.getCurrentInstance())==null?void 0:e.type;let t=(r==null?void 0:r.name)??(r==null?void 0:r.__name);if(!t){const i=r==null?void 0:r.__file;i&&(t=Gi.basename(i,".vue"))}return t}function Pt(){const r=y.inject(Et);let t,e;return r==null&&I(`<${Ji()||"unknown"}>必须作为<tg-map>的子代组件`),{mapRef:r,get map(){return r.value??I("map尚未初始化")},[me](i){y.onMounted(i),t&&I(`${me}只能调用一次`),t=i},[fe](i){y.onBeforeUnmount(i),e&&I(`${fe}只能调用一次`),e=i},recreate(){e==null||e(),t==null||t()}}}const Qi=y.defineComponent({name:"tg-street-view-control",props:{position:V(k,k.RIGHT_BOTTOM)},setup(r){let t=void 0;const{map:e,onCreate:i,onDestroy:n}=Pt();return i(()=>{t=e.createStreetViewControl(r),e.addControl(t)}),n(()=>{e.removeControl(t)}),y.watch(()=>r.position,s=>{t.setPosition(s)}),Le}}),er=y.defineComponent({name:"tg-zoom-control",props:{position:V(k,k.RIGHT_BOTTOM)},setup(r){let t=void 0;const{map:e,onCreate:i,onDestroy:n}=Pt();return i(()=>{t=e.createZoomControl(r),e.addControl(t)}),n(()=>{e.removeControl(t)}),y.watch(()=>r.position,s=>{t.setPosition(s)}),Le}}),tr=y.defineComponent({name:"tg-heatmap",props:{maxIntensity:T(Number),gradient:T(Object),opacity:T(Number),radius:T(Number),data:N(Array)},setup(r){const{map:t,onCreate:e,onDestroy:i}=Pt();let n=void 0;return e(()=>{n=t.createHeatmap(r)}),i(()=>{n.remove()}),y.watch(()=>r.data,s=>n.setData(s)),y.watch([()=>r.maxIntensity,()=>r.gradient,()=>r.opacity,()=>r.radius],()=>n.setOptions(r)),Le}}),On=y.defineComponent({name:"tg-marker-clusterer",mixins:[z],props:{gridSize:T(Number),maxZoom:T(Number),minClusterSize:T(Number),averageCenter:T(Boolean),styles:T(Array),stylesIndexCalculator:T(Function),zIndex:T(Number)},setup(){return{clusterer:void 0,markers:[]}},watch:{gridSize(){this.recreate()},maxZoom(){this.recreate()},minClusterSize(){this.recreate()},averageCenter(){this.recreate()},styles:{handler(){this.recreate()},deep:!0},stylesIndexCalculator(){this.recreate()},zIndex(){this.recreate()}},onCreate(){this.clusterer=this.$map.createMarkerClusterer(this)},onDestroy(){this.clusterer.clearMarkers()},methods:{isInitiated(){return this.clusterer!=null},onAddMarker(r){this.markers.push(r),this.isInitiated()&&this.clusterer.addMarker(r)},onRemoveMarker(r){this.isInitiated()&&this.clusterer.removeMarker(r),a.Arrays.remove(this.markers,r)}}});function wn(r,t,e,i,n,s){return y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(r.$options.name)},[y.renderSlot(r.$slots,"default")],2)}const Xt=Q(On,[["render",wn]]),ir=y.defineComponent({name:"tg-traffic-layer",mixins:[z],setup(){return{layer:void 0}},watch:{},onCreate(){this.layer=new li,this.$map.addLayer(this.layer)},onDestroy(){this.$map.removeLayer(this.layer)}}),rr=y.defineComponent({name:"tg-circle",mixins:[z],inheritAttrs:!1,props:{center:N(w),radius:N(Number),clickable:T(Boolean),editable:T(Boolean),strokeColor:T(String),strokeOpacity:T(Number),strokeWeight:T(Number),visible:T(Boolean),fillColor:T(String),fillOpacity:T(Number),"onUpdate:center":x(),"onUpdate:radius":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),overlay:void 0,emittedRadius:void 0,emittedCenter:void 0}},watch:{center(r){if(this.emittedCenter!=null){const t=this.emittedCenter;if(this.emittedCenter=void 0,t===y.toRaw(r))return}this.overlay.setCenter(r)},radius(r){if(this.emittedRadius!=null){const t=this.emittedRadius;if(this.emittedRadius=void 0,t===r)return}this.overlay.setRadius(r)},clickable(){this.recreate()},editable(r){this.overlay.setEditable(r)},strokeColor(r){this.overlay.setStrokeColor(r)},strokeOpacity(r){this.overlay.setStrokeOpacity(r)},strokeWeight(r){this.overlay.setStrokeWeight(r)},fillColor(r){this.overlay.setFillColor(r)},fillOpacity(r){this.overlay.setFillOpacity(r)},visible(r){this.overlay.setVisible(r)}},onCreate(){this.overlay=this.$map.createCircle(this),this.$map.addOverlay(this.overlay),$(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:center"]&&this.overlay.addEventListener("center-changed",()=>{this.$emit("update:center",this.emittedCenter=this.overlay.getCenter())}),this.attrs.listenerProps["update:radius"]&&this.overlay.addEventListener("radius-changed",()=>{this.$emit("update:radius",this.emittedRadius=this.overlay.getRadius())})},onDestroy(){this.$map.removeOverlay(this.overlay)}});class En extends Ni{constructor(t,e,i,n){super(t,e),this.content=i,this.position=n}onCreate(){return this.content}onDraw(t){const e=t.fromLatLngToOverlayPoint(this.position);this.content.style.left=e.x+"px",this.content.style.top=e.y+"px"}setPosition(t){this.position=t,this.draw()}}const Pn=y.defineComponent({name:"tg-element-overlay",mixins:[z],props:{mapPane:V(ue,ue.overlayMouseTarget),position:N(w)},setup(){return{overlay:void 0}},watch:{position(r){this.overlay.setPosition(r)},mapPane(){this.recreate()}},methods:{content(){return this.$el}},onCreate(){this.overlay=new En(this.$map,this,this.content(),this.position),this.$map.addElementOverlay(this.overlay)},onDestroy(){this.$map.removeElementOverlay(this.overlay)}});function Ln(r,t,e,i,n,s){return y.openBlock(),y.createElementBlock("div",y.mergeProps({class:r.$options.name},r.$attrs),[y.renderSlot(r.$slots,"default")],16)}const nr=Q(Pn,[["render",Ln]]),Bn=y.defineComponent({name:"tg-marker",mixins:[z],inheritAttrs:!1,props:{position:N(w),title:T(String),icon:T(Object),clickable:T(Boolean),draggable:T(Boolean),crossOnDrag:T(Boolean),cursor:T(String),zIndex:T(Number),visible:T(Boolean),normalizePositionForBaidu:T(Boolean),autoAddToClusterer:T(Boolean,!0),"onUpdate:position":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),marker:void 0,label:Ne(),info:Ne(),emittedPosition:void 0,autoAddToClustererWhenCreate:r.autoAddToClusterer}},watch:{position(r){if(this.emittedPosition!=null){const t=this.emittedPosition;if(this.emittedPosition=void 0,t===y.toRaw(r))return}this.marker.setPosition(r)},title(r){this.marker.setTitle(r)},icon(r){r?this.marker.setIcon(r):this.recreate()},clickable(r){this.marker instanceof ge?this.recreate():this.marker.setClickable(r)},draggable(r){this.marker.setDraggable(r)},crossOnDrag(){this.recreate()},cursor(){this.recreate()},zIndex(r){this.marker instanceof ge?this.recreate():this.marker.setZIndex(r)},visible(r){this.marker.setVisible(r)},normalizePositionForBaidu(){this.recreate()},autoAddToClusterer(){this.recreate()}},onCreate(){this.marker=this.$map.createMarker(this),this.label&&this.marker.setLabel(this.label.overlay),this.$clusterer()&&this.autoAddToClusterer?this.$clusterer().onAddMarker(this.marker):this.$map.addOverlay(this.marker),this.autoAddToClustererWhenCreate=this.autoAddToClusterer,this.info&&this.info.show&&this.info.overlay.open(this.marker),$(this.attrs.listeners,this.marker),this.attrs.listenerProps["update:position"]&&this.marker.addEventListener("dragend",r=>{this.$emit("update:position",this.emittedPosition=r.position)})},onDestroy(){this.$clusterer()&&this.autoAddToClustererWhenCreate?this.$clusterer().onRemoveMarker(this.marker):this.$map.removeOverlay(this.marker)},methods:{$clusterer(){return St(this.$parent,Xt)},onAddLabel(r){this.label=r,this.marker&&this.marker.setLabel(r.overlay)},onRemoveLabel(r){this.marker.setLabel(void 0),this.label=void 0},onAddInfo(r){this.info=r,this.marker&&r.show&&r.overlay.open(this.marker)},onRemoveInfo(r){r.overlay.close(),this.info=void 0},onInfoShowChanged(r,t){t?r.overlay.open(this.marker):r.overlay.close()}}});function In(r,t,e,i,n,s){return y.renderSlot(r.$slots,"default")}const Ie=Q(Bn,[["render",In]]),Sn=y.defineComponent({name:"tg-info-box",mixins:[z],inheritAttrs:!1,props:{show:N(Boolean),position:T(w),offset:T(Object),maxWidth:T(Number),borderClass:T(String),zIndex:T(Number),"onUpdate:show":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),overlay:void 0}},watch:{show(r){this.$marker()?this.$marker().onInfoShowChanged(this,r):r?this.overlay.open():this.overlay.close()},position(r){this.overlay.setPosition(r)},offset(){this.recreate()},maxWidth(r){this.overlay.setMaxWidth(r)},borderClass(){this.recreate()},zIndex(r){this.overlay.setZIndex(r)}},onCreate(){this.overlay=this.$map.createInfoBox(this.getOptions()),this.$marker()?this.$marker().onAddInfo(this):this.show&&this.overlay.open(),this.attrs.listenerProps["update:show"]&&this.overlay.addEventListener("closeclick",()=>{this.$emit("update:show",!1)}),$(this.attrs.listeners,this.overlay)},onDestroy(){this.$marker()?this.$marker().onRemoveInfo(this):this.overlay.close()},methods:{getOptions(){return{content:this.content(),position:this.position,offset:this.offset,zIndex:this.zIndex,maxWidth:this.maxWidth,borderClass:this.borderClass}},content(){return this.$el},$marker(){return We(Ie,this.$parent,ye)},open(r){this.overlay.open(r)},close(){this.overlay.close()}}});function kn(r,t,e,i,n,s){return y.openBlock(),y.createElementBlock("div",y.mergeProps({class:r.$options.name},r.attrs.binds),[y.renderSlot(r.$slots,"default")],16)}const sr=Q(Sn,[["render",kn]]),xn=y.defineComponent({name:"tg-info-window",mixins:[z],inheritAttrs:!1,props:{show:N(Boolean),position:T(w),maxWidth:T(Number),offset:T(Object),disableAutoPan:T(Boolean),"onUpdate:show":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),overlay:void 0}},watch:{show(r){this.$marker()?this.$marker().onInfoShowChanged(this,r):r?this.overlay.open():this.overlay.close()},position(r){this.overlay.setPosition(r)},maxWidth(){this.recreate()},offset(){this.recreate()},disableAutoPan(){this.recreate()}},methods:{content(){return this.$el},$marker(){return We(Ie,this.$parent,ye)},getOptions(){return{content:this.content(),position:this.position,maxWidth:this.maxWidth,offset:this.offset,disableAutoPan:this.disableAutoPan}}},onCreate(){this.overlay=this.$map.createInfoWindow(this.getOptions()),this.$marker()?this.$marker().onAddInfo(this):this.show&&this.overlay.open(),this.overlay.addEventListener("open",()=>{this.$emit("update:show",!0)}),this.overlay.addEventListener("close",()=>{this.$emit("update:show",!1)}),$(this.attrs.listeners,this.overlay)},onDestroy(){this.$marker()?this.$marker().onRemoveInfo(this):this.overlay.close()}});function An(r,t,e,i,n,s){return y.withDirectives((y.openBlock(),y.createElementBlock("div",y.mergeProps({class:r.$options.name},r.attrs.binds),[y.renderSlot(r.$slots,"default")],16)),[[y.vShow,r.show]])}const or=Q(xn,[["render",An]]),Rn=y.defineComponent({name:"tg-label",mixins:[z],inheritAttrs:!1,props:{position:T(w),offset:T(Object),zIndex:T(Number),mapPane:V(ue)},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t),overlay:void 0}},watch:{position(r){this.overlay.setPosition(r)},offset(r){this.overlay.setOffset(r)},zIndex(r){this.overlay.setZIndex(r)},visible(r){this.overlay.setVisible(r)},mapPane(){this.recreate()}},methods:{content(){return this.$el},marker(){var r;return(r=this.$marker())==null?void 0:r.marker},$marker(){return We(Ie,this.$parent,ye)},getOptions(){return{content:this.content(),position:this.position,offset:this.offset,zIndex:this.zIndex,mapPane:this.mapPane}}},onCreate(){this.overlay=this.$map.createLabel(this.getOptions()),this.$marker()?this.$marker().onAddLabel(this):this.$map.addOverlay(this.overlay),$(this.attrs.listeners,this.overlay)},onDestroy(){this.$marker()?this.$marker().onRemoveLabel(this):this.$map.removeOverlay(this.overlay)}});function Dn(r,t,e,i,n,s){return y.openBlock(),y.createElementBlock("div",y.mergeProps({class:r.$options.name},r.attrs.binds),[y.renderSlot(r.$slots,"default")],16)}const ar=Q(Rn,[["render",Dn]]),lr=y.defineComponent({name:"tg-polygon",mixins:[z],inheritAttrs:!1,props:{paths:N(Array),clickable:T(Boolean),editable:T(Boolean),strokeColor:T(String),strokeOpacity:T(Number),strokeWeight:T(Number),visible:T(Boolean),fillColor:T(String),fillOpacity:T(Number),"onUpdate:paths":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),overlay:void 0,emittedPaths:void 0}},watch:{paths:{handler(r){if(this.emittedPaths!=null){const t=this.emittedPaths;if(this.emittedPaths=void 0,t.length===r.length&&t.every((e,i)=>e===y.toRaw(r[i])))return}this.overlay.setPaths(r)},deep:!0},clickable(){this.recreate()},editable(r){this.overlay.setEditable(r)},strokeColor(r){this.overlay.setStrokeColor(r)},strokeOpacity(r){this.overlay.setStrokeOpacity(r)},strokeWeight(r){this.overlay.setStrokeWeight(r)},fillColor(r){this.overlay.setFillColor(r)},fillOpacity(r){this.overlay.setFillOpacity(r)},visible(r){this.overlay.setVisible(r)}},onCreate(){this.overlay=this.$map.createPolygon(this),this.$map.addOverlay(this.overlay),$(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:paths"]&&this.overlay.addEventListener("paths-edited",()=>{this.$emit("update:paths",this.emittedPaths=this.overlay.getPaths())})},onDestroy(){this.$map.removeOverlay(this.overlay)}}),hr=y.defineComponent({name:"tg-polyline",mixins:[z],inheritAttrs:!1,props:{path:N(Array),icons:T(Array),clickable:T(Boolean),editable:T(Boolean),strokeColor:T(String),strokeOpacity:T(Number),strokeWeight:T(Number),visible:T(Boolean),"onUpdate:path":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),overlay:void 0,emittedPath:void 0}},watch:{path:{handler(r){if(this.emittedPath!=null){const t=this.emittedPath;if(this.emittedPath=void 0,t===y.toRaw(r))return}this.overlay.setPath(r)},deep:!0},icons:{handler(){this.recreate()},deep:!0},clickable(){this.recreate()},editable(r){this.overlay.setEditable(r)},strokeColor(r){this.overlay.setStrokeColor(r)},strokeOpacity(r){this.overlay.setStrokeOpacity(r)},strokeWeight(r){this.overlay.setStrokeWeight(r)},visible(r){this.overlay.setVisible(r)}},onCreate(){this.overlay=this.$map.createPolyline(this),this.$map.addOverlay(this.overlay),$(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:path"]&&this.overlay.addEventListener("path-edited",()=>{this.$emit("update:path",this.emittedPath=this.overlay.getPath())})},onDestroy(){this.overlay.remove()}}),cr=y.defineComponent({name:"tg-rectangle",mixins:[z],inheritAttrs:!1,props:{bounds:N(Object),clickable:T(Boolean),editable:T(Boolean),strokeColor:T(String),strokeOpacity:T(Number),strokeWeight:T(Number),visible:T(Boolean),fillColor:T(String),fillOpacity:T(Number),"onUpdate:bounds":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),overlay:void 0,emittedBounds:void 0}},watch:{bounds(r){if(this.emittedBounds!=null){const t=this.emittedBounds;if(this.emittedBounds=void 0,t.equals(r))return}this.overlay.setBounds(r)},clickable(){this.recreate()},editable(r){this.overlay.setEditable(r)},strokeColor(r){this.overlay.setStrokeColor(r)},strokeOpacity(r){this.overlay.setStrokeOpacity(r)},strokeWeight(r){this.overlay.setStrokeWeight(r)},fillColor(r){this.overlay.setFillColor(r)},fillOpacity(r){this.overlay.setFillOpacity(r)},visible(r){this.overlay.setVisible(r)}},onCreate(){this.overlay=this.$map.createRectangle(this),this.$map.addOverlay(this.overlay),$(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:bounds"]&&this.overlay.addEventListener("bounds-changed",()=>{this.$emit("update:bounds",this.emittedBounds=this.overlay.getBounds())})},onDestroy(){this.$map.removeOverlay(this.overlay)}}),$n=["beforeUpdate","updated"],zn={install(r,t={}){if(t.enable!==!1){const e=y.defineComponent({beforeCreate(){const i=Ji()??"",s=(t.nameRegex||/^[A-Z]/).test(i)?l=>{t.hookNames?t.hookNames.includes(l)&&console.debug("[lifecycle]",i,l):$n.includes(l)||console.debug("[lifecycle]",i,l)}:le;s("beforeCreate"),this.__life_impl=s},created(){this.__life("created")},beforeMount(){this.__life("beforeMount")},mounted(){this.__life("mounted")},beforeUpdate(){this.__life("beforeUpdate")},updated(){this.__life("updated")},beforeUnmount(){this.__life("beforeUnmount")},unmounted(){this.__life("unmounted")},methods:{__life(i){this.__life_impl(i)}},onCreate(){this.__life("onCreate")},onDestroy(){this.__life("onDestroy")}});r.mixin(e)}}},Gn=6378137;function Se(r){return r*Math.PI/180}function dr(r){return r*180/Math.PI}function Nn(r,t){if(r.lat===t.lat&&r.lng===t.lng)return 0;const e=Se((r.lat+t.lat)/2),i=Se((r.lat-t.lat)/2),n=Se((r.lng-t.lng)/2);let s=Math.sin(i),l=Math.sin(n),d=Math.sin(e);const o=Gn,c=1/298.257;s=s*s,l=l*l,d=d*d;const u=s*(1-l)+(1-d)*l,g=(1-s)*(1-l)+d*l,m=Math.atan(Math.sqrt(u/g)),v=Math.sqrt(u*g)/m,C=2*m*o,M=(3*v-1)/2/g,O=(3*v+1)/2/u;return C*(1+c*(M*d*(1-s)-O*(1-d)*s))}function ur(r,t,e){const n=63567523142e-4,s=1/298.257223563,l=Se(t),d=Math.sin(l),o=Math.cos(l),c=(1-s)*Math.tan(Se(r.lat)),u=1/Math.sqrt(1+c*c),g=c*u,m=Math.atan2(c,o),v=u*d,C=1-v*v,M=C*(6378137*6378137-n*n)/(n*n),O=1+M/16384*(4096+M*(-768+M*(320-175*M))),h=M/1024*(256+M*(-128+M*(74-47*M)));let p=0,_=0,b=0,E=e/(n*O),P=2*Math.PI;for(;Math.abs(E-P)>1e-12;){p=Math.cos(2*m+E),_=Math.sin(E),b=Math.cos(E);const q=h*_*(p+h/4*(b*(-1+2*p*p)-h/6*p*(-3+4*_*_)*(-3+4*p*p)));P=E,E=e/(n*O)+q}const B=g*_-u*b*o,D=Math.atan2(g*b+u*_*o,(1-s)*Math.sqrt(v*v+B*B)),Z=Math.atan2(_*d,u*b-g*_*o),S=s/16*C*(4+s*(4-3*C)),ee=Z-(1-S)*s*v*(E+S*_*(p+S*b*(-1+2*p*p)));return{lng:r.lng+dr(ee),lat:dr(D)}}const Zn={getDistance:Nn,getDestination:ur};var Wn={VITE_APP_DEV_KEY_BAIDU:"kXOq8Hg9BZbZEWAjXKuzd1oGreynup8h",VITE_APP_DEV_KEY_GOOGLE:"AIzaSyBcyzMel3dYFNcfcr0LOklbBQNpWycyZXo",VITE_APP_DEV_KEY_HERE:"",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Hn={install(r,t){if(Wi(t),Wn.VITE_FALSE){const i=Object.assign({"./TgMap.vue":ye,"./TgMapWidget.vue":Yi,"./controls/TgCustomControl.vue":qi,"./controls/TgMapTypeControl.vue":Ki,"./controls/TgScaleControl.vue":Xi,"./controls/TgStreetViewControl.vue":Qi,"./controls/TgZoomControl.vue":er,"./extra/TgHeatmap.vue":tr,"./extra/TgMarkerClusterer.vue":Xt,"./layers/TgTrafficLayer.vue":ir,"./overlays/TgCircle.vue":rr,"./overlays/TgElementOverlay.vue":nr,"./overlays/TgInfoBox.vue":sr,"./overlays/TgInfoWindow.vue":or,"./overlays/TgLabel.vue":ar,"./overlays/TgMarker.vue":Ie,"./overlays/TgPolygon.vue":lr,"./overlays/TgPolyline.vue":hr,"./overlays/TgRectangle.vue":cr});Object.keys(i).forEach(n=>{const s=i[n];r.component(s.name??I(`Tg开头的组件必须设置name: ${n}`),s)})}const e=r.config.optionMergeStrategies;e[me]=e[fe]=(i,n)=>i?[...new Set([].concat(i,n))]:Array.isArray(n)?n:[n]}};a.AbstractControl=je,a.AbstractMap=at,a.Autocomplete=$t,a.BaiduAutocomplete=pi,a.BaiduCircle=ct,a.BaiduControl=Fe,a.BaiduHeatmap=yi,a.BaiduInfoBoxOverlay=mt,a.BaiduInfoWindow=pt,a.BaiduMapTypeControl=Ue,a.BaiduMapUrls=nt,a.BaiduMarker=ge,a.BaiduMarkerClusterer=Ci,a.BaiduOverlay=Ce,a.BaiduPlacesService=Ei,a.BaiduPolyShape=vt,a.BaiduPolygon=Mt,a.BaiduPolyline=_t,a.BaiduRectangle=Ct,a.BaiduScaleControl=qe,a.BaiduSearchBox=Li,a.BaiduStreetViewControl=Xe,a.BaiduZoomControl=Qe,a.BuildInMapType=W,a.BuildInMapTypeId=Rt,a.CachedValue=ce,a.ControlPosition=k,a.CoordType=R,a.CustomControl=oi,a.ElementOverlay=Ni,a.EmptyControl=ai,a.FastFindValues=si,a.GestureHandlingOptions=X,a.GoogleAutocomplete=ui,a.GoogleCircle=dt,a.GoogleControl=be,a.GoogleHeatmap=fi,a.GoogleInfoBoxOverlay=ft,a.GoogleInfoWindow=gt,a.GoogleMapTypeControl=Ye,a.GoogleMapUrls=rt,a.GoogleMarker=yt,a.GoogleMarkerClusterer=Oi,a.GoogleOverlay=lt,a.GooglePlacesService=wi,a.GooglePolygon=Tt,a.GooglePolyline=bt,a.GoogleRectangle=Ot,a.GoogleScaleControl=Ke,a.GoogleSearchBox=Pi,a.GoogleStreetViewControl=Je,a.GoogleZoomControl=et,a.Heatmap=zt,a.ImageMapType=Er,a.InfoWindow=ut,a.InfoWindowModeValues=Di,a.KeyValue=At,a.LatLng=w,a.LatLngBounds=j,a.LifecycleLogPlugin=zn,a.MIXIN_HOOK_CREATE=me,a.MIXIN_HOOK_DESTROY=fe,a.MIXIN_MAP_NAME=Et,a.MapMixin=z,a.MapPane=ue,a.MapTypeControlType=Dt,a.MapUrls=Gt,a.MapZoom=Bi,a.MarkerClusterer=Wt,a.Overlay=jt,a.PlacesService=Ht,a.SearchBox=Vt,a.SphericalUtils=Zn,a.SymbolPath=tn,a.TgCircle=rr,a.TgCustomControl=qi,a.TgElementOverlay=nr,a.TgHeatmap=tr,a.TgInfoBox=sr,a.TgInfoWindow=or,a.TgLabel=ar,a.TgMap=ye,a.TgMapType=Y,a.TgMapTypeControl=Ki,a.TgMapWidget=Yi,a.TgMarker=Ie,a.TgMarkerClusterer=Xt,a.TgPolygon=lr,a.TgPolyline=hr,a.TgRectangle=cr,a.TgScaleControl=Xi,a.TgStreetViewControl=Qi,a.TgTrafficLayer=ir,a.TgZoomControl=er,a.TrafficLayer=li,a.UnionIcon=Oe,a.assert=ne,a.assertNever=Ge,a.callHook=Be,a.computedSaveOnThis=un,a.createAsyncSingleton=ei,a.createEmptyVNode=Le,a.createPropertyObject=Fi,a.createPropertyObjectTyped=pn,a.debug=Tr,a.default=Hn,a.eventProp=x,a.extractVNodeFromSlotsByComponent=mn,a.findAncestorComponentByType=We,a.findByComponentType=gn,a.getDestination=ur,a.getTgMapConfig=Kt,a.isComponentByType=Ze,a.isDef=Cr,a.isEntryValueDef=Qt,a.isInstanceOf=vr,a.lateinit=yr,a.loadCachedMap=Hi,a.noop=le,a.optionalProp=T,a.path=Gi,a.requiredProp=N,a.safeAs=_r,a.safeAsComponent=St,a.setTgMapConfig=Wi,a.splitAttrs=Ui,a.stringEnumProp=V,a.stringUnionPropFromValues=ji,a.throwError=I,a.throwUnsupported=He,a.todo=Mr,a.typed=Ne,a.unwrapStringEnumValue=br,a.useEventLogMethods=fn,a.useSplittedAttrs=J,a.useTgMapInner=Pt,Object.defineProperties(a,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
17
|
+
`))}},1)}const n=this.innerOverlay.getOffset();let s=n.width,l=n.height;this.iconAnchor&&(s-=this.iconAnchor.width,l-=this.iconAnchor.height),i&&(s+=i.width,l+=i.height),this.innerOverlay.setOffset(new BMap.Size(s,l)),this.icon=e,this.iconAnchor=i}}class Xt extends ot{static create(t){var n;const e=this.coordType,i=sn(ue.toElement(t.content),(n=t.position)==null?void 0:n.toGoogle(e),t.offset,t.mapPane,t.zIndex);return new Xt(i,e,this)}setZIndex(t){this.innerOverlay.setZIndex(t)}setContent(t){this.innerOverlay.setElement(ue.toElement(t))}getPosition(){const t=this.innerOverlay.getPosition();return t?w.fromGoogle(t,this.coordType):w.ZERO}setPosition(t){this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toGoogle(this.coordType))}getOffset(){return this.innerOverlay.getOffset()??a.Point.ZERO}setOffset(t){this.innerOverlay.setOffset(t)}}const Oe={toGoogle:r=>"url"in r?a.Icon.toGoogle(r):a.SymbolIcon.toGoogle(r),toBaidu:r=>"url"in r?a.Icon.toBaidu(r):a.SymbolIcon.toBaidu(r)};a.Icon=void 0,(r=>{function t(i){return{url:i.url,size:new google.maps.Size(i.size.width,i.size.height),origin:i.origin&&new google.maps.Point(i.origin.x,i.origin.y),scaledSize:i.scaledSize&&new google.maps.Size(i.scaledSize.width,i.scaledSize.height),anchor:i.anchor&&new google.maps.Point(i.anchor.x,i.anchor.y)}}r.toGoogle=t;function e(i){return new BMap.Icon(i.url,new BMap.Size(i.size.width,i.size.height),{imageOffset:i.origin&&new BMap.Size(-i.origin.x,-i.origin.y),imageSize:i.scaledSize&&new BMap.Size(i.scaledSize.width,i.scaledSize.height),anchor:i.anchor?new BMap.Size(i.anchor.x,i.anchor.y):new BMap.Size(i.size.width/2,i.size.height)})}r.toBaidu=e})(a.Icon||(a.Icon={})),a.SymbolIcon=void 0,(r=>{function t(i){return{path:typeof i.path=="string"?i.path:i.path.google(),anchor:i.anchor&&new google.maps.Point(i.anchor.x,i.anchor.y),fillColor:i.fillColor,fillOpacity:i.fillOpacity,scale:i.scale,rotation:i.rotation,strokeColor:i.strokeColor,strokeOpacity:i.strokeOpacity,strokeWeight:i.strokeWeight}}r.toGoogle=t;function e(i){const n=new BMap.Symbol(typeof i.path=="string"?i.path:i.path.baidu(),{anchor:i.anchor&&new BMap.Size(i.anchor.x,i.anchor.y),fillColor:i.fillColor,fillOpacity:i.fillOpacity,scale:i.scale,rotation:i.rotation,strokeColor:i.strokeColor,strokeOpacity:i.strokeOpacity,strokeWeight:i.strokeWeight});return n.__icon__=i,n}r.toBaidu=e})(a.SymbolIcon||(a.SymbolIcon={}));const an={CIRCLE:{baidu:()=>BMap_Symbol_SHAPE_CIRCLE,google:()=>google.maps.SymbolPath.CIRCLE},BACKWARD_CLOSED_ARROW:{baidu:()=>BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW,google:()=>google.maps.SymbolPath.BACKWARD_CLOSED_ARROW},BACKWARD_OPEN_ARROW:{baidu:()=>BMap_Symbol_SHAPE_BACKWARD_OPEN_ARROW,google:()=>google.maps.SymbolPath.BACKWARD_OPEN_ARROW},FORWARD_CLOSED_ARROW:{baidu:()=>BMap_Symbol_SHAPE_FORWARD_CLOSED_ARROW,google:()=>google.maps.SymbolPath.FORWARD_CLOSED_ARROW},FORWARD_OPEN_ARROW:{baidu:()=>BMap_Symbol_SHAPE_FORWARD_OPEN_ARROW,google:()=>google.maps.SymbolPath.FORWARD_OPEN_ARROW}};a.IconSequence=void 0,(r=>{function t(i){return{icon:a.SymbolIcon.toGoogle(i.icon),offset:i.offset,repeat:i.repeat,fixedRotation:i.fixedRotation}}r.toGoogle=t;function e(i){return new BMap.IconSequence(a.SymbolIcon.toBaidu(i.icon),i.offset,i.repeat??"",i.fixedRotation)}r.toBaidu=e})(a.IconSequence||(a.IconSequence={}));class pe extends Ce{constructor(t,e,i,n){super(t,e,i),this.state=n}static create(t){const e=this.coordType,i=t.icon,n={title:t.title,icon:i&&Oe.toBaidu(i),enableClicking:t.clickable,enableDragging:t.draggable,raiseOnDrag:t.crossOnDrag===void 0?!0:t.crossOnDrag,draggingCursor:t.cursor},s=new BMap.Marker(t.position.toBaidu(e,t.normalizePositionForBaidu),n);s.__create_by_tg__=!0,t.zIndex!==void 0&&s.setZIndex(t.zIndex);const l=t.clickable===void 0?!0:t.clickable,g=!!t.draggable;return new pe(s,e,this,{clickable:l,draggable:g,zIndex:t.zIndex,normalize:t.normalizePositionForBaidu}).visibleOptionInternal(t.visible)}getPosition(){return w.fromBaidu(this.innerOverlay.getPosition(),this.coordType)}setPosition(t){var e;this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toBaidu(this.coordType,this.state.normalize)),(e=this.innerOverlay.__info_box__)==null||e.onMarkerPositionChanged()}setTitle(t){this.innerOverlay.setTitle(t)}getTitle(){return this.innerOverlay.getTitle()}setIcon(t){const e=Oe.toBaidu(t);this.innerOverlay.setIcon(e);const i=this.getLabel();i&&i.attachIcon(e)}getIcon(){return this.innerOverlay.getIcon()}setClickable(t){this.state.clickable=t}isClickable(){return this.state.clickable}setDraggable(t){this.state.draggable=t,t?this.innerOverlay.enableDragging():this.innerOverlay.disableDragging()}isDraggable(){return this.state.draggable}setZIndex(t){this.state.zIndex=t,this.innerOverlay.setZIndex(t||0)}getZIndex(){return this.state.zIndex}setLabel(t){const e=this.getLabel();e&&e.attachIcon(void 0),t&&t.attachIcon(this.innerOverlay.getIcon()),this.innerOverlay.setLabel(t==null?void 0:t.innerOverlay)}getLabel(){var t;return(t=this.innerOverlay.getLabel())==null?void 0:t.__label__}}class mt extends ot{constructor(){super(...arguments);f(this,"label");f(this,"labelPositionListener");f(this,"labelVisibleListener");f(this,"labelMapChangedListener")}static create(e){const i=this.coordType,n=e.icon,s={position:e.position.toGoogle(i),title:e.title,zIndex:e.zIndex,visible:e.visible,icon:n&&Oe.toGoogle(n),clickable:e.clickable,draggable:e.draggable,crossOnDrag:e.crossOnDrag,cursor:e.cursor,anchorPoint:new google.maps.Point(0,0)};return new mt(new google.maps.Marker(s),i,this)}getPosition(){return w.fromGoogle(this.innerOverlay.getPosition(),this.coordType)}setPosition(e){this.coordType=this.map.coordType,this.innerOverlay.setPosition(e.toGoogle(this.coordType))}setTitle(e){this.innerOverlay.setTitle(e)}getTitle(){return this.innerOverlay.getTitle()||""}setIcon(e){this.innerOverlay.setIcon(Oe.toGoogle(e))}getIcon(){return this.innerOverlay.getIcon()}setClickable(e){this.innerOverlay.setClickable(e)}isClickable(){return this.innerOverlay.getClickable()}setDraggable(e){this.innerOverlay.setDraggable(e)}isDraggable(){return!!this.innerOverlay.getDraggable()}setZIndex(e){this.innerOverlay.setZIndex(e===void 0?null:e)}getZIndex(){const e=this.innerOverlay.getZIndex();return e===null?void 0:e}setLabel(e){if(this.label&&this.map.removeOverlay(this.label),this.labelPositionListener&&this.labelPositionListener.remove(),this.labelVisibleListener&&this.labelVisibleListener.remove(),this.labelMapChangedListener&&this.labelMapChangedListener.remove(),e){const i=()=>{e.innerOverlay.setPosition(this.innerOverlay.getPosition())},n=()=>{e.innerOverlay.setVisible(this.innerOverlay.getVisible())},s=()=>{this.innerOverlay.getMap()?this.map.addOverlay(e):this.map.removeOverlay(e)};s(),i(),n(),this.label=e,this.labelMapChangedListener=this.innerOverlay.addListener("map_changed",s),this.labelPositionListener=this.innerOverlay.addListener("position_changed",i),this.labelVisibleListener=this.innerOverlay.addListener("visible_changed",n)}else this.label=void 0,this.labelPositionListener=void 0,this.labelVisibleListener=void 0,this.labelMapChangedListener=void 0}}class ft extends F{constructor(){super(...arguments);f(this,"eventHubDelegate");f(this,"prevPath");f(this,"isDoingSetPath",!1);f(this,"onLineUpdate",()=>{var i;const e=this.innerOverlay.getPath();e!==this.prevPath&&(this.isDoingSetPath||(i=this.eventHubDelegate)==null||i.notify({type:this.pathEditedEventType,target:this,originalEvent:{prevPath:this.prevPath,path:e}}),this.prevPath=e)})}setPathInternal(e){this.isDoingSetPath=!0,this.innerOverlay.setPath(e),this.isDoingSetPath=!1}createDelegate(){return this.eventHubDelegate=new We(super.createDelegate(),{types:[this.pathEditedEventType],onListen:()=>{this.prevPath=this.innerOverlay.getPath(),this.innerOverlay.addEventListener("lineupdate",this.onLineUpdate)},onCancel:()=>{this.innerOverlay.removeEventListener("lineupdate",this.onLineUpdate),this.prevPath=void 0}})}}class yt extends ft{constructor(){super(...arguments);f(this,"pathEditedEventType","path-edited")}static create(e){var s,l;const i=this.coordType,n=new BMap.Polyline(e.path.map(g=>g.toBaidu(i)),{enableClicking:e.clickable,enableEditing:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+F.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,icons:(s=e.icons)==null?void 0:s.map(a.IconSequence.toBaidu)});return new yt(n,i,this,{editable:!!e.editable,symbolIcons:(l=e.icons)==null?void 0:l.map(g=>g.icon)}).visibleOptionInternal(e.visible)}getPath(){return this.innerOverlay.getPath().map(e=>w.fromBaidu(e,this.coordType))}setPath(e){this.coordType=this.map.coordType,this.setPathInternal(e.map(i=>i.toBaidu(this.coordType)))}remove(){var e;super.remove(),(e=this.state.symbolIcons)!=null&&e.length&&this.map.innerMap.getOverlays().filter(n=>{var o;if(!(n instanceof BMap.Marker))return!1;const s=n;if(s.__create_by_tg__)return!1;const l=s.getIcon();if(!(l instanceof BMap.Symbol))return!1;const g=l;return g.__icon__?(o=this.state.symbolIcons)==null?void 0:o.includes(g.__icon__):!1}).forEach(n=>this.map.innerMap.removeOverlay(n))}}class vt extends at{constructor(){super(...arguments);f(this,"pathChangedListeners");f(this,"eventHubDelegate")}static create(e){var s;const i=this.coordType,n=new google.maps.Polyline({path:e.path.map(l=>l.toGoogle(i)),clickable:e.clickable,editable:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity,strokeWeight:e.strokeWeight,visible:e.visible,icons:(s=e.icons)==null?void 0:s.map(a.IconSequence.toGoogle)});return new vt(n,i,this)}setupPathChangedListeners(){const e=()=>{var n;return(n=this.eventHubDelegate)==null?void 0:n.notify({type:"path-edited",target:this})},i=this.innerOverlay.getPath();this.pathChangedListeners=a.MVCArrays.listenChanged(i,e)}clearPathChangedListeners(){var e;(e=this.pathChangedListeners)==null||e.forEach(i=>i.remove()),this.pathChangedListeners=void 0}createDelegate(){return this.eventHubDelegate=new We(super.createDelegate(),{types:["path-edited"],onListen:()=>this.setupPathChangedListeners(),onCancel:()=>this.clearPathChangedListeners()})}getPath(){const e=[];return this.innerOverlay.getPath().forEach(i=>{e.push(w.fromGoogle(i,this.coordType))}),e}setPath(e){var i;this.coordType=this.map.coordType,this.innerOverlay.setPath(e.map(n=>n.toGoogle(this.coordType))),(i=this.eventHubDelegate)!=null&&i.hasListener("path-edited")&&this.setupPathChangedListeners()}}class _t extends ft{constructor(){super(...arguments);f(this,"pathEditedEventType","paths-edited")}static create(e){const i=this.coordType;e.paths.length>1&&console.warn("baidu不支持多path, 只会显示paths[0]");const n=e.paths[0]||[],s=new BMap.Polygon(n.map(l=>l.toBaidu(i)),{enableClicking:e.clickable,enableEditing:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+F.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity!=null?e.fillOpacity+F.OPACITY_DELTA:void 0});return new _t(s,i,this,{editable:!!e.editable}).visibleOptionInternal(e.visible)}getPaths(){return[this.innerOverlay.getPath().map(e=>w.fromBaidu(e,this.coordType))]}setPaths(e){e.length>1&&console.warn("baidu不支持多path, 只会显示paths[0]"),this.coordType=this.map.coordType,this.setPathInternal((e[0]||[]).map(i=>i.toBaidu(this.coordType)))}}class bt extends at{constructor(){super(...arguments);f(this,"pathChangedListeners");f(this,"eventHubDelegate")}static create(e){const i=this.coordType,n=new google.maps.Polygon({paths:e.paths.map(s=>s.map(l=>l.toGoogle(i))),clickable:e.clickable,editable:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity,visible:e.visible});return new bt(n,i,this)}setupPathChangedListeners(){const e=()=>{var n;return(n=this.eventHubDelegate)==null?void 0:n.notify({type:"paths-edited",target:this})},i=this.innerOverlay.getPaths();this.pathChangedListeners=[],i.forEach(n=>{this.pathChangedListeners.push(...a.MVCArrays.listenChanged(n,e))})}clearPathChangedListeners(){var e;(e=this.pathChangedListeners)==null||e.forEach(i=>i.remove()),this.pathChangedListeners=void 0}createDelegate(){return this.eventHubDelegate=new We(super.createDelegate(),{types:["paths-edited"],onListen:()=>this.setupPathChangedListeners(),onCancel:()=>this.clearPathChangedListeners()})}getPaths(){const e=this.innerOverlay.getPaths(),i=[];return e.forEach(n=>{const s=[];i.push(s),n.forEach(l=>{s.push(w.fromGoogle(l,this.coordType))})}),i}setPaths(e){var i;this.coordType=this.map.coordType,this.innerOverlay.setPaths(e.map(n=>n.map(s=>s.toGoogle(this.coordType)))),(i=this.eventHubDelegate)!=null&&i.hasListener("paths-edited")&&this.setupPathChangedListeners()}}class Mt extends ft{constructor(e,i,n,s){super(e,i,n,s);f(this,"pathEditedEventType","bounds-changed");f(this,"isDoingUpdateRectangle",!1);f(this,"onBoundsChanged",({originalEvent:e})=>{if(this.isDoingUpdateRectangle)return;const i=e.prevPath??[],n=e.path;setTimeout(()=>{let s=n;const l=n.length;if(i.length===4)if(l>i.length){for(let o=0;o<l;o++)if(i[o]==null||!li.equals(n[o],i[o])){const c=n[(o-2+l)%l],u=n[(o-1+l)%l],d=n[o],p=n[(o+1)%l],_=n[(o+2)%l];let y;u.lat===p.lat?y=new BMap.Point(u.lng,d.lat):u.lng===p.lng?y=new BMap.Point(d.lng,u.lat):y=d,s=[c,_,y];break}}else if(l===i.length){for(let o=0;o<l;o++)if(!li.equals(n[o],i[o])){s=[n[o],n[(o+2)%4]];break}}else l<i.length;const g=V.fromArray(s.map(o=>w.fromBaidu(o,this.coordType)));g&&(this.isDoingUpdateRectangle=!0,this.innerOverlay.setPath(g.toRectArray().map(o=>o.toBaidu(this.coordType))),this.isDoingUpdateRectangle=!1)},0)});this.addEventListener("bounds-changed",this.onBoundsChanged)}static create(e){const i=this.coordType,n=new BMap.Polygon(e.bounds.toRectArray().map(s=>s.toBaidu(i)),{enableClicking:e.clickable,enableEditing:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+F.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity!=null?e.fillOpacity+F.OPACITY_DELTA:void 0});return new Mt(n,i,this,{editable:!!e.editable}).visibleOptionInternal(e.visible)}getBounds(){return V.fromBaidu(this.innerOverlay.getBounds(),this.coordType)}setBounds(e){const i=e.toRectArray();this.innerOverlay.getPath().length===i.length?e.toRectArray().forEach((n,s)=>{this.innerOverlay.setPositionAt(s,n.toBaidu(this.coordType))}):this.setPathInternal(i.map(n=>n.toBaidu(this.coordType)))}}class Tt extends at{static create(t){const e=this.coordType,i=new google.maps.Rectangle({bounds:t.bounds.toGoogle(e),clickable:t.clickable,editable:t.editable,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,strokeWeight:t.strokeWeight,fillColor:t.fillColor,fillOpacity:t.fillOpacity,visible:t.visible});return new Tt(i,e,this)}getBounds(){return V.fromGoogle(this.innerOverlay.getBounds()??ie.BOUNDS_ZERO,this.coordType)}setBounds(t){const e=t.toGoogle(this.coordType);e.equals(this.innerOverlay.getBounds())||this.innerOverlay.setBounds(e)}}const ne=1;class ln extends st{constructor(e,i){var n;super(e);f(this,"buildInMapTypeId2BIMT");f(this,"baiduMapType2BIMT");f(this,"map");f(this,"createLabel",Kt.create);f(this,"createCircle",lt.create);f(this,"createPolygon",_t.create);f(this,"createPolyline",yt.create);f(this,"createRectangle",Mt.create);f(this,"createInfoWindow",dt.create);f(this,"createInfoBox",pt.create);f(this,"createMarker",pe.create);f(this,"createMapTypeControl",je.create);f(this,"createZoomControl",Xe.create);f(this,"createStreetViewControl",qe.create);f(this,"createScaleControl",Ue.create);this.buildInMapTypeId2BIMT=a.MapType.BUILD_IN_MAP_TYPES.getValueMap(Z.prototype.getId),this.baiduMapType2BIMT=a.MapType.BUILD_IN_MAP_TYPES.getValueMap(Z.prototype.asBaiduMapType),Lr(),this.map=new BMap.Map(e,{minZoom:i.minZoom&&i.minZoom+ne,maxZoom:i.maxZoom&&i.maxZoom+ne,mapType:i.buildInMapTypeId&&((n=this.buildInMapTypeId2BIMT.get(i.buildInMapTypeId))==null?void 0:n.asBaiduMapType()),enableMapClick:!1}),this.map.centerAndZoom(i.center.toBaidu(this.coordType),i.zoom+ne),this.setGestureHandling(i.gestureHandling),i.infoWindowMode==="multi"&&console.warn("baidu不支持多个InfoWindow, 可能会出现未知问题"),i.mapStyle&&this.map.setMapStyleV2(i.mapStyle.baidu),this.setEventTargetDelegate(new _e(this.map,this)),this.map.addEventListener("addoverlay",s=>{const l=s.target.__info_box__;l&&(console.debug("add:info-box",l),this.map.addOverlay(l))}),this.map.addEventListener("removeoverlay",s=>{const l=s.target.__info_box__;l&&(console.debug("remove:info-box",l),this.map.removeOverlay(l))})}setGestureHandling(e=K.auto){switch(e===K.auto&&(e=this.element.parentElement&&Rt.isScrollable(this.element.parentElement)?K.cooperative:K.greedy),e){case K.cooperative:this.map.disableScrollWheelZoom(),this.map.enableDragging(),this.map.enableDoubleClickZoom();break;case K.greedy:this.map.enableScrollWheelZoom(),this.map.enableDragging(),this.map.enableDoubleClickZoom();break;case K.none:this.map.disableDragging(),this.map.disableScrollWheelZoom(),this.map.disableDoubleClickZoom();break}}get innerMap(){return this.map}get coordType(){return this.getMapType().getBaiduCoordType()}addEventListener(e,i){if(e==="center-changed"){super.addEventListener("movestart",i),super.addEventListener("moving",i),super.addEventListener("moveend",i),super.addEventListener("zoomend",i);return}super.addEventListener(e,i)}removeEventListener(e,i){if(e==="center-changed"){super.removeEventListener("movestart",i),super.removeEventListener("moving",i),super.removeEventListener("moveend",i),super.removeEventListener("zoomend",i);return}super.removeEventListener(e,i)}fromContainerPointToLatLng(e){return w.fromBaidu(this.innerMap.pixelToPoint(new BMap.Pixel(e.x,e.y)),this.coordType)}fromLatLngToContainerPoint(e){return this.innerMap.pointToPixel(e.toBaidu(this.coordType))}setDefaultCursor(e){this.innerMap.setDefaultCursor(e)}setDraggable(e){e?this.innerMap.enableDragging():this.innerMap.disableDragging()}setDoubleClickZoom(e){e?this.map.enableDoubleClickZoom():this.map.disableDoubleClickZoom()}getCenter(){return w.fromBaidu(this.map.getCenter(),this.coordType)}setCenter(e){this.map.setCenter(e.toBaidu(this.coordType))}getZoom(){return super.getZoom()-ne}setZoom(e){return super.setZoom(e+ne)}setMinZoom(e){this.map.setMinZoom(e+ne)}setMaxZoom(e){this.map.setMaxZoom(e+ne)}setMapStyle(e){this.map.setMapStyleV2((e==null?void 0:e.baidu)??{styleJson:[]})}setBuildInMapTypeId(e){var n;const i=(n=this.buildInMapTypeId2BIMT.get(e))==null?void 0:n.asBaiduMapType();this.map.setMapType(i??I("理论上来说不可能为空"))}setMapType(e){this.map.setMapType(e.asBaiduMapType())}getMapType(){const e=this.map.getMapType(),i=this.baiduMapType2BIMT.get(e);return i||(e.__baidu_map_type__??I("实现asBaiduMapType()时, 忘了给实例设置__baidu_map_type__?"))}addLayer(e){this.map.addTileLayer(e.asBaiduLayer())}removeLayer(e){this.map.removeTileLayer(e.asBaiduLayer())}panTo(e){this.map.panTo(e.toBaidu(this.coordType))}panBy(e,i){this.map.panBy(e,i)}fitBounds(e,i){this.map.setViewport(e.toBaiduArray(this.coordType),{margins:i&&[i.top,i.right,i.bottom,i.left]})}getBounds(){return V.fromBaidu(this.map.getBounds(),this.coordType)}addElementOverlay(e){this.map.addOverlay(e.asBaidu())}removeElementOverlay(e){this.map.removeOverlay(e.asBaidu())}addOverlay(e){this.map.addOverlay(e.innerOverlay)}removeOverlay(e){this.map.removeOverlay(e.innerOverlay)}addCustomControl(e){if(!e.inner){const i=class extends BMap.Control{constructor(){super(...arguments);f(this,"defaultAnchor",a.ControlPositionConverter.getBaidu().toValue(e.position));f(this,"defaultOffset",new BMap.Size(0,0))}initialize(s){const l=e.onCreateElement();return s.getContainer().appendChild(l),l}};e.inner=new i,this.map.addControl(e.inner)}}removeCustomControl(e){e.inner&&(oe(e.inner instanceof BMap.Control,`control.inner(${e.inner})需要是BMap.Control`),this.map.removeControl(e.inner))}createMarkerClusterer(e){return new Si(this,e)}createHeatmap(e){return new wi(this,e)}createAutocomplete(e){return new Mi(this,e)}createSearchBox(e){return new Di(this,e)}createPlacesService(e){return new Ai(this,e)}createMapUrls(e){return new it(e)}}class hn extends st{constructor(e,i){var s,l;super(e);f(this,"buildInMapTypeId2BIMT");f(this,"googleMapTypeId2BIMT");f(this,"map");f(this,"createLabel",Xt.create);f(this,"createCircle",ht.create);f(this,"createPolygon",bt.create);f(this,"createPolyline",vt.create);f(this,"createRectangle",Tt.create);f(this,"createInfoWindow",ut.create);f(this,"createInfoBox",gt.create);f(this,"createMarker",mt.create);f(this,"createMapTypeControl",Fe.create);f(this,"createZoomControl",Je.create);f(this,"createStreetViewControl",Ke.create);f(this,"createScaleControl",Ye.create);this.mapOptions=i,this.buildInMapTypeId2BIMT=a.MapType.BUILD_IN_MAP_TYPES.getValueMap(Z.prototype.getId),this.googleMapTypeId2BIMT=a.MapType.BUILD_IN_MAP_TYPES.getValueMap(Z.prototype.getGoogleMapTypeId);const n=i.buildInMapTypeId&&this.buildInMapTypeId2BIMT.get(i.buildInMapTypeId);this.map=new google.maps.Map(e,{center:i.center.toGoogle((n??a.MapType.NORMAL).getGoogleCoordType()),zoom:i.zoom,disableDefaultUI:!0,gestureHandling:i.gestureHandling,minZoom:i.minZoom,maxZoom:i.maxZoom,styles:(s=i.mapStyle)==null?void 0:s.google.styles,mapId:(l=i.mapStyle)==null?void 0:l.google.mapId,mapTypeId:n==null?void 0:n.getGoogleMapTypeId()}),this.setEventTargetDelegate(new le(this.map,this))}setGestureHandling(e){this.map.setOptions({gestureHandling:e})}get innerMap(){return this.map}get coordType(){return this.getMapType().getGoogleCoordType()}fromContainerPointToLatLng(e){const i=this.innerMap.getProjection(),n=this.innerMap.getBounds();if(i==null||n==null)return w.ZERO;const s=i.fromLatLngToPoint(n.getSouthWest()),l=i.fromLatLngToPoint(n.getNorthEast()),g=this.innerMap.getZoom();if(s==null||l==null||g==null)return w.ZERO;const o=Math.pow(2,g),c=new google.maps.Point(e.x/o+s.x,e.y/o+l.y);return w.fromGoogle(i.fromPointToLatLng(c)??ie.LATLNG_ZERO,this.coordType)}fromLatLngToContainerPoint(e){const i=this.innerMap.getProjection(),n=this.innerMap.getBounds();if(i==null||n==null)return a.Point.ZERO;const s=i.fromLatLngToPoint(n.getSouthWest()),l=i.fromLatLngToPoint(n.getNorthEast()),g=this.innerMap.getZoom();if(s==null||l==null||g==null)return a.Point.ZERO;const o=Math.pow(2,g),c=i.fromLatLngToPoint(e.toGoogle(this.coordType));return c==null?a.Point.ZERO:{x:(c.x-s.x)*o,y:(c.y-l.y)*o}}setDefaultCursor(e){this.innerMap.setOptions({draggableCursor:e})}setDraggable(e){this.innerMap.setOptions({draggable:e})}setDoubleClickZoom(e){this.map.setOptions({disableDoubleClickZoom:!e})}getCenter(){return w.fromGoogle(this.map.getCenter()??ie.LATLNG_ZERO,this.coordType)}setCenter(e){this.map.setCenter(e.toGoogle(this.coordType))}setMinZoom(e){this.map.setOptions({minZoom:e})}setMaxZoom(e){this.map.setOptions({maxZoom:e})}setMapStyle(e){this.map.setOptions({styles:e==null?void 0:e.google.styles,mapId:e==null?void 0:e.google.mapId})}setBuildInMapTypeId(e){var n;const i=(n=this.buildInMapTypeId2BIMT.get(e))==null?void 0:n.getGoogleMapTypeId();this.map.setMapTypeId(i??I("理论上来说不可能为空"))}setMapType(e){e instanceof Z?this.map.setMapTypeId(e.getGoogleMapTypeId()):(this.map.mapTypes.set(e.id,e.asGoogleMapType()),this.map.setMapTypeId(e.id))}getMapType(){const e=this.map.getMapTypeId()??google.maps.MapTypeId.ROADMAP,i=this.googleMapTypeId2BIMT.get(e);return i||(this.map.mapTypes.get(e).__google_map_type__??I(`实现${e}的asGoogleMapType()时, 忘了给实例设置__google_map_type__?`))}addOverlayMapType(e){this.map.overlayMapTypes.push(e.asGoogleMapType())}removeOverlayMapType(e){a.MVCArrays.remove(this.map.overlayMapTypes,e.asGoogleMapType())}addLayer(e){e.asGoogleLayer().setMap(this.map)}removeLayer(e){e.asGoogleLayer().setMap(null)}panTo(e){this.map.panTo(e.toGoogle(this.coordType))}panBy(e,i){this.map.panBy(e,i)}fitBounds(e,i){this.map.fitBounds(e.toGoogle(this.coordType),i)}getBounds(){const e=this.map.getBounds();return e?V.fromGoogle(e,this.coordType):V.EMPTY}addElementOverlay(e){e.asGoogle().setMap(this.map)}removeElementOverlay(e){e.asGoogle().setMap(null)}addOverlay(e){e.innerOverlay.setMap(this.map)}removeOverlay(e){e.innerOverlay.setMap(null)}addCustomControl(e){e.inner||(e.inner=e.onCreateElement(),this.map.controls[a.ControlPositionConverter.getGoogle().toValue(e.position)].push(e.inner))}removeCustomControl(e){if(e.inner){const i=this.map.controls[a.ControlPositionConverter.getGoogle().toValue(e.position)];a.MVCArrays.remove(i,e.inner)}}createMarkerClusterer(e){return new ki(this,e)}createHeatmap(e){return new Oi(this,e)}createAutocomplete(e){return new bi(this,e)}createSearchBox(e){return new Ri(this,e)}createPlacesService(e){return new xi(this,e)}createMapUrls(e){return new tt(e)}}const Ct=["3.0"],cn={baidu:{version:"3.0",key:""},google:{version:"quarterly",key:"",language:"en-us",libraries:["places","visualization"]},here:{version:Ct[0],key:""}};let Fi;function Jt(){return Fi||I("请先安装: Vue<PartialTgMapConfig>.use(TgMap, {})")}function Ui(r){r!=null&&(Fi=Ni(cn,r))}class dn extends st{constructor(e,i){var l;super(e);f(this,"map");f(this,"defaultLayers");this.mapOptions=i;const n=Jt().here;Ct.includes(n.version)||I(`不支持${n.version}, HereMap当前只支持如下版本: ${Ct}`);const s=new H.service.Platform({app_id:n.key.split(",")[0],app_code:n.key.split(",")[1]});this.defaultLayers=s.createDefaultLayers(),this.map=new H.Map(e,this.defaultLayers.normal.map,{zoom:i.zoom,center:(l=i.center)==null?void 0:l.toHere(this.coordType)}),new H.mapevents.Behavior(new H.mapevents.MapEvents(this.map)),H.ui.UI.createDefault(this.map,this.defaultLayers)}get innerMap(){return this.map}get coordType(){return R.wgs84}getCenter(){return w.fromHere(this.map.getCenter(),this.coordType)}setCenter(e){this.map.setCenter(e.toHere(this.coordType))}setGestureHandling(e){throw new Error("Method not implemented.")}fromContainerPointToLatLng(e){throw new Error("Method not implemented.")}fromLatLngToContainerPoint(e){throw new Error("Method not implemented.")}setDefaultCursor(e){throw new Error("Method not implemented.")}setDraggable(e){throw new Error("Method not implemented.")}setDoubleClickZoom(e){throw new Error("Method not implemented.")}setMinZoom(e){throw new Error("Method not implemented.")}setMaxZoom(e){throw new Error("Method not implemented.")}setMapStyle(e){throw new Error("Method not implemented.")}setBuildInMapTypeId(e){throw new Error("Method not implemented.")}setMapType(e){throw new Error("Method not implemented.")}getMapType(){throw new Error("Method not implemented.")}addLayer(e){throw new Error("Method not implemented.")}removeLayer(e){throw new Error("Method not implemented.")}panTo(e){throw new Error("Method not implemented.")}panBy(e,i){throw new Error("Method not implemented.")}fitBounds(e,i){throw new Error("Method not implemented.")}getBounds(){throw new Error("Method not implemented.")}addElementOverlay(e){throw new Error("Method not implemented.")}removeElementOverlay(e){throw new Error("Method not implemented.")}addOverlay(e){throw new Error("Method not implemented.")}removeOverlay(e){throw new Error("Method not implemented.")}createMarker(e){throw new Error("Method not implemented.")}createMarkerClusterer(e){throw new Error("Method not implemented.")}createHeatmap(e){throw new Error("Method not implemented.")}createAutocomplete(e){throw new Error("Method not implemented.")}createSearchBox(e){throw new Error("Method not implemented.")}createPlacesService(e){throw new Error("Method not implemented.")}createMapUrls(e){throw new Error("Method not implemented.")}createInfoWindow(e){throw new Error("Method not implemented.")}createInfoBox(e){throw new Error("Method not implemented.")}createPolyline(e){throw new Error("Method not implemented.")}createPolygon(e){throw new Error("Method not implemented.")}createRectangle(e){throw new Error("Method not implemented.")}createCircle(e){throw new Error("Method not implemented.")}createLabel(e){throw new Error("Method not implemented.")}addCustomControl(e){throw new Error("Method not implemented.")}removeCustomControl(e){throw new Error("Method not implemented.")}createMapTypeControl(e){throw new Error("Method not implemented.")}createZoomControl(e){throw new Error("Method not implemented.")}createStreetViewControl(e){throw new Error("Method not implemented.")}createScaleControl(e){throw new Error("Method not implemented.")}}var U=(r=>(r.google="google",r.baidu="baidu",r.here="here",r))(U||{});a.TgMapFactory=void 0,(r=>{function t(e,i,n){const s=a.MapOptions.create(n);switch(e){case"google":return new hn(i,s);case"baidu":return new ln(i,s);case"here":return new dn(i,s)}}r.createMap=t})(a.TgMapFactory||(a.TgMapFactory={}));function un(r){throw new Error(`todo: ${r}`)}function pn(r){return r}function Yi(r){return r[1]!=null}function qi(r){let t=null;return()=>t??(t=r().catch(e=>(t=null,Promise.reject(e))))}var gn={VITE_APP_DEV_KEY_BAIDU:"",VITE_APP_DEV_KEY_GOOGLE:"",VITE_APP_DEV_KEY_HERE:"",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const mn={};function Ki(r){return a.Objects.putIfAbsent(mn,r,()=>qi(()=>fn({type:r,config:Jt()[r]})))()}function fn({type:r,config:t}){const e=window,i=yn(r);if(a.Objects.get(e,i))return Promise.resolve();switch(r!==U.here&&!t.key&&I(`请先配置${r}地图的key`),r){case U.google:return gn.VITE_FALSE?(kr({key:t.key,v:"3.52"}),google.maps.importLibrary("core")):Xi(`https://maps.googleapis.com/maps/api/js?key=${t.key}&language=${t.language}&v=${t.version}&libraries=${t.libraries.join(",")}`);case U.baidu:return Xi(`https://api.map.baidu.com/api?v=${t.version}&ak=${t.key}`);case U.here:return Ee(we("core",t.version)).then(()=>Promise.all([Ee(we("service",t.version)),Ee(we("mapevents",t.version)),Ee(we("clustering",t.version)),Ee(we("ui",t.version))])).catch(n=>(a.Objects.del(e,i),Promise.reject(n)));default:Bt(r)}}function we(r,t=Ct[0]){return`https://js.api.here.com/v3/${t}/mapsjs-${r}.js`}function yn(r){switch(r){case U.google:return"google.maps";case U.baidu:return"BMap";case U.here:return"H"}}let vn=0;function Xi(r,t="callback"){return new Promise((e,i)=>{const n=`__callback${vn++}`;window[n]=e;const s=document.createElement("script");s.src=`${r}&${t}=${n}`,s.onerror=i,document.body.appendChild(s)})}function Ee(r){return new Promise((t,e)=>{const i=document.createElement("script");i.src=r,i.onload=t,i.onerror=e,document.body.appendChild(i)})}function W(r,t){return{type:String,default:t,validator:e=>Object.values(r).includes(e)}}function Ji(r,t){return{type:String,default:t,validator:e=>r.includes(e)}}function G(r){return{type:r,required:!0}}function O(r,t){return{type:r,default:t}}function _n(r){const t={};return Object.entries(r).forEach(([e,i])=>{const n=`__${e}`;t[e]={get(){const s=this[n];return s===void 0?i:s},set(s){this[n]=s}}}),t}const Pe={enumerable:!0,configurable:!0,get:ve,set:ve};function Qi(r){return Object.keys(r).forEach(t=>{const e=r[t];let i=!1;typeof e=="function"?(Pe.get=e,Pe.set=ve,i=!0):typeof e=="object"&&typeof e.get=="function"&&(Pe.get=e.get,Pe.set=e.set,i=!0),i&&(r[t]=Object.defineProperty(r,t,Pe))}),r}function bn(r){return Qi(r)}function Le(){return M.createCommentVNode()}function Be(r,t){const e=r.$options[t];if(e)for(const i of e)i.call(r)}function Mn(r,t){for(const e of r)if(e.$options.name===t.name)return e}function Tn(r,t){if(!r.default)return;const e=r.default();for(const i of e)if((i==null?void 0:i.type).name===t.name)return i}function er(r,t){const e={},i={},n={};return Object.keys(r).forEach(s=>{s.startsWith("on")?e[a.Strings.pascal2kebab(s.substring(2))]=r[s]:i[s]=r[s]}),t&&Object.keys(t).forEach(s=>{s.startsWith("on")&&(n[a.Strings.pascal2kebab(s.substring(2))]=t[s])}),{binds:i,listeners:e,listenerProps:n}}function X(r,t){return M.computed(()=>er(r,t))}function x(){return Function}const Cn=()=>{let r,t;function e(n){console.log(n),r=n&&n.type,t=Date.now()}function i(n){((n&&n.type)!==r||Date.now()-(t??0)>1e3)&&e(n)}return{eventLog:e,eventLogLess:i}},Ot="$map",ge="onCreate",me="onDestroy",$=M.defineComponent({inject:[Ot],mounted(){Be(this,ge)},beforeUnmount(){Be(this,me)},methods:{recreate(){Be(this,me),Be(this,ge)}},render(){return Le()}}),On=M.defineComponent({name:"tg-map",provide(){return{[Ot]:M.computed(()=>this.map)}},inheritAttrs:!1,props:{type:W(U,U.google),center:G(w),centerSyncDelay:O(Number,300),currentCenter:O(w),lastCenter:O(w),zoom:G(Number),infoWindowMode:Ji(Vi),gestureHandling:W(K),minZoom:O(Number),maxZoom:O(Number),mapStyle:O(Object),mapTypeId:W($t),mapType:O(Object),hideLogo:O(Boolean),onLoad:x(),"onUpdate:center":x(),"onUpdate:current-center":x(),"onUpdate:last-center":x(),"onUpdate:map-type":x(),"onUpdate:map-type-id":x(),"onUpdate:zoom":x(),onError:x()},emits:void 0,setup(r,{attrs:t}){return{attrs:X(t,r),centerSyncTimeoutId:void 0}},data(){return{map:It(),isDestroyed:!1}},computed:{propsJson(){return a.Objects.toJsonSafely(this.$props)}},watch:{gestureHandling(r){var t;r&&((t=this.map)==null||t.setGestureHandling(r))},minZoom(r){var t;(t=this.map)==null||t.setMinZoom(r)},maxZoom(r){var t;(t=this.map)==null||t.setMaxZoom(r)},mapStyle(r){var t;(t=this.map)==null||t.setMapStyle(r)},mapTypeId(r){var t;r&&((t=this.map)==null||t.setBuildInMapTypeId(r))},mapType(r){var t;(t=this.map)==null||t.setMapType(r??a.MapType.NORMAL)}},async mounted(){const r=this.type;try{await Ki(r)}catch(n){this.$emit("error",n);return}if(this.isDestroyed){console.warn(`tg-map(type=${r})已销毁, 不需要继续执行`);return}const t=a.TgMapFactory.createMap(r,this.$refs.map,{center:this.center,zoom:this.zoom,infoWindowMode:this.infoWindowMode,gestureHandling:this.gestureHandling,minZoom:this.minZoom,maxZoom:this.maxZoom,mapStyle:this.mapStyle,buildInMapTypeId:this.mapTypeId});if(this.map=M.markRaw(t),this.mapType&&t.setMapType(this.mapType),"ready"in this.attrs.listeners&&console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"),J(this.attrs.listeners,t,["load"]),this.$emit("load",t),M.watch([()=>this.zoom,()=>this.center],([n,s],[l,g])=>{n!==l&&t.setZoom(n),s!==g&&(t.getCenter().equals(s)||t.setCenter(s))}),this.attrs.listenerProps["update:center"]){const n=()=>this.$emit("update:center",t.getCenter());t.addEventListener("center-changed",()=>{this.centerSyncDelay>0?(clearTimeout(this.centerSyncTimeoutId),this.centerSyncTimeoutId=setTimeout(n,this.centerSyncDelay)):n()})}this.attrs.listenerProps["update:current-center"]&&(this.$emit("update:current-center",this.center),t.addEventListener("center-changed",()=>{this.$emit("update:current-center",t.getCenter())})),this.attrs.listenerProps["update:zoom"]&&t.addEventListener("zoom-changed",()=>{this.$emit("update:zoom",t.getZoom())});const e=this.attrs.listenerProps["update:map-type"],i=this.attrs.listenerProps["update:map-type-id"];(e||i)&&t.addEventListener("map-type-changed",()=>{const n=t.getMapType();e&&this.$emit("update:map-type",n),i&&this.$emit("update:map-type-id",n.id)})},unmounted(){this.isDestroyed=!0,this.map&&(this.attrs.listenerProps["update:last-center"]&&this.$emit("update:last-center",this.map.getCenter()),this.attrs.listenerProps["update:center"]&&(clearTimeout(this.centerSyncTimeoutId),this.$emit("update:center",this.map.getCenter())))},methods:{}}),Q=(r,t)=>{const e=r.__vccOpts||r;for(const[i,n]of t)e[i]=n;return e};function wn(r,t,e,i,n,s){return M.openBlock(),M.createElementBlock("div",M.mergeProps({class:"tg-map"},r.attrs.binds),[M.createElementVNode("div",{ref:"map",class:M.normalizeClass({"tg-map__map":!0,[`tg-map__map--hide-logo-${r.type}`]:r.hideLogo})},null,2),M.createCommentVNode("",!0),r.map?M.renderSlot(r.$slots,"default",{key:1}):M.createCommentVNode("",!0),M.renderSlot(r.$slots,"overlay")],16)}const fe=Q(On,[["render",wn]]);function En(r){if(r==null)return;let t;if(typeof r=="string"){if(t=+r,Number.isNaN(t))return r}else t=r;return`${t}px`}const Pn=M.defineComponent({name:"tg-map-widget",props:{left:{type:[Number,String],default:null},top:{type:[Number,String],default:null},right:{type:[Number,String],default:null},bottom:{type:[Number,String],default:null}},computed:{topValue(){return this.top==null&&this.bottom==null?0:this.top}},methods:{dimen:En}});function Ln(r,t,e,i,n,s){return M.openBlock(),M.createElementBlock("div",{class:M.normalizeClass(r.$options.name),style:M.normalizeStyle({left:r.dimen(r.left),top:r.dimen(r.topValue),right:r.dimen(r.right),bottom:r.dimen(r.bottom)})},[M.renderSlot(r.$slots,"default")],6)}const tr=Q(Pn,[["render",Ln]]),Bn=M.defineComponent({name:"tg-custom-control",mixins:[$],props:{position:W(k,k.RIGHT_BOTTOM)},setup(){return{control:void 0}},watch:{position(){this.recreate()}},onCreate(){xt(this.$parent,fe)||console.warn("请将tg-custom-control放到tg-map中");const{$el:r}=this,t=class extends gi{onCreateElement(){return r}};this.control=new t(this.position),this.$map.addCustomControl(this.control)},onDestroy(){this.$map.removeCustomControl(this.control)}});function In(r,t,e,i,n,s){return M.openBlock(),M.createElementBlock("div",{class:M.normalizeClass(r.$options.name)},[M.renderSlot(r.$slots,"default")],2)}const ir=Q(Bn,[["render",In]]),rr=M.defineComponent({name:"tg-map-type-control",mixins:[$],props:{position:W(k,k.TOP_LEFT),type:W(zt),mapTypes:O(Array)},setup(){return{control:void 0}},watch:{position(r){this.control.setPosition(r)},type(){this.recreate()},mapTypes:{handler(){this.recreate()},deep:!0}},onCreate(){this.control=this.$map.createMapTypeControl(this),this.$map.addControl(this.control)},onDestroy(){this.$map.removeControl(this.control)}}),nr=M.defineComponent({name:"tg-scale-control",mixins:[$],props:{position:W(k,k.BOTTOM_RIGHT)},setup(){return{control:void 0}},watch:{position(r){this.control.setPosition(r)}},onCreate(){this.control=this.$map.createScaleControl(this),this.$map.addControl(this.control)},onDestroy(){this.$map.removeControl(this.control)}});function sr(){var e;const r=(e=M.getCurrentInstance())==null?void 0:e.type;let t=(r==null?void 0:r.name)??(r==null?void 0:r.__name);if(!t){const i=r==null?void 0:r.__file;i&&(t=Mr.basename(i,".vue"))}return t}function wt(){const r=M.inject(Ot);let t,e;return r==null&&I(`<${sr()||"unknown"}>必须作为<tg-map>的子代组件`),{mapRef:r,get map(){return r.value??I("map尚未初始化")},[ge](i){M.onMounted(i),t&&I(`${ge}只能调用一次`),t=i},[me](i){M.onBeforeUnmount(i),e&&I(`${me}只能调用一次`),e=i},recreate(){e==null||e(),t==null||t()}}}const or=M.defineComponent({name:"tg-street-view-control",props:{position:W(k,k.RIGHT_BOTTOM)},setup(r){let t=void 0;const{map:e,onCreate:i,onDestroy:n}=wt();return i(()=>{t=e.createStreetViewControl(r),e.addControl(t)}),n(()=>{e.removeControl(t)}),M.watch(()=>r.position,s=>{t.setPosition(s)}),Le}}),ar=M.defineComponent({name:"tg-zoom-control",props:{position:W(k,k.RIGHT_BOTTOM)},setup(r){let t=void 0;const{map:e,onCreate:i,onDestroy:n}=wt();return i(()=>{t=e.createZoomControl(r),e.addControl(t)}),n(()=>{e.removeControl(t)}),M.watch(()=>r.position,s=>{t.setPosition(s)}),Le}}),lr=M.defineComponent({name:"tg-heatmap",props:{maxIntensity:O(Number),gradient:O(Object),opacity:O(Number),radius:O(Number),data:G(Array)},setup(r){const{map:t,onCreate:e,onDestroy:i}=wt();let n=void 0;return e(()=>{n=t.createHeatmap(r)}),i(()=>{n.remove()}),M.watch(()=>r.data,s=>n.setData(s)),M.watch([()=>r.maxIntensity,()=>r.gradient,()=>r.opacity,()=>r.radius],()=>n.setOptions(r)),Le}}),Sn=M.defineComponent({name:"tg-marker-clusterer",mixins:[$],props:{gridSize:O(Number),maxZoom:O(Number),minClusterSize:O(Number),averageCenter:O(Boolean),styles:O(Array),stylesIndexCalculator:O(Function),zIndex:O(Number)},setup(){return{clusterer:void 0,markers:[]}},watch:{gridSize(){this.recreate()},maxZoom(){this.recreate()},minClusterSize(){this.recreate()},averageCenter(){this.recreate()},styles:{handler(){this.recreate()},deep:!0},stylesIndexCalculator(){this.recreate()},zIndex(){this.recreate()}},onCreate(){this.clusterer=this.$map.createMarkerClusterer(this)},onDestroy(){this.clusterer.clearMarkers()},methods:{isInitiated(){return this.clusterer!=null},onAddMarker(r){this.markers.push(r),this.isInitiated()&&this.clusterer.addMarker(r)},onRemoveMarker(r){this.isInitiated()&&this.clusterer.removeMarker(r),$e.remove(this.markers,r)}}});function kn(r,t,e,i,n,s){return M.openBlock(),M.createElementBlock("div",{class:M.normalizeClass(r.$options.name)},[M.renderSlot(r.$slots,"default")],2)}const Qt=Q(Sn,[["render",kn]]),hr=M.defineComponent({name:"tg-traffic-layer",mixins:[$],setup(){return{layer:void 0}},watch:{},onCreate(){this.layer=new fi,this.$map.addLayer(this.layer)},onDestroy(){this.$map.removeLayer(this.layer)}}),cr=M.defineComponent({name:"tg-circle",mixins:[$],inheritAttrs:!1,props:{center:G(w),radius:G(Number),clickable:O(Boolean),editable:O(Boolean),strokeColor:O(String),strokeOpacity:O(Number),strokeWeight:O(Number),visible:O(Boolean),fillColor:O(String),fillOpacity:O(Number),"onUpdate:center":x(),"onUpdate:radius":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:X(t,r),overlay:void 0,emittedRadius:void 0,emittedCenter:void 0}},watch:{center(r){if(this.emittedCenter!=null){const t=this.emittedCenter;if(this.emittedCenter=void 0,t===M.toRaw(r))return}this.overlay.setCenter(r)},radius(r){if(this.emittedRadius!=null){const t=this.emittedRadius;if(this.emittedRadius=void 0,t===r)return}this.overlay.setRadius(r)},clickable(){this.recreate()},editable(r){this.overlay.setEditable(r)},strokeColor(r){this.overlay.setStrokeColor(r)},strokeOpacity(r){this.overlay.setStrokeOpacity(r)},strokeWeight(r){this.overlay.setStrokeWeight(r)},fillColor(r){this.overlay.setFillColor(r)},fillOpacity(r){this.overlay.setFillOpacity(r)},visible(r){this.overlay.setVisible(r)}},onCreate(){this.overlay=this.$map.createCircle(this),this.$map.addOverlay(this.overlay),J(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:center"]&&this.overlay.addEventListener("center-changed",()=>{this.$emit("update:center",this.emittedCenter=this.overlay.getCenter())}),this.attrs.listenerProps["update:radius"]&&this.overlay.addEventListener("radius-changed",()=>{this.$emit("update:radius",this.emittedRadius=this.overlay.getRadius())})},onDestroy(){this.$map.removeOverlay(this.overlay)}});class xn extends ji{constructor(t,e,i,n){super(t,e),this.content=i,this.position=n}onCreate(){return this.content}onDraw(t){const e=t.fromLatLngToOverlayPoint(this.position);this.content.style.left=e.x+"px",this.content.style.top=e.y+"px"}setPosition(t){this.position=t,this.draw()}}const An=M.defineComponent({name:"tg-element-overlay",mixins:[$],props:{mapPane:W(de,de.overlayMouseTarget),position:G(w)},setup(){return{overlay:void 0}},watch:{position(r){this.overlay.setPosition(r)},mapPane(){this.recreate()}},methods:{content(){return this.$el}},onCreate(){this.overlay=new xn(this.$map,this,this.content(),this.position),this.$map.addElementOverlay(this.overlay)},onDestroy(){this.$map.removeElementOverlay(this.overlay)}});function Rn(r,t,e,i,n,s){return M.openBlock(),M.createElementBlock("div",M.mergeProps({class:r.$options.name},r.$attrs),[M.renderSlot(r.$slots,"default")],16)}const dr=Q(An,[["render",Rn]]),Dn=M.defineComponent({name:"tg-marker",mixins:[$],inheritAttrs:!1,props:{position:G(w),title:O(String),icon:O(Object),clickable:O(Boolean),draggable:O(Boolean),crossOnDrag:O(Boolean),cursor:O(String),zIndex:O(Number),visible:O(Boolean),normalizePositionForBaidu:O(Boolean),autoAddToClusterer:O(Boolean,!0),"onUpdate:position":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:X(t,r),marker:void 0,label:It(),info:It(),emittedPosition:void 0,autoAddToClustererWhenCreate:r.autoAddToClusterer}},watch:{position(r){if(this.emittedPosition!=null){const t=this.emittedPosition;if(this.emittedPosition=void 0,t===M.toRaw(r))return}this.marker.setPosition(r)},title(r){this.marker.setTitle(r)},icon(r){r?this.marker.setIcon(r):this.recreate()},clickable(r){this.marker instanceof pe?this.recreate():this.marker.setClickable(r)},draggable(r){this.marker.setDraggable(r)},crossOnDrag(){this.recreate()},cursor(){this.recreate()},zIndex(r){this.marker instanceof pe?this.recreate():this.marker.setZIndex(r)},visible(r){this.marker.setVisible(r)},normalizePositionForBaidu(){this.recreate()},autoAddToClusterer(){this.recreate()}},onCreate(){this.marker=this.$map.createMarker(this),this.label&&this.marker.setLabel(this.label.overlay),this.$clusterer()&&this.autoAddToClusterer?this.$clusterer().onAddMarker(this.marker):this.$map.addOverlay(this.marker),this.autoAddToClustererWhenCreate=this.autoAddToClusterer,this.info&&this.info.show&&this.info.overlay.open(this.marker),J(this.attrs.listeners,this.marker),this.attrs.listenerProps["update:position"]&&this.marker.addEventListener("dragend",r=>{this.$emit("update:position",this.emittedPosition=r.position)})},onDestroy(){this.$clusterer()&&this.autoAddToClustererWhenCreate?this.$clusterer().onRemoveMarker(this.marker):this.$map.removeOverlay(this.marker)},methods:{$clusterer(){return xt(this.$parent,Qt)},onAddLabel(r){this.label=r,this.marker&&this.marker.setLabel(r.overlay)},onRemoveLabel(r){this.marker.setLabel(void 0),this.label=void 0},onAddInfo(r){this.info=r,this.marker&&r.show&&r.overlay.open(this.marker)},onRemoveInfo(r){r.overlay.close(),this.info=void 0},onInfoShowChanged(r,t){t?r.overlay.open(this.marker):r.overlay.close()}}});function $n(r,t,e,i,n,s){return M.renderSlot(r.$slots,"default")}const Ie=Q(Dn,[["render",$n]]),zn=M.defineComponent({name:"tg-info-box",mixins:[$],inheritAttrs:!1,props:{show:G(Boolean),position:O(w),offset:O(Object),maxWidth:O(Number),borderClass:O(String),zIndex:O(Number),"onUpdate:show":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:X(t,r),overlay:void 0}},watch:{show(r){this.$marker()?this.$marker().onInfoShowChanged(this,r):r?this.overlay.open():this.overlay.close()},position(r){this.overlay.setPosition(r)},offset(){this.recreate()},maxWidth(r){this.overlay.setMaxWidth(r)},borderClass(){this.recreate()},zIndex(r){this.overlay.setZIndex(r)}},onCreate(){this.overlay=this.$map.createInfoBox(this.getOptions()),this.$marker()?this.$marker().onAddInfo(this):this.show&&this.overlay.open(),this.attrs.listenerProps["update:show"]&&this.overlay.addEventListener("closeclick",()=>{this.$emit("update:show",!1)}),J(this.attrs.listeners,this.overlay)},onDestroy(){this.$marker()?this.$marker().onRemoveInfo(this):this.overlay.close()},methods:{getOptions(){return{content:this.content(),position:this.position,offset:this.offset,zIndex:this.zIndex,maxWidth:this.maxWidth,borderClass:this.borderClass}},content(){return this.$el},$marker(){return Ze(Ie,this.$parent,fe)},open(r){this.overlay.open(r)},close(){this.overlay.close()}}});function Gn(r,t,e,i,n,s){return M.openBlock(),M.createElementBlock("div",M.mergeProps({class:r.$options.name},r.attrs.binds),[M.renderSlot(r.$slots,"default")],16)}const ur=Q(zn,[["render",Gn]]),Nn=M.defineComponent({name:"tg-info-window",mixins:[$],inheritAttrs:!1,props:{show:G(Boolean),position:O(w),maxWidth:O(Number),offset:O(Object),disableAutoPan:O(Boolean),"onUpdate:show":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:X(t,r),overlay:void 0}},watch:{show(r){this.$marker()?this.$marker().onInfoShowChanged(this,r):r?this.overlay.open():this.overlay.close()},position(r){this.overlay.setPosition(r)},maxWidth(){this.recreate()},offset(){this.recreate()},disableAutoPan(){this.recreate()}},methods:{content(){return this.$el},$marker(){return Ze(Ie,this.$parent,fe)},getOptions(){return{content:this.content(),position:this.position,maxWidth:this.maxWidth,offset:this.offset,disableAutoPan:this.disableAutoPan}}},onCreate(){this.overlay=this.$map.createInfoWindow(this.getOptions()),this.$marker()?this.$marker().onAddInfo(this):this.show&&this.overlay.open(),this.overlay.addEventListener("open",()=>{this.$emit("update:show",!0)}),this.overlay.addEventListener("close",()=>{this.$emit("update:show",!1)}),J(this.attrs.listeners,this.overlay)},onDestroy(){this.$marker()?this.$marker().onRemoveInfo(this):this.overlay.close()}});function Zn(r,t,e,i,n,s){return M.withDirectives((M.openBlock(),M.createElementBlock("div",M.mergeProps({class:r.$options.name},r.attrs.binds),[M.renderSlot(r.$slots,"default")],16)),[[M.vShow,r.show]])}const pr=Q(Nn,[["render",Zn]]),Wn=M.defineComponent({name:"tg-label",mixins:[$],inheritAttrs:!1,props:{position:O(w),offset:O(Object),zIndex:O(Number),mapPane:W(de)},emits:void 0,setup(r,{attrs:t}){return{attrs:X(t),overlay:void 0}},watch:{position(r){this.overlay.setPosition(r)},offset(r){this.overlay.setOffset(r)},zIndex(r){this.overlay.setZIndex(r)},visible(r){this.overlay.setVisible(r)},mapPane(){this.recreate()}},methods:{content(){return this.$el},marker(){var r;return(r=this.$marker())==null?void 0:r.marker},$marker(){return Ze(Ie,this.$parent,fe)},getOptions(){return{content:this.content(),position:this.position,offset:this.offset,zIndex:this.zIndex,mapPane:this.mapPane}}},onCreate(){this.overlay=this.$map.createLabel(this.getOptions()),this.$marker()?this.$marker().onAddLabel(this):this.$map.addOverlay(this.overlay),J(this.attrs.listeners,this.overlay)},onDestroy(){this.$marker()?this.$marker().onRemoveLabel(this):this.$map.removeOverlay(this.overlay)}});function Hn(r,t,e,i,n,s){return M.openBlock(),M.createElementBlock("div",M.mergeProps({class:r.$options.name},r.attrs.binds),[M.renderSlot(r.$slots,"default")],16)}const gr=Q(Wn,[["render",Hn]]),mr=M.defineComponent({name:"tg-polygon",mixins:[$],inheritAttrs:!1,props:{paths:G(Array),clickable:O(Boolean),editable:O(Boolean),strokeColor:O(String),strokeOpacity:O(Number),strokeWeight:O(Number),visible:O(Boolean),fillColor:O(String),fillOpacity:O(Number),"onUpdate:paths":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:X(t,r),overlay:void 0,emittedPaths:void 0}},watch:{paths:{handler(r){if(this.emittedPaths!=null){const t=this.emittedPaths;if(this.emittedPaths=void 0,t.length===r.length&&t.every((e,i)=>e===M.toRaw(r[i])))return}this.overlay.setPaths(r)},deep:!0},clickable(){this.recreate()},editable(r){this.overlay.setEditable(r)},strokeColor(r){this.overlay.setStrokeColor(r)},strokeOpacity(r){this.overlay.setStrokeOpacity(r)},strokeWeight(r){this.overlay.setStrokeWeight(r)},fillColor(r){this.overlay.setFillColor(r)},fillOpacity(r){this.overlay.setFillOpacity(r)},visible(r){this.overlay.setVisible(r)}},onCreate(){this.overlay=this.$map.createPolygon(this),this.$map.addOverlay(this.overlay),J(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:paths"]&&this.overlay.addEventListener("paths-edited",()=>{this.$emit("update:paths",this.emittedPaths=this.overlay.getPaths())})},onDestroy(){this.$map.removeOverlay(this.overlay)}}),fr=M.defineComponent({name:"tg-polyline",mixins:[$],inheritAttrs:!1,props:{path:G(Array),icons:O(Array),clickable:O(Boolean),editable:O(Boolean),strokeColor:O(String),strokeOpacity:O(Number),strokeWeight:O(Number),visible:O(Boolean),"onUpdate:path":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:X(t,r),overlay:void 0,emittedPath:void 0}},watch:{path:{handler(r){if(this.emittedPath!=null){const t=this.emittedPath;if(this.emittedPath=void 0,t===M.toRaw(r))return}this.overlay.setPath(r)},deep:!0},icons:{handler(){this.recreate()},deep:!0},clickable(){this.recreate()},editable(r){this.overlay.setEditable(r)},strokeColor(r){this.overlay.setStrokeColor(r)},strokeOpacity(r){this.overlay.setStrokeOpacity(r)},strokeWeight(r){this.overlay.setStrokeWeight(r)},visible(r){this.overlay.setVisible(r)}},onCreate(){this.overlay=this.$map.createPolyline(this),this.$map.addOverlay(this.overlay),J(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:path"]&&this.overlay.addEventListener("path-edited",()=>{this.$emit("update:path",this.emittedPath=this.overlay.getPath())})},onDestroy(){this.overlay.remove()}}),yr=M.defineComponent({name:"tg-rectangle",mixins:[$],inheritAttrs:!1,props:{bounds:G(Object),clickable:O(Boolean),editable:O(Boolean),strokeColor:O(String),strokeOpacity:O(Number),strokeWeight:O(Number),visible:O(Boolean),fillColor:O(String),fillOpacity:O(Number),"onUpdate:bounds":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:X(t,r),overlay:void 0,emittedBounds:void 0}},watch:{bounds(r){if(this.emittedBounds!=null){const t=this.emittedBounds;if(this.emittedBounds=void 0,t.equals(r))return}this.overlay.setBounds(r)},clickable(){this.recreate()},editable(r){this.overlay.setEditable(r)},strokeColor(r){this.overlay.setStrokeColor(r)},strokeOpacity(r){this.overlay.setStrokeOpacity(r)},strokeWeight(r){this.overlay.setStrokeWeight(r)},fillColor(r){this.overlay.setFillColor(r)},fillOpacity(r){this.overlay.setFillOpacity(r)},visible(r){this.overlay.setVisible(r)}},onCreate(){this.overlay=this.$map.createRectangle(this),this.$map.addOverlay(this.overlay),J(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:bounds"]&&this.overlay.addEventListener("bounds-changed",()=>{this.$emit("update:bounds",this.emittedBounds=this.overlay.getBounds())})},onDestroy(){this.$map.removeOverlay(this.overlay)}}),Vn=["beforeUpdate","updated"],jn={install(r,t={}){if(t.enable!==!1){const e=M.defineComponent({beforeCreate(){const i=sr()??"",s=(t.nameRegex||/^[A-Z]/).test(i)?l=>{t.hookNames?t.hookNames.includes(l)&&console.debug("[lifecycle]",i,l):Vn.includes(l)||console.debug("[lifecycle]",i,l)}:ve;s("beforeCreate"),this.__life_impl=s},created(){this.__life("created")},beforeMount(){this.__life("beforeMount")},mounted(){this.__life("mounted")},beforeUpdate(){this.__life("beforeUpdate")},updated(){this.__life("updated")},beforeUnmount(){this.__life("beforeUnmount")},unmounted(){this.__life("unmounted")},methods:{__life(i){this.__life_impl(i)}},onCreate(){this.__life("onCreate")},onDestroy(){this.__life("onDestroy")}});r.mixin(e)}}},Fn=6378137;function Se(r){return r*Math.PI/180}function vr(r){return r*180/Math.PI}function Un(r,t){if(r.lat===t.lat&&r.lng===t.lng)return 0;const e=Se((r.lat+t.lat)/2),i=Se((r.lat-t.lat)/2),n=Se((r.lng-t.lng)/2);let s=Math.sin(i),l=Math.sin(n),g=Math.sin(e);const o=Fn,c=1/298.257;s=s*s,l=l*l,g=g*g;const u=s*(1-l)+(1-g)*l,d=(1-s)*(1-l)+g*l,p=Math.atan(Math.sqrt(u/d)),_=Math.sqrt(u*d)/p,y=2*p*o,v=(3*_-1)/2/d,b=(3*_+1)/2/u;return y*(1+c*(v*g*(1-s)-b*(1-g)*s))}function _r(r,t,e){const n=63567523142e-4,s=1/298.257223563,l=Se(t),g=Math.sin(l),o=Math.cos(l),c=(1-s)*Math.tan(Se(r.lat)),u=1/Math.sqrt(1+c*c),d=c*u,p=Math.atan2(c,o),_=u*g,y=1-_*_,v=y*(6378137*6378137-n*n)/(n*n),b=1+v/16384*(4096+v*(-768+v*(320-175*v))),h=v/1024*(256+v*(-128+v*(74-47*v)));let m=0,T=0,C=0,E=e/(n*b),P=2*Math.PI;for(;Math.abs(E-P)>1e-12;){m=Math.cos(2*p+E),T=Math.sin(E),C=Math.cos(E);const Y=h*T*(m+h/4*(C*(-1+2*m*m)-h/6*m*(-3+4*T*T)*(-3+4*m*m)));P=E,E=e/(n*b)+Y}const B=d*T-u*C*o,D=Math.atan2(d*C+u*T*o,(1-s)*Math.sqrt(_*_+B*B)),N=Math.atan2(T*g,u*C-d*T*o),S=s/16*y*(4+s*(4-3*y)),ee=N-(1-S)*s*_*(E+S*T*(m+S*C*(-1+2*m*m)));return{lng:r.lng+vr(ee),lat:vr(D)}}const Yn={getDistance:Un,getDestination:_r};var qn={VITE_APP_DEV_KEY_BAIDU:"",VITE_APP_DEV_KEY_GOOGLE:"",VITE_APP_DEV_KEY_HERE:"",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Kn={install(r,t){if(Ui(t),qn.VITE_FALSE){const i=Object.assign({"./TgMap.vue":fe,"./TgMapWidget.vue":tr,"./controls/TgCustomControl.vue":ir,"./controls/TgMapTypeControl.vue":rr,"./controls/TgScaleControl.vue":nr,"./controls/TgStreetViewControl.vue":or,"./controls/TgZoomControl.vue":ar,"./extra/TgHeatmap.vue":lr,"./extra/TgMarkerClusterer.vue":Qt,"./layers/TgTrafficLayer.vue":hr,"./overlays/TgCircle.vue":cr,"./overlays/TgElementOverlay.vue":dr,"./overlays/TgInfoBox.vue":ur,"./overlays/TgInfoWindow.vue":pr,"./overlays/TgLabel.vue":gr,"./overlays/TgMarker.vue":Ie,"./overlays/TgPolygon.vue":mr,"./overlays/TgPolyline.vue":fr,"./overlays/TgRectangle.vue":yr});Object.keys(i).forEach(n=>{const s=i[n];r.component(s.name??I(`Tg开头的组件必须设置name: ${n}`),s)})}const e=r.config.optionMergeStrategies;e[ge]=e[me]=(i,n)=>i?[...new Set([].concat(i,n))]:Array.isArray(n)?n:[n]}};a.AbstractControl=He,a.AbstractMap=st,a.Autocomplete=Gt,a.BaiduAutocomplete=Mi,a.BaiduCircle=lt,a.BaiduControl=Ve,a.BaiduHeatmap=wi,a.BaiduInfoBoxOverlay=pt,a.BaiduInfoWindow=dt,a.BaiduMapTypeControl=je,a.BaiduMapUrls=it,a.BaiduMarker=pe,a.BaiduMarkerClusterer=Si,a.BaiduOverlay=Ce,a.BaiduPlacesService=Ai,a.BaiduPolyShape=ft,a.BaiduPolygon=_t,a.BaiduPolyline=yt,a.BaiduRectangle=Mt,a.BaiduScaleControl=Ue,a.BaiduSearchBox=Di,a.BaiduStreetViewControl=qe,a.BaiduZoomControl=Xe,a.BuildInMapType=Z,a.BuildInMapTypeId=$t,a.CachedValue=he,a.ControlPosition=k,a.CoordType=R,a.CustomControl=gi,a.ElementOverlay=ji,a.EmptyControl=mi,a.FastFindValues=pi,a.GestureHandlingOptions=K,a.GoogleAutocomplete=bi,a.GoogleCircle=ht,a.GoogleControl=be,a.GoogleHeatmap=Oi,a.GoogleInfoBoxOverlay=gt,a.GoogleInfoWindow=ut,a.GoogleMapTypeControl=Fe,a.GoogleMapUrls=tt,a.GoogleMarker=mt,a.GoogleMarkerClusterer=ki,a.GoogleOverlay=ot,a.GooglePlacesService=xi,a.GooglePolygon=bt,a.GooglePolyline=vt,a.GoogleRectangle=Tt,a.GoogleScaleControl=Ye,a.GoogleSearchBox=Ri,a.GoogleStreetViewControl=Ke,a.GoogleZoomControl=Je,a.Heatmap=Nt,a.ImageMapType=Sr,a.InfoWindow=ct,a.InfoWindowModeValues=Vi,a.KeyValue=Dt,a.LatLng=w,a.LatLngBounds=V,a.LifecycleLogPlugin=jn,a.MIXIN_HOOK_CREATE=ge,a.MIXIN_HOOK_DESTROY=me,a.MIXIN_MAP_NAME=Ot,a.MapMixin=$,a.MapPane=de,a.MapTypeControlType=zt,a.MapUrls=Zt,a.MapZoom=$i,a.MarkerClusterer=Vt,a.Overlay=Ut,a.PlacesService=jt,a.SearchBox=Ft,a.SphericalUtils=Yn,a.SymbolPath=an,a.TgCircle=cr,a.TgCustomControl=ir,a.TgElementOverlay=dr,a.TgHeatmap=lr,a.TgInfoBox=ur,a.TgInfoWindow=pr,a.TgLabel=gr,a.TgMap=fe,a.TgMapType=U,a.TgMapTypeControl=rr,a.TgMapWidget=tr,a.TgMarker=Ie,a.TgMarkerClusterer=Qt,a.TgPolygon=mr,a.TgPolyline=fr,a.TgRectangle=yr,a.TgScaleControl=nr,a.TgStreetViewControl=or,a.TgTrafficLayer=hr,a.TgZoomControl=ar,a.TrafficLayer=fi,a.UnionIcon=Oe,a.callHook=Be,a.computedSaveOnThis=_n,a.createAsyncSingleton=qi,a.createEmptyVNode=Le,a.createPropertyObject=Qi,a.createPropertyObjectTyped=bn,a.debug=pn,a.default=Kn,a.eventProp=x,a.extractVNodeFromSlotsByComponent=Tn,a.findAncestorComponentByType=Ze,a.findByComponentType=Mn,a.getDestination=_r,a.getTgMapConfig=Jt,a.isComponentByType=Ne,a.isEntryValueDef=Yi,a.isInstanceOf=wr,a.loadCachedMap=Ki,a.optionalProp=O,a.requiredProp=G,a.safeAs=Er,a.safeAsComponent=xt,a.setTgMapConfig=Ui,a.splitAttrs=er,a.stringEnumProp=W,a.stringUnionPropFromValues=Ji,a.todo=un,a.unwrapStringEnumValue=Pr,a.useEventLogMethods=Cn,a.useSplittedAttrs=X,a.useTgMapInner=wt,Object.defineProperties(a,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
18
18
|
//# sourceMappingURL=tg-map.umd.cjs.map
|