tg-map-vue3 3.1.9 → 3.2.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/dist/tg-map.js CHANGED
@@ -1,21 +1,21 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode('.baidu-info-box-container{transform:translateY(-11px);font-size:13px;font-weight:300;width:100vw}.baidu-info-box-container__border{position:absolute;padding:12px;background-color:#fff;box-shadow:0 2px 7px 1px #0000004d;border-radius:8px;transform:translate(-50%,-100%)}.baidu-info-box-container__inner{overflow:auto}.baidu-info-box-container__close{position:absolute;right:-6px;top:-6px;width:14px;height:14px;margin:8px;opacity:.6;cursor:pointer}.baidu-info-box-container__close:hover{opacity:1}.baidu-info-box-container:after{position:absolute;background-color:#fff;content:"";width:15px;height:15px;left:0px;top:0px;box-shadow:-2px 2px 2px #b2b2b266;transform:translate(-50%,-50%) rotate(-45deg)}.tg-map{height:100vh;position:relative}.tg-map__map{width:100%;height:100%}.tg-map__map--hide-logo-google .gm-style a[target=_blank]:has(> div > img){display:none!important}.tg-map__map--hide-logo-google .gm-style>div:last-child>div:last-child>div{display:none}.tg-map__map--hide-logo-baidu div.anchorBL>a[target=_blank]>img{display:none}.tg-map__map--hide-logo-baidu div.BMap_cpyCtrl{display:none}.tg-map-widget{position:absolute}.tg-map>.tg-custom-control{display:none}.element-overlay{position:absolute}.tg-map .tg-element-overlay{display:none}.tg-map__map .tg-element-overlay{display:block}.tg-map .tg-info-box{display:none}.tg-map__map .tg-info-box{display:block}.tg-map .tg-label{display:none}.tg-map__map .tg-label{display:block}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- var ir = Object.defineProperty;
3
- var sr = (i, e, t) => e in i ? ir(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
4
- var d = (i, e, t) => (sr(i, typeof e != "symbol" ? e + "" : e, t), t);
5
- import { createCommentVNode as Re, computed as kt, defineComponent as C, markRaw as nr, openBlock as G, createElementBlock as j, mergeProps as le, createElementVNode as or, normalizeClass as Ie, renderSlot as z, normalizeStyle as ar, getCurrentInstance as lr, inject as hr, onMounted as cr, onBeforeUnmount as dr, watch as pr, withDirectives as ur, vShow as gr } from "vue";
2
+ var ar = Object.defineProperty;
3
+ var lr = (i, e, t) => e in i ? ar(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
4
+ var c = (i, e, t) => (lr(i, typeof e != "symbol" ? e + "" : e, t), t);
5
+ import { createCommentVNode as Re, computed as kt, defineComponent as x, markRaw as hr, openBlock as Z, createElementBlock as j, mergeProps as le, createElementVNode as cr, normalizeClass as Ie, renderSlot as z, normalizeStyle as dr, getCurrentInstance as pr, inject as ur, onMounted as gr, onBeforeUnmount as mr, watch as fr, withDirectives as yr, vShow as vr } from "vue";
6
6
  function Y(i, e, t) {
7
7
  Object.keys(i).forEach((r) => {
8
8
  r.startsWith("update:") || t != null && t.includes(r) || e.addEventListener(r, i[r]);
9
9
  });
10
10
  }
11
- let mr = 1;
12
- function fr() {
13
- return mr++;
11
+ let _r = 1;
12
+ function Mr() {
13
+ return _r++;
14
14
  }
15
15
  function Oe(i, e) {
16
- return e.__id__ || (e.__id__ = fr()), `${i}::${e.__id__}`;
16
+ return e.__id__ || (e.__id__ = Mr()), `${i}::${e.__id__}`;
17
17
  }
18
- var Pt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, V = {}, yr = {
18
+ var It = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, V = {}, br = {
19
19
  get exports() {
20
20
  return V;
21
21
  },
@@ -26,10 +26,10 @@ var Pt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
26
26
  (function(i) {
27
27
  (function(e, t) {
28
28
  i.exports ? i.exports = t() : e.coordtransform = t();
29
- })(Pt, function() {
29
+ })(It, function() {
30
30
  var e = 52.35987755982988, t = 3.141592653589793, r = 6378245, s = 0.006693421622965943;
31
- function n(g, m, v, O) {
32
- this.west = Math.min(g, v), this.north = Math.max(m, O), this.east = Math.max(g, v), this.south = Math.min(m, O);
31
+ function n(g, m, v, w) {
32
+ this.west = Math.min(g, v), this.north = Math.max(m, w), this.east = Math.max(g, v), this.south = Math.min(m, w);
33
33
  }
34
34
  n.prototype.contain = function(g, m) {
35
35
  return this.west <= g && this.east >= g && this.north >= m && this.south <= m;
@@ -41,7 +41,7 @@ var Pt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
41
41
  new n(82.9684, 29.5297, 97.0352, 26.7186),
42
42
  new n(97.0253, 29.5297, 124.367395, 20.414096),
43
43
  new n(107.975793, 20.414096, 111.744104, 17.871542)
44
- ], c = [
44
+ ], d = [
45
45
  new n(119.921265, 25.398623, 122.497559, 21.785006),
46
46
  new n(101.8652, 22.284, 106.665, 20.0988),
47
47
  new n(106.4525, 21.5422, 108.051, 20.4878),
@@ -53,36 +53,36 @@ var Pt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
53
53
  function o(g, m) {
54
54
  for (var v = 0; v < a.length; v++)
55
55
  if (a[v].contain(g, m)) {
56
- for (var O = 0; O < c.length; O++)
57
- if (c[O].contain(g, m))
56
+ for (var w = 0; w < d.length; w++)
57
+ if (d[w].contain(g, m))
58
58
  return !1;
59
59
  return !0;
60
60
  }
61
61
  return !1;
62
62
  }
63
63
  function l(g, m) {
64
- var v = g - 65e-4, O = m - 6e-3, E = Math.sqrt(v * v + O * O) - 2e-5 * Math.sin(O * e), w = Math.atan2(O, v) - 3e-6 * Math.cos(v * e), K = E * Math.cos(w), re = E * Math.sin(w);
64
+ var v = g - 65e-4, w = m - 6e-3, E = Math.sqrt(v * v + w * w) - 2e-5 * Math.sin(w * e), O = Math.atan2(w, v) - 3e-6 * Math.cos(v * e), K = E * Math.cos(O), re = E * Math.sin(O);
65
65
  return [K, re];
66
66
  }
67
67
  function h(g, m) {
68
- var v = Math.sqrt(g * g + m * m) + 2e-5 * Math.sin(m * e), O = Math.atan2(m, g) + 3e-6 * Math.cos(g * e), E = v * Math.cos(O) + 65e-4, w = v * Math.sin(O) + 6e-3;
69
- return [E, w];
68
+ var v = Math.sqrt(g * g + m * m) + 2e-5 * Math.sin(m * e), w = Math.atan2(m, g) + 3e-6 * Math.cos(g * e), E = v * Math.cos(w) + 65e-4, O = v * Math.sin(w) + 6e-3;
69
+ return [E, O];
70
70
  }
71
- function u(g, m) {
71
+ function p(g, m) {
72
72
  return o(g, m) ? M(g, m) : [g, m];
73
73
  }
74
- function p(g, m) {
74
+ function u(g, m) {
75
75
  if (!o(g, m))
76
76
  return [g, m];
77
77
  var v = M(g, m);
78
78
  return [g * 2 - v[0], m * 2 - v[1]];
79
79
  }
80
80
  function M(g, m) {
81
- var v = b(g - 105, m - 35), O = _(g - 105, m - 35), E = m / 180 * t, w = Math.sin(E);
82
- w = 1 - s * w * w;
83
- var K = Math.sqrt(w);
84
- v = v * 180 / (r * (1 - s) / (w * K) * t), O = O * 180 / (r / K * Math.cos(E) * t);
85
- var re = m + v, Se = g + O;
81
+ var v = b(g - 105, m - 35), w = _(g - 105, m - 35), E = m / 180 * t, O = Math.sin(E);
82
+ O = 1 - s * O * O;
83
+ var K = Math.sqrt(O);
84
+ v = v * 180 / (r * (1 - s) / (O * K) * t), w = w * 180 / (r / K * Math.cos(E) * t);
85
+ var re = m + v, Se = g + w;
86
86
  return [Se, re];
87
87
  }
88
88
  function b(g, m) {
@@ -97,28 +97,28 @@ var Pt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
97
97
  // 向前兼容
98
98
  bd09togcj02: l,
99
99
  gcj02tobd09: h,
100
- wgs84togcj02: u,
101
- gcj02towgs84: p,
100
+ wgs84togcj02: p,
101
+ gcj02towgs84: u,
102
102
  // 小驼峰命名风格
103
103
  bd09ToGcj02: l,
104
104
  gcj02ToBd09: h,
105
- wgs84ToGcj02: u,
106
- gcj02ToWgs84: p,
105
+ wgs84ToGcj02: p,
106
+ gcj02ToWgs84: u,
107
107
  bd09ToWgs84: function(g, m) {
108
108
  if (!o(g, m))
109
109
  return [g, m];
110
110
  var v = l(g, m);
111
- return p(v[0], v[1]);
111
+ return u(v[0], v[1]);
112
112
  },
113
113
  wgs84ToBd09: function(g, m) {
114
114
  if (!o(g, m))
115
115
  return [g, m];
116
- var v = u(g, m);
116
+ var v = p(g, m);
117
117
  return h(v[0], v[1]);
118
118
  }
119
119
  };
120
120
  });
121
- })(yr);
121
+ })(br);
122
122
  function pe(i, e) {
123
123
  if (!i)
124
124
  throw new Error(`AssertionError: ${e}`);
@@ -126,21 +126,21 @@ function pe(i, e) {
126
126
  function De(i) {
127
127
  throw new Error(`Unexpected object: ${i}`);
128
128
  }
129
- function x(i) {
129
+ function C(i) {
130
130
  throw new Error(i);
131
131
  }
132
- function It(i) {
132
+ function Bt(i) {
133
133
  throw new Error(`Unsupported: ${i}`);
134
134
  }
135
- function Hi(i) {
135
+ function Ki(i) {
136
136
  throw new Error(`todo: ${i}`);
137
137
  }
138
- function Fi(i) {
138
+ function Xi(i) {
139
139
  return i;
140
140
  }
141
- function we(...i) {
141
+ function ge(...i) {
142
142
  }
143
- function Ui(i) {
143
+ function Ji(i) {
144
144
  return i != null;
145
145
  }
146
146
  var Q = /* @__PURE__ */ ((i) => (i.wgs84 = "wgs84", i.gcj02 = "gcj02", i.bd09 = "bd09", i))(Q || {});
@@ -213,7 +213,7 @@ const $e = "wgs84", A = class {
213
213
  }
214
214
  };
215
215
  let y = A;
216
- d(y, "ZERO", A.create(0, 0));
216
+ c(y, "ZERO", A.create(0, 0));
217
217
  const J = class {
218
218
  /**
219
219
  * 不推荐直接创建LatLngBounds, sw和ne的大小关系可能没法保证, 推荐用LatLngBounds.Builder或者LatLngBounds.from等静态方法来创建
@@ -221,7 +221,7 @@ const J = class {
221
221
  * @param ne 东北, lat/lng更大
222
222
  */
223
223
  constructor(e, t) {
224
- d(this, "coord");
224
+ c(this, "coord");
225
225
  this.sw = e, this.ne = t, pe(e.coord === t.coord, "sw和ne的coord应该相同"), pe(Number.isFinite(e.lat) && Number.isFinite(e.lng) && Number.isFinite(t.lat) && Number.isFinite(t.lng), `sw(${e})和ne(${t})不能包含NaN或Infinite`), pe(e.lat <= t.lat, `sw.lat(${e.lat})应该比ne.lat(${t.lat})小`), this.coord = e.coord;
226
226
  }
227
227
  static isBetweenLng(e, t, r) {
@@ -236,7 +236,7 @@ const J = class {
236
236
  return t.build();
237
237
  }
238
238
  static from(...e) {
239
- return this.fromArray(e) ?? x("positions中没有点");
239
+ return this.fromArray(e) ?? C("positions中没有点");
240
240
  }
241
241
  static fromGoogle(e, t) {
242
242
  return new J(
@@ -281,15 +281,15 @@ const J = class {
281
281
  }
282
282
  };
283
283
  let F = J;
284
- d(F, "EMPTY", new J(y.ZERO, y.ZERO));
284
+ c(F, "EMPTY", new J(y.ZERO, y.ZERO));
285
285
  ((i) => {
286
286
  class e {
287
287
  constructor(r) {
288
- d(this, "coord");
289
- d(this, "minLat");
290
- d(this, "minLng");
291
- d(this, "maxLat");
292
- d(this, "maxLng");
288
+ c(this, "coord");
289
+ c(this, "minLat");
290
+ c(this, "minLng");
291
+ c(this, "maxLat");
292
+ c(this, "maxLng");
293
293
  this.coord = r.coord, this.minLat = this.maxLat = r.lat, this.minLng = this.maxLng = r.lng;
294
294
  }
295
295
  build() {
@@ -310,67 +310,67 @@ d(F, "EMPTY", new J(y.ZERO, y.ZERO));
310
310
  }
311
311
  i.Builder = e;
312
312
  })(F || (F = {}));
313
- var vr = function(e) {
314
- return _r(e) && !Mr(e);
313
+ var Tr = function(e) {
314
+ return wr(e) && !Or(e);
315
315
  };
316
- function _r(i) {
316
+ function wr(i) {
317
317
  return !!i && typeof i == "object";
318
318
  }
319
- function Mr(i) {
319
+ function Or(i) {
320
320
  var e = Object.prototype.toString.call(i);
321
- return e === "[object RegExp]" || e === "[object Date]" || Or(i);
321
+ return e === "[object RegExp]" || e === "[object Date]" || Er(i);
322
322
  }
323
- var br = typeof Symbol == "function" && Symbol.for, Tr = br ? Symbol.for("react.element") : 60103;
324
- function Or(i) {
325
- return i.$$typeof === Tr;
323
+ var Cr = typeof Symbol == "function" && Symbol.for, xr = Cr ? Symbol.for("react.element") : 60103;
324
+ function Er(i) {
325
+ return i.$$typeof === xr;
326
326
  }
327
- function wr(i) {
327
+ function Lr(i) {
328
328
  return Array.isArray(i) ? [] : {};
329
329
  }
330
- function ge(i, e) {
331
- return e.clone !== !1 && e.isMergeableObject(i) ? ne(wr(i), i, e) : i;
330
+ function me(i, e) {
331
+ return e.clone !== !1 && e.isMergeableObject(i) ? ne(Lr(i), i, e) : i;
332
332
  }
333
- function Cr(i, e, t) {
333
+ function Pr(i, e, t) {
334
334
  return i.concat(e).map(function(r) {
335
- return ge(r, t);
335
+ return me(r, t);
336
336
  });
337
337
  }
338
- function xr(i, e) {
338
+ function kr(i, e) {
339
339
  if (!e.customMerge)
340
340
  return ne;
341
341
  var t = e.customMerge(i);
342
342
  return typeof t == "function" ? t : ne;
343
343
  }
344
- function Er(i) {
344
+ function Ir(i) {
345
345
  return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(i).filter(function(e) {
346
346
  return Object.propertyIsEnumerable.call(i, e);
347
347
  }) : [];
348
348
  }
349
349
  function bt(i) {
350
- return Object.keys(i).concat(Er(i));
350
+ return Object.keys(i).concat(Ir(i));
351
351
  }
352
- function Bt(i, e) {
352
+ function St(i, e) {
353
353
  try {
354
354
  return e in i;
355
355
  } catch {
356
356
  return !1;
357
357
  }
358
358
  }
359
- function Lr(i, e) {
360
- return Bt(i, e) && !(Object.hasOwnProperty.call(i, e) && Object.propertyIsEnumerable.call(i, e));
359
+ function Br(i, e) {
360
+ return St(i, e) && !(Object.hasOwnProperty.call(i, e) && Object.propertyIsEnumerable.call(i, e));
361
361
  }
362
- function kr(i, e, t) {
362
+ function Sr(i, e, t) {
363
363
  var r = {};
364
364
  return t.isMergeableObject(i) && bt(i).forEach(function(s) {
365
- r[s] = ge(i[s], t);
365
+ r[s] = me(i[s], t);
366
366
  }), bt(e).forEach(function(s) {
367
- Lr(i, s) || (Bt(i, s) && t.isMergeableObject(e[s]) ? r[s] = xr(s, t)(i[s], e[s], t) : r[s] = ge(e[s], t));
367
+ Br(i, s) || (St(i, s) && t.isMergeableObject(e[s]) ? r[s] = kr(s, t)(i[s], e[s], t) : r[s] = me(e[s], t));
368
368
  }), r;
369
369
  }
370
370
  function ne(i, e, t) {
371
- t = t || {}, t.arrayMerge = t.arrayMerge || Cr, t.isMergeableObject = t.isMergeableObject || vr, t.cloneUnlessOtherwiseSpecified = ge;
371
+ t = t || {}, t.arrayMerge = t.arrayMerge || Pr, t.isMergeableObject = t.isMergeableObject || Tr, t.cloneUnlessOtherwiseSpecified = me;
372
372
  var r = Array.isArray(e), s = Array.isArray(i), n = r === s;
373
- return n ? r ? t.arrayMerge(i, e, t) : kr(i, e, t) : ge(e, t);
373
+ return n ? r ? t.arrayMerge(i, e, t) : Sr(i, e, t) : me(e, t);
374
374
  }
375
375
  ne.all = function(e, t) {
376
376
  if (!Array.isArray(e))
@@ -379,8 +379,8 @@ ne.all = function(e, t) {
379
379
  return ne(r, s, t);
380
380
  }, {});
381
381
  };
382
- var Pr = ne, St = Pr;
383
- const Ce = ["3.0"], Ir = {
382
+ var Ar = ne, At = Ar;
383
+ const Ce = ["3.0"], $r = {
384
384
  baidu: {
385
385
  version: "3.0",
386
386
  // 在build时会被静态替换, 导致使用者不能无法设置它
@@ -399,20 +399,20 @@ const Ce = ["3.0"], Ir = {
399
399
  key: {}.VITE_APP_DEV_KEY_HERE
400
400
  }
401
401
  };
402
- let At;
403
- function $t() {
404
- return At || x("请先安装: Vue<PartialTgMapConfig>.use(TgMap, {})");
402
+ let $t;
403
+ function zt() {
404
+ return $t || C("请先安装: Vue<PartialTgMapConfig>.use(TgMap, {})");
405
405
  }
406
- function Br(i) {
407
- i != null && (At = St(Ir, i));
406
+ function zr(i) {
407
+ i != null && ($t = At($r, i));
408
408
  }
409
- var Ze;
409
+ var Ge;
410
410
  ((i) => {
411
411
  function e(t) {
412
412
  return t.scrollWidth > t.clientWidth || t.scrollHeight > t.clientHeight;
413
413
  }
414
414
  i.isScrollable = e;
415
- })(Ze || (Ze = {}));
415
+ })(Ge || (Ge = {}));
416
416
  var xe;
417
417
  ((i) => {
418
418
  function e(r, s) {
@@ -445,45 +445,48 @@ var Ee;
445
445
  }
446
446
  i.remove = t;
447
447
  })(Ee || (Ee = {}));
448
- function Yi() {
448
+ function Qi() {
449
449
  }
450
- function Ge(i) {
450
+ function Ze(i) {
451
451
  return i;
452
452
  }
453
- function qi(i, e) {
453
+ function es(i, e) {
454
454
  return i instanceof e;
455
455
  }
456
- function Ki(i, e) {
456
+ function ts(i, e) {
457
457
  if (i instanceof e)
458
458
  return i;
459
459
  }
460
- function _e(i, e) {
460
+ function Me(i, e) {
461
461
  if ((i == null ? void 0 : i.$options.name) === e.name)
462
462
  return i;
463
463
  }
464
- function Xi(i) {
464
+ function rs(i) {
465
465
  return i;
466
466
  }
467
- function Sr(i, e, t) {
467
+ function Nt(i, e, t) {
468
468
  return i.addListener(e, t).remove;
469
469
  }
470
- function Ar(i, e, t) {
470
+ function Nr(i, e, t) {
471
471
  return i.addEventListener(e, t), () => i.removeEventListener(e, t);
472
472
  }
473
- function $r(i, e, t, r) {
473
+ function Rr(i, e, t, r) {
474
474
  return i.addEventListener(e, t, r), () => i.removeEventListener(e, t, r);
475
475
  }
476
- class zt {
476
+ function Tt(i, e, t) {
477
+ return i.addEventListener(e, t), () => i.removeEventListener(e, t);
478
+ }
479
+ class Rt {
477
480
  constructor(e, t) {
478
- d(this, "eventMap", /* @__PURE__ */ new Map());
479
- d(this, "target", void 0);
481
+ c(this, "eventMap", /* @__PURE__ */ new Map());
482
+ c(this, "target", void 0);
480
483
  this.inner = e, this.coordTypeSupplier = t, this.addEventListener = this.addEventListener.bind(this), this.removeEventListener = this.removeEventListener.bind(this);
481
484
  }
482
485
  setTarget(e) {
483
486
  return this.target = e, this;
484
487
  }
485
488
  }
486
- const Mt = class extends zt {
489
+ const Mt = class extends Rt {
487
490
  addEventListener(e, t) {
488
491
  const r = Oe(e, t);
489
492
  if (this.eventMap.get(r)) {
@@ -507,7 +510,7 @@ const Mt = class extends zt {
507
510
  };
508
511
  let ee = Mt;
509
512
  // 事件类型映射: tg => google
510
- d(ee, "EVENT_TYPE_MAP", {
513
+ c(ee, "EVENT_TYPE_MAP", {
511
514
  "center-changed": "center_changed",
512
515
  "zoom-changed": "zoom_changed",
513
516
  "map-type-changed": "maptypeid_changed",
@@ -518,7 +521,7 @@ d(ee, "EVENT_TYPE_MAP", {
518
521
  "map-mouseup": "mouseup",
519
522
  "map-dblclick": "dblclick"
520
523
  });
521
- const Pe = class extends zt {
524
+ const ke = class extends Rt {
522
525
  addEventListener(e, t) {
523
526
  const r = Oe(e, t);
524
527
  if (this.eventMap.get(r)) {
@@ -533,25 +536,25 @@ const Pe = class extends zt {
533
536
  };
534
537
  n.point && (a.position = y.fromBaidu(n.point, this.coordTypeSupplier.coordType)), t.call(this.target, a);
535
538
  };
536
- this.inner.addEventListener(Pe.EVENT_TYPE_MAP[e] || e, s), this.eventMap.set(r, s);
539
+ this.inner.addEventListener(ke.EVENT_TYPE_MAP[e] || e, s), this.eventMap.set(r, s);
537
540
  }
538
541
  removeEventListener(e, t) {
539
542
  const r = Oe(e, t), s = this.eventMap.get(r);
540
- s ? (this.inner.removeEventListener(Pe.EVENT_TYPE_MAP[e] || e, s), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, t);
543
+ s ? (this.inner.removeEventListener(ke.EVENT_TYPE_MAP[e] || e, s), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, t);
541
544
  }
542
545
  };
543
- let se = Pe;
546
+ let se = ke;
544
547
  // cSpell:words clickclose
545
548
  // 事件类型映射, tg => baidu
546
- d(se, "EVENT_TYPE_MAP", {
549
+ c(se, "EVENT_TYPE_MAP", {
547
550
  drag: "dragging",
548
551
  closeclick: "clickclose",
549
552
  "zoom-changed": "zoomend",
550
553
  "map-type-changed": "maptypechange"
551
554
  });
552
- class zr {
555
+ class Dr {
553
556
  constructor() {
554
- d(this, "typeMap", /* @__PURE__ */ new Map());
557
+ c(this, "typeMap", /* @__PURE__ */ new Map());
555
558
  }
556
559
  addEventListener(e, t) {
557
560
  let r = this.typeMap.get(e);
@@ -570,27 +573,27 @@ class zr {
570
573
  t && t.forEach((r) => r.call(e.target, e));
571
574
  }
572
575
  }
573
- class Tt {
576
+ class wt {
574
577
  /**
575
578
  * `keys`和`values`数组中可以有相同的值, 若存在相同值, 则index越小的优先级越高
576
579
  */
577
580
  constructor(e, t) {
578
- d(this, "keyToValue", /* @__PURE__ */ new Map());
579
- d(this, "valueToKey", /* @__PURE__ */ new Map());
581
+ c(this, "keyToValue", /* @__PURE__ */ new Map());
582
+ c(this, "valueToKey", /* @__PURE__ */ new Map());
580
583
  pe(e.length === t.length);
581
584
  for (let r = e.length - 1; r >= 0; r--)
582
585
  this.keyToValue.set(e[r], t[r]), this.valueToKey.set(t[r], e[r]);
583
586
  }
584
587
  toKey(e) {
585
- return this.valueToKey.get(e) ?? x();
588
+ return this.valueToKey.get(e) ?? C();
586
589
  }
587
590
  toValue(e) {
588
- return this.keyToValue.get(e) ?? x();
591
+ return this.keyToValue.get(e) ?? C();
589
592
  }
590
593
  }
591
- class Nr {
594
+ class Gr {
592
595
  constructor(e, t = 10) {
593
- d(this, "map", /* @__PURE__ */ new Map());
596
+ c(this, "map", /* @__PURE__ */ new Map());
594
597
  this.values = e, this.maxSize4Debug = t;
595
598
  }
596
599
  /** 获取保存key-value映射的Map */
@@ -614,19 +617,19 @@ class Nr {
614
617
  return this.getValueMap(e).get(t);
615
618
  }
616
619
  get(e, t) {
617
- return this.getOrNull(e, t) ?? x(`key(${t})不存在与valueMap(${this.getValueMap(e)})中`);
620
+ return this.getOrNull(e, t) ?? C(`key(${t})不存在与valueMap(${this.getValueMap(e)})中`);
618
621
  }
619
622
  }
620
623
  class Ot {
621
624
  constructor(e) {
622
- d(this, "value");
625
+ c(this, "value");
623
626
  this.creator = e;
624
627
  }
625
628
  get() {
626
629
  return this.value === void 0 && (this.value = this.creator()), this.value;
627
630
  }
628
631
  }
629
- var k = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-center", i.TOP_RIGHT = "top-right", i.BOTTOM_LEFT = "bottom-left", i.BOTTOM_CENTER = "bottom-center", i.BOTTOM_RIGHT = "bottom-right", i.LEFT_TOP = "left-top", i.LEFT_CENTER = "left-center", i.LEFT_BOTTOM = "left-bottom", i.RIGHT_TOP = "right-top", i.RIGHT_CENTER = "right-center", i.RIGHT_BOTTOM = "right-bottom", i))(k || {}), B;
632
+ var P = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-center", i.TOP_RIGHT = "top-right", i.BOTTOM_LEFT = "bottom-left", i.BOTTOM_CENTER = "bottom-center", i.BOTTOM_RIGHT = "bottom-right", i.LEFT_TOP = "left-top", i.LEFT_CENTER = "left-center", i.LEFT_BOTTOM = "left-bottom", i.RIGHT_TOP = "right-top", i.RIGHT_CENTER = "right-center", i.RIGHT_BOTTOM = "right-bottom", i))(P || {}), B;
630
633
  ((i) => {
631
634
  let e, t;
632
635
  const r = [
@@ -645,7 +648,7 @@ var k = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
645
648
  /* RIGHT_BOTTOM */
646
649
  ];
647
650
  function s() {
648
- return e || (e = new Tt(r, [
651
+ return e || (e = new wt(r, [
649
652
  /* | @tg/map |名字相同| baidu | */
650
653
  /* TOP_LEFT = */
651
654
  BMAP_ANCHOR_TOP_LEFT,
@@ -675,7 +678,7 @@ var k = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
675
678
  }
676
679
  i.getBaidu = s;
677
680
  function n() {
678
- return t || (t = new Tt(r, [
681
+ return t || (t = new wt(r, [
679
682
  google.maps.ControlPosition.TOP_LEFT,
680
683
  google.maps.ControlPosition.TOP_CENTER,
681
684
  google.maps.ControlPosition.TOP_RIGHT,
@@ -692,16 +695,16 @@ var k = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
692
695
  }
693
696
  i.getGoogle = n;
694
697
  })(B || (B = {}));
695
- class Rr {
698
+ class Zr {
696
699
  constructor(e) {
697
700
  /** 实际添加到地图中的control对象 */
698
- d(this, "inner");
701
+ c(this, "inner");
699
702
  this.position = e;
700
703
  }
701
704
  }
702
- class Nt {
705
+ class Dt {
703
706
  }
704
- class Fe extends Nt {
707
+ class Fe extends Dt {
705
708
  constructor(e, t) {
706
709
  super(), this.inner = e, this.position = t;
707
710
  }
@@ -724,11 +727,11 @@ class Fe extends Nt {
724
727
  e.innerMap.removeControl(this.inner);
725
728
  }
726
729
  }
727
- class Ue extends Nt {
730
+ class Ue extends Dt {
728
731
  constructor(t, r) {
729
732
  super();
730
- d(this, "visible", !1);
731
- d(this, "map");
733
+ c(this, "visible", !1);
734
+ c(this, "map");
732
735
  this._type = t, this.position = r;
733
736
  }
734
737
  isVisible() {
@@ -761,8 +764,8 @@ class Ue extends Nt {
761
764
  });
762
765
  }
763
766
  }
764
- var Rt = /* @__PURE__ */ ((i) => (i.normal = "normal", i.satellite = "satellite", i.hybrid = "hybrid", i))(Rt || {});
765
- class P {
767
+ var Gt = /* @__PURE__ */ ((i) => (i.normal = "normal", i.satellite = "satellite", i.hybrid = "hybrid", i))(Gt || {});
768
+ class k {
766
769
  constructor(e, t, r, s) {
767
770
  this.id = e, this.baidu = t, this.google = r, this.googleCoordType = s;
768
771
  }
@@ -783,13 +786,13 @@ class P {
783
786
  return this.google();
784
787
  }
785
788
  asGoogleMapType() {
786
- It("google的内置地图没有对应的实例");
789
+ Bt("google的内置地图没有对应的实例");
787
790
  }
788
791
  }
789
- class Dr {
792
+ class jr {
790
793
  constructor() {
791
- d(this, "baiduCache", new Ot(() => new BMap.TrafficLayer()));
792
- d(this, "googleCache", new Ot(() => new google.maps.TrafficLayer()));
794
+ c(this, "baiduCache", new Ot(() => new BMap.TrafficLayer()));
795
+ c(this, "googleCache", new Ot(() => new google.maps.TrafficLayer()));
793
796
  }
794
797
  asBaiduLayer() {
795
798
  return this.baiduCache.get();
@@ -800,19 +803,19 @@ class Dr {
800
803
  }
801
804
  var I;
802
805
  ((i) => {
803
- i.NORMAL = new P("normal", () => BMAP_NORMAL_MAP, () => google.maps.MapTypeId.ROADMAP, Q.gcj02), i.SATELLITE = new P("satellite", () => BMAP_SATELLITE_MAP, () => google.maps.MapTypeId.SATELLITE, Q.wgs84), i.HYBRID = new P("hybrid", () => BMAP_HYBRID_MAP, () => google.maps.MapTypeId.HYBRID, Q.gcj02), i.TERRAIN = new P("terrain", () => (
806
+ i.NORMAL = new k("normal", () => BMAP_NORMAL_MAP, () => google.maps.MapTypeId.ROADMAP, Q.gcj02), i.SATELLITE = new k("satellite", () => BMAP_SATELLITE_MAP, () => google.maps.MapTypeId.SATELLITE, Q.wgs84), i.HYBRID = new k("hybrid", () => BMAP_HYBRID_MAP, () => google.maps.MapTypeId.HYBRID, Q.gcj02), i.TERRAIN = new k("terrain", () => (
804
807
  /* 三维 */
805
808
  BMAP_PERSPECTIVE_MAP
806
809
  ), () => (
807
810
  /* 地形 */
808
811
  google.maps.MapTypeId.TERRAIN
809
- ), Q.wgs84), i.BUILD_IN_MAP_TYPES = new Nr([i.NORMAL, i.SATELLITE, i.HYBRID, i.TERRAIN]);
812
+ ), Q.wgs84), i.BUILD_IN_MAP_TYPES = new Gr([i.NORMAL, i.SATELLITE, i.HYBRID, i.TERRAIN]);
810
813
  })(I || (I = {}));
811
- var Dt = /* @__PURE__ */ ((i) => (i.DEFAULT = "default", i.HORIZONTAL = "horizontal", i.DROPDOWN = "dropdown", i))(Dt || {});
812
- const Zt = [I.NORMAL, I.SATELLITE, I.HYBRID];
814
+ var Zt = /* @__PURE__ */ ((i) => (i.DEFAULT = "default", i.HORIZONTAL = "horizontal", i.DROPDOWN = "dropdown", i))(Zt || {});
815
+ const jt = [I.NORMAL, I.SATELLITE, I.HYBRID];
813
816
  class Ye extends Fe {
814
817
  static create(e) {
815
- const t = e.mapTypes ?? Zt, r = {
818
+ const t = e.mapTypes ?? jt, r = {
816
819
  default: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
817
820
  horizontal: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
818
821
  dropdown: BMAP_MAPTYPE_CONTROL_DROPDOWN
@@ -824,7 +827,7 @@ class Ye extends Fe {
824
827
  }
825
828
  }
826
829
  const ie = class extends Ue {
827
- constructor(e = "default", t = k.TOP_LEFT, r = Zt) {
830
+ constructor(e = "default", t = P.TOP_LEFT, r = jt) {
828
831
  super("mapType", t), this.type = e, this.mapTypes = r, ie.type2google || (ie.type2google = {
829
832
  default: google.maps.MapTypeControlStyle.DEFAULT,
830
833
  horizontal: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
@@ -836,16 +839,16 @@ const ie = class extends Ue {
836
839
  }
837
840
  onCreateOptions() {
838
841
  const e = super.onCreateOptions();
839
- return e.style = ie.type2google[this.type], e.mapTypeIds = this.mapTypes.map((t) => t instanceof P ? t.getGoogleMapTypeId() : t.id), e;
842
+ return e.style = ie.type2google[this.type], e.mapTypeIds = this.mapTypes.map((t) => t instanceof k ? t.getGoogleMapTypeId() : t.id), e;
840
843
  }
841
844
  addTo(e) {
842
845
  super.addTo(e), this.mapTypes.forEach((t) => {
843
- t instanceof P || e.innerMap.mapTypes.set(t.id, t.asGoogleMapType());
846
+ t instanceof k || e.innerMap.mapTypes.set(t.id, t.asGoogleMapType());
844
847
  });
845
848
  }
846
849
  };
847
- let Te = ie;
848
- d(Te, "type2google");
850
+ let we = ie;
851
+ c(we, "type2google");
849
852
  class qe extends Fe {
850
853
  static create(e) {
851
854
  const t = new BMap.ScaleControl({
@@ -858,7 +861,7 @@ class Ke extends Ue {
858
861
  static create(e) {
859
862
  return new Ke(e.position);
860
863
  }
861
- constructor(e = k.BOTTOM_RIGHT) {
864
+ constructor(e = P.BOTTOM_RIGHT) {
862
865
  super("scale", e);
863
866
  }
864
867
  }
@@ -876,29 +879,29 @@ class Je extends Ue {
876
879
  static create(e) {
877
880
  return new Je(e.position);
878
881
  }
879
- constructor(e = k.RIGHT_BOTTOM) {
882
+ constructor(e = P.RIGHT_BOTTOM) {
880
883
  super("zoom", e);
881
884
  }
882
885
  }
883
- function Zr(i) {
886
+ function Wr(i) {
884
887
  let e, t, r;
885
- const s = "The Google Maps JavaScript API", n = "google", a = "importLibrary", c = "__ib__", o = document, l = window, h = l[n] || (l[n] = {}), u = h.maps || (h.maps = {}), p = /* @__PURE__ */ new Set(), M = new URLSearchParams(), b = () => e || (e = new Promise(async (_, g) => {
888
+ const s = "The Google Maps JavaScript API", n = "google", a = "importLibrary", d = "__ib__", o = document, l = window, h = l[n] || (l[n] = {}), p = h.maps || (h.maps = {}), u = /* @__PURE__ */ new Set(), M = new URLSearchParams(), b = () => e || (e = new Promise(async (_, g) => {
886
889
  var m;
887
- await (t = o.createElement("script")), M.set("libraries", [...p] + "");
890
+ await (t = o.createElement("script")), M.set("libraries", [...u] + "");
888
891
  for (r in i)
889
892
  M.set(r.replace(/[A-Z]/g, (v) => "_" + v[0].toLowerCase()), i[r]);
890
- M.set("callback", n + ".maps." + c), t.src = `https://maps.${n}apis.com/maps/api/js?` + M, u[c] = _, t.onerror = () => e = g(Error(s + " could not load.")), t.nonce = ((m = o.querySelector("script[nonce]")) == null ? void 0 : m.nonce) || "", o.head.append(t);
893
+ M.set("callback", n + ".maps." + d), t.src = `https://maps.${n}apis.com/maps/api/js?` + M, p[d] = _, t.onerror = () => e = g(Error(s + " could not load.")), t.nonce = ((m = o.querySelector("script[nonce]")) == null ? void 0 : m.nonce) || "", o.head.append(t);
891
894
  }));
892
- u[a] ? console.warn(s + " only loads once. Ignoring:", i) : u[a] = (_, ...g) => p.add(_) && b().then(() => u[a](_, ...g));
895
+ p[a] ? console.warn(s + " only loads once. Ignoring:", i) : p[a] = (_, ...g) => u.add(_) && b().then(() => p[a](_, ...g));
893
896
  }
894
- let wt;
897
+ let Ct;
895
898
  const te = {
896
899
  /** Google的坐标0点 */
897
900
  get LATLNG_ZERO() {
898
- return wt ?? (wt = new google.maps.LatLng({ lat: 0, lng: 0 }));
901
+ return Ct ?? (Ct = new google.maps.LatLng({ lat: 0, lng: 0 }));
899
902
  }
900
903
  };
901
- function Gt(i, e = { country: "", province: "", city: "", district: "", street: "", streetNumber: "" }) {
904
+ function Wt(i, e = { country: "", province: "", city: "", district: "", street: "", streetNumber: "" }) {
902
905
  for (const t of i)
903
906
  for (const r of t.types)
904
907
  switch (r) {
@@ -923,16 +926,26 @@ function Gt(i, e = { country: "", province: "", city: "", district: "", street:
923
926
  }
924
927
  return e;
925
928
  }
926
- class jt {
927
- constructor(e) {
928
- this.map = e;
929
- }
929
+ function Vt(i, e) {
930
+ var r;
931
+ const t = i.address_components && Wt(i.address_components);
932
+ return {
933
+ country: (t == null ? void 0 : t.country) ?? "",
934
+ province: (t == null ? void 0 : t.province) ?? "",
935
+ city: (t == null ? void 0 : t.city) ?? "",
936
+ id: i.place_id ?? "",
937
+ address: i.formatted_address ?? "",
938
+ position: y.fromGoogle(((r = i.geometry) == null ? void 0 : r.location) ?? te.LATLNG_ZERO, e.coordType),
939
+ title: i.name ?? ""
940
+ };
941
+ }
942
+ class Ht {
930
943
  }
931
- class Gr extends jt {
944
+ class Vr extends Ht {
932
945
  constructor(t, r) {
933
- super(t);
934
- d(this, "inner");
935
- this.inner = new google.maps.places.Autocomplete(r.input, {
946
+ super();
947
+ c(this, "inner");
948
+ this.map = t, this.inner = new google.maps.places.Autocomplete(r.input, {
936
949
  fields: [
937
950
  "address_components",
938
951
  // 'formatted_address',
@@ -940,8 +953,11 @@ class Gr extends jt {
940
953
  ]
941
954
  }), r.bindToMap && this.inner.bindTo("bounds", t.innerMap);
942
955
  }
956
+ setBounds(t) {
957
+ this.inner.setBounds(t.toGoogle(this.map.coordType));
958
+ }
943
959
  addResultListener(t) {
944
- return Sr(this.inner, "place_changed", () => {
960
+ return Nt(this.inner, "place_changed", () => {
945
961
  const r = this.inner.getPlace(), s = {
946
962
  title: r.name ?? "",
947
963
  province: "",
@@ -951,30 +967,40 @@ class Gr extends jt {
951
967
  streetNumber: "",
952
968
  country: ""
953
969
  };
954
- r.address_components && Gt(r.address_components, s), t(s);
970
+ r.address_components && Wt(r.address_components, s), t(s);
955
971
  });
956
972
  }
957
973
  }
958
- class jr extends jt {
974
+ class Hr extends Ht {
959
975
  constructor(t, r) {
960
- super(t);
961
- d(this, "inner");
962
- d(this, "input");
963
- this.input = r.input, this.inner = new BMap.Autocomplete({
976
+ super();
977
+ c(this, "inner");
978
+ c(this, "input");
979
+ // TODO: 要不要添加个移除监听的方法?
980
+ c(this, "removeableArray", []);
981
+ if (this.map = t, this.input = r.input, this.inner = new BMap.Autocomplete({
964
982
  input: r.input,
965
983
  location: r.bindToMap ? t.innerMap : void 0
966
- });
984
+ }), r.bindToMap) {
985
+ const s = () => {
986
+ this.inner.setLocation(this.map.innerMap);
987
+ };
988
+ this.removeableArray.push(Tt(this.map, "center-changed", s)), this.removeableArray.push(Tt(this.map, "zoom-changed", s));
989
+ }
990
+ }
991
+ setBounds(t) {
992
+ this.inner.setLocation(t.getCenter().toBaidu(this.map.coordType));
967
993
  }
968
994
  addResultListener(t) {
969
995
  let r = 0;
970
- const s = Ar(this.inner, "confirm", (a) => {
971
- const c = a.item.value;
996
+ const s = Nr(this.inner, "confirm", (a) => {
997
+ const d = a.item.value;
972
998
  r = Date.now(), t(Object.assign({
973
- title: c.business,
999
+ title: d.business,
974
1000
  country: ""
975
1001
  // Baidu的自动完成只支持中国
976
- }, c));
977
- }), n = $r(this.input, "keyup", (a) => {
1002
+ }, d));
1003
+ }), n = Rr(this.input, "keyup", (a) => {
978
1004
  a.key === "Enter" && Date.now() - r > 100 && t({
979
1005
  title: this.input.value,
980
1006
  country: "",
@@ -990,18 +1016,18 @@ class jr extends jt {
990
1016
  };
991
1017
  }
992
1018
  }
993
- let Wr = class Wt {
1019
+ let Fr = class Ft {
994
1020
  constructor(e, t, r) {
995
- this.extend(Wt, google.maps.OverlayView), this.map_ = e, this.MARKER_CLUSTER_IMAGE_PATH_ = "../images/m", this.MARKER_CLUSTER_IMAGE_EXTENSION_ = "png", this.markers_ = [], this.clusters_ = [], this.sizes = [53, 56, 66, 78, 90], this.styles_ = [], this.ready_ = !1;
1021
+ this.extend(Ft, google.maps.OverlayView), this.map_ = e, this.MARKER_CLUSTER_IMAGE_PATH_ = "../images/m", this.MARKER_CLUSTER_IMAGE_EXTENSION_ = "png", this.markers_ = [], this.clusters_ = [], this.sizes = [53, 56, 66, 78, 90], this.styles_ = [], this.ready_ = !1;
996
1022
  var s = r || {};
997
1023
  this.zIndex_ = s.zIndex || google.maps.Marker.MAX_ZINDEX + 1, this.gridSize_ = s.gridSize || 60, this.minClusterSize_ = s.minimumClusterSize || 2, this.maxZoom_ = s.maxZoom || null, this.styles_ = s.styles || [], this.imagePath_ = s.imagePath || this.MARKER_CLUSTER_IMAGE_PATH_, this.imageExtension_ = s.imageExtension || this.MARKER_CLUSTER_IMAGE_EXTENSION_, this.zoomOnClick_ = !0, s.zoomOnClick != null && (this.zoomOnClick_ = s.zoomOnClick), this.averageCenter_ = !1, s.averageCenter != null && (this.averageCenter_ = s.averageCenter), this.setupStyles_(), this.setMap(e), this.prevZoom_ = this.map_.getZoom();
998
1024
  var n = this;
999
1025
  google.maps.event.addListener(this.map_, "zoom_changed", function() {
1000
- var a = n.map_.getZoom(), c = n.map_.minZoom || 0, o = Math.min(
1026
+ var a = n.map_.getZoom(), d = n.map_.minZoom || 0, o = Math.min(
1001
1027
  n.map_.maxZoom || 100,
1002
1028
  n.map_.mapTypes[n.map_.getMapTypeId()].maxZoom
1003
1029
  );
1004
- a = Math.min(Math.max(a, c), o), n.prevZoom_ != a && (n.prevZoom_ = a, n.resetViewport());
1030
+ a = Math.min(Math.max(a, d), o), n.prevZoom_ != a && (n.prevZoom_ = a, n.resetViewport());
1005
1031
  }), google.maps.event.addListener(this.map_, "idle", function() {
1006
1032
  n.redraw();
1007
1033
  }), t && (t.length || Object.keys(t).length) && this.addMarkers(t, !1);
@@ -1244,8 +1270,8 @@ let Wr = class Wt {
1244
1270
  */
1245
1271
  removeMarkers(e, t) {
1246
1272
  for (var r = e === this.getMarkers() ? e.slice() : e, s = !1, n = 0, a; a = r[n]; n++) {
1247
- var c = this.removeMarker_(a);
1248
- s = s || c;
1273
+ var d = this.removeMarker_(a);
1274
+ s = s || d;
1249
1275
  }
1250
1276
  if (!t && s)
1251
1277
  return this.resetViewport(), this.redraw(), !0;
@@ -1332,8 +1358,8 @@ let Wr = class Wt {
1332
1358
  n.x += this.gridSize_, n.y -= this.gridSize_;
1333
1359
  var a = t.fromLatLngToDivPixel(s);
1334
1360
  a.x -= this.gridSize_, a.y += this.gridSize_;
1335
- var c = t.fromDivPixelToLatLng(n), o = t.fromDivPixelToLatLng(a);
1336
- return e.extend(c), e.extend(o), e;
1361
+ var d = t.fromDivPixelToLatLng(n), o = t.fromDivPixelToLatLng(a);
1362
+ return e.extend(d), e.extend(o), e;
1337
1363
  }
1338
1364
  /**
1339
1365
  * Determins if a marker is contained in a bounds.
@@ -1391,7 +1417,7 @@ let Wr = class Wt {
1391
1417
  distanceBetweenPoints_(e, t) {
1392
1418
  if (!e || !t)
1393
1419
  return 0;
1394
- var r = 6371, s = (t.lat() - e.lat()) * Math.PI / 180, n = (t.lng() - e.lng()) * Math.PI / 180, a = Math.sin(s / 2) * Math.sin(s / 2) + Math.cos(e.lat() * Math.PI / 180) * Math.cos(t.lat() * Math.PI / 180) * Math.sin(n / 2) * Math.sin(n / 2), c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)), o = r * c;
1420
+ var r = 6371, s = (t.lat() - e.lat()) * Math.PI / 180, n = (t.lng() - e.lng()) * Math.PI / 180, a = Math.sin(s / 2) * Math.sin(s / 2) + Math.cos(e.lat() * Math.PI / 180) * Math.cos(t.lat() * Math.PI / 180) * Math.sin(n / 2) * Math.sin(n / 2), d = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)), o = r * d;
1395
1421
  return o;
1396
1422
  }
1397
1423
  /**
@@ -1404,14 +1430,14 @@ let Wr = class Wt {
1404
1430
  for (var t = 4e4, r = null, s = 0, n; n = this.clusters_[s]; s++) {
1405
1431
  var a = n.getCenter();
1406
1432
  if (a) {
1407
- var c = this.distanceBetweenPoints_(a, e.getPosition());
1408
- c < t && (t = c, r = n);
1433
+ var d = this.distanceBetweenPoints_(a, e.getPosition());
1434
+ d < t && (t = d, r = n);
1409
1435
  }
1410
1436
  }
1411
1437
  if (r && r.isMarkerInClusterBounds(e))
1412
1438
  r.addMarker(e);
1413
1439
  else {
1414
- var o = new Vr(this);
1440
+ var o = new Ur(this);
1415
1441
  o.addMarker(e), this.clusters_.push(o);
1416
1442
  }
1417
1443
  }
@@ -1428,7 +1454,7 @@ let Wr = class Wt {
1428
1454
  ), t = this.getExtendedBounds(e), r = 0, s; s = this.markers_[r]; r++)
1429
1455
  !s.isAdded && this.isMarkerInBounds_(s, t) && this.addToClosestCluster_(s);
1430
1456
  }
1431
- }, Vr = class {
1457
+ }, Ur = class {
1432
1458
  constructor(e) {
1433
1459
  this.markerClusterer_ = e, this.map_ = e.getMap(), this.gridSize_ = e.getGridSize(), this.minClusterSize_ = e.getMinClusterSize(), this.averageCenter_ = e.isAverageCenter(), this.center_ = null, this.markers_ = [], this.bounds_ = null, this.clusterIcon_ = new Qe(
1434
1460
  this,
@@ -1697,7 +1723,7 @@ class Qe {
1697
1723
  ), t.join("");
1698
1724
  }
1699
1725
  }
1700
- var je = {}, Hr = {
1726
+ var je = {}, Yr = {
1701
1727
  get exports() {
1702
1728
  return je;
1703
1729
  },
@@ -1708,7 +1734,7 @@ var je = {}, Hr = {
1708
1734
  (function(i, e) {
1709
1735
  (function(t, r) {
1710
1736
  i.exports = r();
1711
- })(Pt, function() {
1737
+ })(It, function() {
1712
1738
  var t, r = t = r || { version: "1.3.8" }, s = {};
1713
1739
  r.guid = "$BAIDU$", s[r.guid] = s[r.guid] || {}, r.dom = r.dom || {}, r.dom.g = function(o) {
1714
1740
  return typeof o == "string" || o instanceof String ? document.getElementById(o) : o && o.nodeName && (o.nodeType == 1 || o.nodeType == 9) ? o : null;
@@ -1720,10 +1746,10 @@ var je = {}, Hr = {
1720
1746
  return r.lang.isString(o) ? document.getElementById(o) : o;
1721
1747
  }, r._g = r.dom._g, r.browser = r.browser || {}, /msie (\d+\.\d)/i.test(navigator.userAgent) && (r.browser.ie = r.ie = document.documentMode || +RegExp.$1), r.dom.getComputedStyle = function(o, l) {
1722
1748
  o = r.dom._g(o);
1723
- var h = r.dom.getDocument(o), u;
1724
- return h.defaultView && h.defaultView.getComputedStyle && (u = h.defaultView.getComputedStyle(o, null), u) ? u[l] || u.getPropertyValue(l) : "";
1749
+ var h = r.dom.getDocument(o), p;
1750
+ return h.defaultView && h.defaultView.getComputedStyle && (p = h.defaultView.getComputedStyle(o, null), p) ? p[l] || p.getPropertyValue(l) : "";
1725
1751
  }, r.dom._styleFixer = r.dom._styleFixer || {}, r.dom._styleFilter = r.dom._styleFilter || [], r.dom._styleFilter.filter = function(o, l, h) {
1726
- for (var u = 0, p = r.dom._styleFilter, M; M = p[u]; u++)
1752
+ for (var p = 0, u = r.dom._styleFilter, M; M = u[p]; p++)
1727
1753
  (M = M[h]) && (l = M(o, l));
1728
1754
  return l;
1729
1755
  }, r.string = r.string || {}, r.string.toCamelCase = function(o) {
@@ -1733,42 +1759,42 @@ var je = {}, Hr = {
1733
1759
  }, r.dom.getStyle = function(o, l) {
1734
1760
  var h = r.dom;
1735
1761
  o = h.g(o), l = r.string.toCamelCase(l);
1736
- var u = o.style[l] || (o.currentStyle ? o.currentStyle[l] : "") || h.getComputedStyle(o, l);
1737
- if (!u) {
1738
- var p = h._styleFixer[l];
1739
- p && (u = p.get ? p.get(o) : r.dom.getStyle(o, p));
1762
+ var p = o.style[l] || (o.currentStyle ? o.currentStyle[l] : "") || h.getComputedStyle(o, l);
1763
+ if (!p) {
1764
+ var u = h._styleFixer[l];
1765
+ u && (p = u.get ? u.get(o) : r.dom.getStyle(o, u));
1740
1766
  }
1741
- return (p = h._styleFilter) && (u = p.filter(l, u, "get")), u;
1767
+ return (u = h._styleFilter) && (p = u.filter(l, p, "get")), p;
1742
1768
  }, r.getStyle = r.dom.getStyle, /opera\/(\d+\.\d)/i.test(navigator.userAgent) && (r.browser.opera = +RegExp.$1), r.browser.isWebkit = /webkit/i.test(navigator.userAgent), r.browser.isGecko = /gecko/i.test(navigator.userAgent) && !/like gecko/i.test(navigator.userAgent), r.browser.isStrict = document.compatMode == "CSS1Compat", r.dom.getPosition = function(o) {
1743
1769
  o = r.dom.g(o);
1744
- var l = r.dom.getDocument(o), h = r.browser, u = r.dom.getStyle;
1745
- h.isGecko > 0 && l.getBoxObjectFor && u(o, "position") == "absolute" && (o.style.top === "" || o.style.left);
1746
- var p = { left: 0, top: 0 }, M = h.ie && !h.isStrict ? l.body : l.documentElement, b, _;
1770
+ var l = r.dom.getDocument(o), h = r.browser, p = r.dom.getStyle;
1771
+ h.isGecko > 0 && l.getBoxObjectFor && p(o, "position") == "absolute" && (o.style.top === "" || o.style.left);
1772
+ var u = { left: 0, top: 0 }, M = h.ie && !h.isStrict ? l.body : l.documentElement, b, _;
1747
1773
  if (o == M)
1748
- return p;
1774
+ return u;
1749
1775
  if (o.getBoundingClientRect) {
1750
- _ = o.getBoundingClientRect(), p.left = Math.floor(_.left) + Math.max(l.documentElement.scrollLeft, l.body.scrollLeft), p.top = Math.floor(_.top) + Math.max(l.documentElement.scrollTop, l.body.scrollTop), p.left -= l.documentElement.clientLeft, p.top -= l.documentElement.clientTop;
1751
- var g = l.body, m = parseInt(u(g, "borderLeftWidth")), v = parseInt(u(g, "borderTopWidth"));
1752
- h.ie && !h.isStrict && (p.left -= isNaN(m) ? 2 : m, p.top -= isNaN(v) ? 2 : v);
1776
+ _ = o.getBoundingClientRect(), u.left = Math.floor(_.left) + Math.max(l.documentElement.scrollLeft, l.body.scrollLeft), u.top = Math.floor(_.top) + Math.max(l.documentElement.scrollTop, l.body.scrollTop), u.left -= l.documentElement.clientLeft, u.top -= l.documentElement.clientTop;
1777
+ var g = l.body, m = parseInt(p(g, "borderLeftWidth")), v = parseInt(p(g, "borderTopWidth"));
1778
+ h.ie && !h.isStrict && (u.left -= isNaN(m) ? 2 : m, u.top -= isNaN(v) ? 2 : v);
1753
1779
  } else {
1754
1780
  b = o;
1755
1781
  do {
1756
- if (p.left += b.offsetLeft, p.top += b.offsetTop, h.isWebkit > 0 && u(b, "position") == "fixed") {
1757
- p.left += l.body.scrollLeft, p.top += l.body.scrollTop;
1782
+ if (u.left += b.offsetLeft, u.top += b.offsetTop, h.isWebkit > 0 && p(b, "position") == "fixed") {
1783
+ u.left += l.body.scrollLeft, u.top += l.body.scrollTop;
1758
1784
  break;
1759
1785
  }
1760
1786
  b = b.offsetParent;
1761
1787
  } while (b && b != o);
1762
- for ((h.opera > 0 || h.isWebkit > 0 && u(o, "position") == "absolute") && (p.top -= l.body.offsetTop), b = o.offsetParent; b && b != l.body; )
1763
- p.left -= b.scrollLeft, (!h.opera || b.tagName != "TR") && (p.top -= b.scrollTop), b = b.offsetParent;
1788
+ for ((h.opera > 0 || h.isWebkit > 0 && p(o, "position") == "absolute") && (u.top -= l.body.offsetTop), b = o.offsetParent; b && b != l.body; )
1789
+ u.left -= b.scrollLeft, (!h.opera || b.tagName != "TR") && (u.top -= b.scrollTop), b = b.offsetParent;
1764
1790
  }
1765
- return p;
1791
+ return u;
1766
1792
  }, r.event = r.event || {}, r.event._listeners = r.event._listeners || [], r.event.on = function(o, l, h) {
1767
1793
  l = l.replace(/^on/i, ""), o = r.dom._g(o);
1768
- var u = function(g) {
1794
+ var p = function(g) {
1769
1795
  h.call(o, g);
1770
- }, p = r.event._listeners, M = r.event._eventFilter, b, _ = l;
1771
- return l = l.toLowerCase(), M && M[l] && (b = M[l](o, l, u), _ = b.type, u = b.listener), o.addEventListener ? o.addEventListener(_, u, !1) : o.attachEvent && o.attachEvent("on" + _, u), p[p.length] = [o, l, h, u, _], o;
1796
+ }, u = r.event._listeners, M = r.event._eventFilter, b, _ = l;
1797
+ return l = l.toLowerCase(), M && M[l] && (b = M[l](o, l, p), _ = b.type, p = b.listener), o.addEventListener ? o.addEventListener(_, p, !1) : o.attachEvent && o.attachEvent("on" + _, p), u[u.length] = [o, l, h, p, _], o;
1772
1798
  }, r.on = r.event.on, function() {
1773
1799
  var o = s[r.guid];
1774
1800
  r.lang.guid = function() {
@@ -1790,13 +1816,13 @@ var je = {}, Hr = {
1790
1816
  }, r.lang.Class.prototype.addEventListener = function(o, l, h) {
1791
1817
  if (r.lang.isFunction(l)) {
1792
1818
  !this.__listeners && (this.__listeners = {});
1793
- var u = this.__listeners, p;
1819
+ var p = this.__listeners, u;
1794
1820
  if (typeof h == "string" && h) {
1795
1821
  if (/[^\w\-]/.test(h))
1796
1822
  throw "nonstandard key:" + h;
1797
- l.hashCode = h, p = h;
1823
+ l.hashCode = h, u = h;
1798
1824
  }
1799
- o.indexOf("on") != 0 && (o = "on" + o), typeof u[o] != "object" && (u[o] = {}), p = p || r.lang.guid(), l.hashCode = p, u[o][p] = l;
1825
+ o.indexOf("on") != 0 && (o = "on" + o), typeof p[o] != "object" && (p[o] = {}), u = u || r.lang.guid(), l.hashCode = u, p[o][u] = l;
1800
1826
  }
1801
1827
  }, r.lang.Class.prototype.removeEventListener = function(o, l) {
1802
1828
  if (!(typeof l < "u" && (r.lang.isFunction(l) && !(l = l.hashCode) || !r.lang.isString(l)))) {
@@ -1806,115 +1832,115 @@ var je = {}, Hr = {
1806
1832
  if (typeof l < "u")
1807
1833
  h[o][l] && delete h[o][l];
1808
1834
  else
1809
- for (var u in h[o])
1810
- delete h[o][u];
1835
+ for (var p in h[o])
1836
+ delete h[o][p];
1811
1837
  }
1812
1838
  }, r.lang.Class.prototype.dispatchEvent = function(o, l) {
1813
1839
  r.lang.isString(o) && (o = new r.lang.Event(o)), !this.__listeners && (this.__listeners = {}), l = l || {};
1814
1840
  for (var h in l)
1815
1841
  o[h] = l[h];
1816
- var h, u = this.__listeners, p = o.type;
1817
- if (o.target = o.target || this, o.currentTarget = this, p.indexOf("on") != 0 && (p = "on" + p), r.lang.isFunction(this[p]) && this[p].apply(this, arguments), typeof u[p] == "object")
1818
- for (h in u[p])
1819
- u[p][h].apply(this, arguments);
1842
+ var h, p = this.__listeners, u = o.type;
1843
+ if (o.target = o.target || this, o.currentTarget = this, u.indexOf("on") != 0 && (u = "on" + u), r.lang.isFunction(this[u]) && this[u].apply(this, arguments), typeof p[u] == "object")
1844
+ for (h in p[u])
1845
+ p[u][h].apply(this, arguments);
1820
1846
  return o.returnValue;
1821
1847
  }, r.lang.inherits = function(o, l, h) {
1822
- var u, p, M = o.prototype, b = new Function();
1823
- b.prototype = l.prototype, p = o.prototype = new b();
1824
- for (u in M)
1825
- p[u] = M[u];
1826
- o.prototype.constructor = o, o.superClass = l.prototype, typeof h == "string" && (p._className = h);
1848
+ var p, u, M = o.prototype, b = new Function();
1849
+ b.prototype = l.prototype, u = o.prototype = new b();
1850
+ for (p in M)
1851
+ u[p] = M[p];
1852
+ o.prototype.constructor = o, o.superClass = l.prototype, typeof h == "string" && (u._className = h);
1827
1853
  }, r.inherits = r.lang.inherits;
1828
- var n = "http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m", a = "png", c = function(o, l, h) {
1854
+ var n = "http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m", a = "png", d = function(o, l, h) {
1829
1855
  try {
1830
1856
  BMap;
1831
1857
  } catch {
1832
1858
  throw Error("Baidu Map JS API is not ready yet!");
1833
1859
  }
1834
- t.lang.inherits(c, BMap.Overlay, "TextIconOverlay"), this._position = o, this._text = l, this._options = h || {}, this._styles = this._options.styles || [], this._zIndex = this._options.zIndex, !this._styles.length && this._setupDefaultStyles();
1860
+ t.lang.inherits(d, BMap.Overlay, "TextIconOverlay"), this._position = o, this._text = l, this._options = h || {}, this._styles = this._options.styles || [], this._zIndex = this._options.zIndex, !this._styles.length && this._setupDefaultStyles();
1835
1861
  };
1836
- return c.prototype._setupDefaultStyles = function() {
1862
+ return d.prototype._setupDefaultStyles = function() {
1837
1863
  for (var o = [53, 56, 66, 78, 90], l = 0, h; h = o[l]; l++)
1838
1864
  this._styles.push({
1839
1865
  url: n + l + "." + a,
1840
1866
  size: new BMap.Size(h, h)
1841
1867
  });
1842
- }, c.prototype.initialize = function(o) {
1868
+ }, d.prototype.initialize = function(o) {
1843
1869
  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;
1844
- }, c.prototype.draw = function() {
1870
+ }, d.prototype.draw = function() {
1845
1871
  this._map && this._updatePosition();
1846
- }, c.prototype.getText = function() {
1872
+ }, d.prototype.getText = function() {
1847
1873
  return this._text;
1848
- }, c.prototype.setText = function(o) {
1874
+ }, d.prototype.setText = function(o) {
1849
1875
  o && (!this._text || this._text.toString() != o.toString()) && (this._text = o, this._updateText(), this._updateCss(), this._updatePosition());
1850
- }, c.prototype.getPosition = function() {
1876
+ }, d.prototype.getPosition = function() {
1851
1877
  return this._position;
1852
- }, c.prototype.setPosition = function(o) {
1878
+ }, d.prototype.setPosition = function(o) {
1853
1879
  o && (!this._position || !this._position.equals(o)) && (this._position = o, this._updatePosition());
1854
- }, c.prototype.getStyleByText = function(o, l) {
1855
- var h = parseInt(o), u = parseInt(h / 10);
1856
- return u = Math.max(0, u), u = Math.min(u, l.length - 1), l[u];
1857
- }, c.prototype._updateCss = function() {
1880
+ }, d.prototype.getStyleByText = function(o, l) {
1881
+ var h = parseInt(o), p = parseInt(h / 10);
1882
+ return p = Math.max(0, p), p = Math.min(p, l.length - 1), l[p];
1883
+ }, d.prototype._updateCss = function() {
1858
1884
  if (this._domElement) {
1859
1885
  var o = this.getStyleByText(this._text, this._styles);
1860
1886
  this._domElement.style.cssText = this._buildCssText(o);
1861
1887
  }
1862
- }, c.prototype._updateText = function() {
1888
+ }, d.prototype._updateText = function() {
1863
1889
  this._domElement && (this._domElement.innerHTML = this._text);
1864
- }, c.prototype._updatePosition = function() {
1890
+ }, d.prototype._updatePosition = function() {
1865
1891
  if (this._domElement && this._position) {
1866
1892
  var o = this._domElement.style, l = this._map.pointToOverlayPixel(this._position);
1867
1893
  l.x -= Math.ceil(parseInt(o.width) / 2), l.y -= Math.ceil(parseInt(o.height) / 2), o.left = l.x + "px", o.top = l.y + "px";
1868
1894
  }
1869
- }, c.prototype._buildCssText = function(o) {
1870
- var l = o.url, h = o.size, u = o.anchor, p = o.offset, M = o.textColor || "black", b = o.textSize || 10, _ = [];
1895
+ }, d.prototype._buildCssText = function(o) {
1896
+ var l = o.url, h = o.size, p = o.anchor, u = o.offset, M = o.textColor || "black", b = o.textSize || 10, _ = [];
1871
1897
  if (this._zIndex && _.push("z-index:" + this._zIndex + ";"), t.browser.ie < 7)
1872
1898
  _.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="' + l + '");');
1873
1899
  else {
1874
1900
  _.push("background-image:url(" + l + ");");
1875
1901
  var g = "0 0";
1876
- p instanceof BMap.Size && (g = p.width + "px " + p.height + "px"), _.push("background-position:" + g + ";");
1902
+ u instanceof BMap.Size && (g = u.width + "px " + u.height + "px"), _.push("background-position:" + g + ";");
1877
1903
  }
1878
- return h instanceof BMap.Size && (u instanceof BMap.Size ? (u.height > 0 && u.height < h.height && _.push("height:" + (h.height - u.height) + "px; padding-top:" + u.height + "px;"), u.width > 0 && u.width < h.width && _.push("width:" + (h.width - u.width) + "px; padding-left:" + u.width + "px;")) : (_.push("height:" + h.height + "px; line-height:" + h.height + "px;"), _.push("width:" + h.width + "px; text-align:center;"))), _.push("cursor:pointer; color:" + M + "; position:absolute; font-size:" + b + "px; font-family:Arial,sans-serif; font-weight:bold"), _.join("");
1879
- }, c.prototype._bind = function() {
1904
+ return h instanceof BMap.Size && (p instanceof BMap.Size ? (p.height > 0 && p.height < h.height && _.push("height:" + (h.height - p.height) + "px; padding-top:" + p.height + "px;"), p.width > 0 && p.width < h.width && _.push("width:" + (h.width - p.width) + "px; padding-left:" + p.width + "px;")) : (_.push("height:" + h.height + "px; line-height:" + h.height + "px;"), _.push("width:" + h.width + "px; text-align:center;"))), _.push("cursor:pointer; color:" + M + "; position:absolute; font-size:" + b + "px; font-family:Arial,sans-serif; font-weight:bold"), _.join("");
1905
+ }, d.prototype._bind = function() {
1880
1906
  if (!this._domElement)
1881
1907
  return;
1882
1908
  var o = this, l = this._map, h = t.lang.Event;
1883
- function u(p, M) {
1884
- var b = p.srcElement || p.target, _ = p.clientX || p.pageX, g = p.clientY || p.pageY;
1885
- if (p && M && _ && g && b) {
1909
+ function p(u, M) {
1910
+ var b = u.srcElement || u.target, _ = u.clientX || u.pageX, g = u.clientY || u.pageY;
1911
+ if (u && M && _ && g && b) {
1886
1912
  var m = t.dom.getPosition(l.getContainer());
1887
1913
  M.pixel = new BMap.Pixel(_ - m.left, g - m.top), M.point = l.pixelToPoint(M.pixel);
1888
1914
  }
1889
1915
  return M;
1890
1916
  }
1891
- t.event.on(this._domElement, "mouseover", function(p) {
1892
- o.dispatchEvent(u(p, new h("onmouseover")));
1893
- }), t.event.on(this._domElement, "mouseout", function(p) {
1894
- o.dispatchEvent(u(p, new h("onmouseout")));
1895
- }), t.event.on(this._domElement, "click", function(p) {
1896
- o.dispatchEvent(u(p, new h("onclick")));
1917
+ t.event.on(this._domElement, "mouseover", function(u) {
1918
+ o.dispatchEvent(p(u, new h("onmouseover")));
1919
+ }), t.event.on(this._domElement, "mouseout", function(u) {
1920
+ o.dispatchEvent(p(u, new h("onmouseout")));
1921
+ }), t.event.on(this._domElement, "click", function(u) {
1922
+ o.dispatchEvent(p(u, new h("onclick")));
1897
1923
  });
1898
- }, c;
1924
+ }, d;
1899
1925
  });
1900
- })(Hr);
1901
- const Ct = je;
1902
- var Vt = function(i, e, t) {
1903
- e = Fr(e);
1926
+ })(Yr);
1927
+ const xt = je;
1928
+ var Ut = function(i, e, t) {
1929
+ e = qr(e);
1904
1930
  var r = i.pointToPixel(e.getNorthEast()), s = i.pointToPixel(e.getSouthWest());
1905
1931
  r.x += t, r.y -= t, s.x -= t, s.y += t;
1906
1932
  var n = i.pixelToPoint(r), a = i.pixelToPoint(s);
1907
1933
  return new BMap.Bounds(a, n);
1908
- }, Fr = function(i) {
1909
- var e = Me(i.getNorthEast().lng, -180, 180), t = Me(i.getSouthWest().lng, -180, 180), r = Me(i.getNorthEast().lat, -74, 74), s = Me(i.getSouthWest().lat, -74, 74);
1934
+ }, qr = function(i) {
1935
+ var e = be(i.getNorthEast().lng, -180, 180), t = be(i.getSouthWest().lng, -180, 180), r = be(i.getNorthEast().lat, -74, 74), s = be(i.getSouthWest().lat, -74, 74);
1910
1936
  return new BMap.Bounds(new BMap.Point(t, s), new BMap.Point(e, r));
1911
- }, Me = function(i, e, t) {
1937
+ }, be = function(i, e, t) {
1912
1938
  return e && (i = Math.max(i, e)), t && (i = Math.min(i, t)), i;
1913
- }, Ht = function(i) {
1939
+ }, Yt = function(i) {
1914
1940
  return Object.prototype.toString.call(i) === "[object Array]";
1915
- }, Ft = function(i, e) {
1941
+ }, qt = function(i, e) {
1916
1942
  var t = -1;
1917
- if (Ht(e)) {
1943
+ if (Yt(e)) {
1918
1944
  if (e.indexOf)
1919
1945
  t = e.indexOf(i);
1920
1946
  else
@@ -1942,7 +1968,7 @@ var Vt = function(i, e, t) {
1942
1968
  r._redraw();
1943
1969
  });
1944
1970
  var s = t.markers;
1945
- Ht(s) && this.addMarkers(s);
1971
+ Yt(s) && this.addMarkers(s);
1946
1972
  }
1947
1973
  };
1948
1974
  T.prototype.addMarkers = function(i) {
@@ -1953,7 +1979,7 @@ T.prototype.addMarkers = function(i) {
1953
1979
  }
1954
1980
  };
1955
1981
  T.prototype._pushMarkerTo = function(i) {
1956
- var e = Ft(i, this._markers);
1982
+ var e = qt(i, this._markers);
1957
1983
  e === -1 && (i.isInCluster = !1, this._markers.push(i));
1958
1984
  };
1959
1985
  T.prototype.addMarker = function(i) {
@@ -1962,7 +1988,7 @@ T.prototype.addMarker = function(i) {
1962
1988
  T.prototype._createClusters = function() {
1963
1989
  var i = this._map.getBounds();
1964
1990
  if (i.getCenter()) {
1965
- for (var e = Vt(this._map, i, this._gridSize), t = 0, r; r = this._markers[t]; t++)
1991
+ for (var e = Ut(this._map, i, this._gridSize), t = 0, r; r = this._markers[t]; t++)
1966
1992
  !r.isInCluster && e.containsPoint(r.getPosition()) && this._addToClosestCluster(r);
1967
1993
  for (var s = this._markers.length, t = 0; t < s; t++)
1968
1994
  this._clusters[t] && this._clusters[t].render();
@@ -2002,7 +2028,7 @@ T.prototype._removeMarkersFromMap = function() {
2002
2028
  }
2003
2029
  };
2004
2030
  T.prototype._removeMarker = function(i) {
2005
- var e = Ft(i, this._markers);
2031
+ var e = qt(i, this._markers);
2006
2032
  return e === -1 ? !1 : (this._map.removeOverlay(i), this._markers.splice(e, 1), !0);
2007
2033
  };
2008
2034
  T.prototype.removeMarker = function(i) {
@@ -2078,7 +2104,7 @@ T.prototype.setStylesIndexCalculator = function(i) {
2078
2104
  };
2079
2105
  function S(i) {
2080
2106
  var e = this;
2081
- this._markerClusterer = i, this._map = i.getMap(), this._minClusterSize = i.getMinClusterSize(), this._isAverageCenter = i.isAverageCenter(), this._center = null, this._markers = [], this._gridBounds = null, this._isReal = !1, this._clusterMarker = new Ct(this._center, this._markers.length, {
2107
+ this._markerClusterer = i, this._map = i.getMap(), this._minClusterSize = i.getMinClusterSize(), this._isAverageCenter = i.isAverageCenter(), this._center = null, this._markers = [], this._gridBounds = null, this._isReal = !1, this._clusterMarker = new xt(this._center, this._markers.length, {
2082
2108
  styles: this._markerClusterer.getStyles(),
2083
2109
  zIndex: i._zIndex
2084
2110
  }), this._clusterMarker.getStyleByText = function(t, r) {
@@ -2086,7 +2112,7 @@ function S(i) {
2086
2112
  var s = e._markerClusterer._stylesIndexCalculator(e._markers, r.length);
2087
2113
  return r[s];
2088
2114
  }
2089
- return Ct.prototype.getStyleByText.call(this, t, r);
2115
+ return xt.prototype.getStyleByText.call(this, t, r);
2090
2116
  }, this._clusterMarker.addEventListener && this._clusterMarker.addEventListener("click", function(t) {
2091
2117
  e._map.setViewport(e.getBounds());
2092
2118
  });
@@ -2126,7 +2152,7 @@ S.prototype.isReal = function(i) {
2126
2152
  };
2127
2153
  S.prototype.updateGridBounds = function() {
2128
2154
  var i = new BMap.Bounds(this._center, this._center);
2129
- this._gridBounds = Vt(this._map, i, this._markerClusterer.getGridSize());
2155
+ this._gridBounds = Ut(this._map, i, this._markerClusterer.getGridSize());
2130
2156
  };
2131
2157
  S.prototype.updateClusterMarker = function() {
2132
2158
  if (this._map.getZoom() > this._markerClusterer.getMaxZoom()) {
@@ -2182,9 +2208,9 @@ var Le;
2182
2208
  }
2183
2209
  i.toGoogle = t;
2184
2210
  })(Le || (Le = {}));
2185
- class Ut {
2211
+ class Kt {
2186
2212
  constructor(e) {
2187
- d(this, "inner");
2213
+ c(this, "inner");
2188
2214
  this.map = e;
2189
2215
  }
2190
2216
  /** baidu/google 拥有相同的函数名 */
@@ -2208,7 +2234,7 @@ class Ut {
2208
2234
  return this.inner.removeMarkers(e.map((t) => t.innerOverlay));
2209
2235
  }
2210
2236
  }
2211
- class Ur extends Ut {
2237
+ class Kr extends Kt {
2212
2238
  constructor(e, t) {
2213
2239
  var s;
2214
2240
  super(e), this.inner = new T(e.innerMap, {
@@ -2228,10 +2254,10 @@ class Ur extends Ut {
2228
2254
  this.inner._redraw();
2229
2255
  }
2230
2256
  }
2231
- class Yr extends Ut {
2257
+ class Xr extends Kt {
2232
2258
  constructor(e, t) {
2233
2259
  var s, n;
2234
- super(e), this.inner = new Wr(
2260
+ super(e), this.inner = new Fr(
2235
2261
  e.innerMap,
2236
2262
  // google的构造器中的markers,不会触发重绘, 第一次绘制通过监听地图的'idle'事件触发, 可以直接设置
2237
2263
  (s = t.markers) == null ? void 0 : s.map((a) => a.innerOverlay),
@@ -2245,29 +2271,31 @@ class Yr extends Ut {
2245
2271
  }
2246
2272
  );
2247
2273
  const r = t.stylesIndexCalculator;
2248
- r && this.inner.setCalculator((a, c) => ({
2274
+ r && this.inner.setCalculator((a, d) => ({
2249
2275
  text: a.length,
2250
2276
  // google内部, 取index时, 会`-1`...故我们这里`+1`, 抵消掉它
2251
- index: r(a.length, c) + 1
2277
+ index: r(a.length, d) + 1
2252
2278
  }));
2253
2279
  }
2254
2280
  recreate() {
2255
2281
  this.inner.repaint();
2256
2282
  }
2257
2283
  }
2258
- class Yt {
2259
- constructor(e) {
2260
- this.map = e;
2284
+ class Xt {
2285
+ constructor() {
2261
2286
  }
2262
2287
  }
2263
- class qr extends Yt {
2288
+ class Jr extends Xt {
2264
2289
  constructor(t, r) {
2265
- super(t);
2266
- d(this, "inner");
2267
- this.inner = new google.maps.places.PlacesService(t.innerMap);
2290
+ super();
2291
+ c(this, "inner");
2292
+ this.map = t, this.inner = new google.maps.places.PlacesService(t.innerMap);
2268
2293
  }
2269
- search(t) {
2270
- return this.searchImpl(t);
2294
+ search(t, r) {
2295
+ return this.searchImpl(
2296
+ t,
2297
+ r instanceof y ? r.toGoogle(this.map.coordType) : r ?? this.map.innerMap.getCenter()
2298
+ );
2271
2299
  }
2272
2300
  searchInBounds(t, r) {
2273
2301
  return this.searchImpl(t, r.toGoogle(this.map.coordType));
@@ -2284,105 +2312,147 @@ class qr extends Yt {
2284
2312
  "geometry",
2285
2313
  "name",
2286
2314
  "place_id"
2287
- // 'address_components', // 查询请求不支持该字段...
2315
+ // 'address_components', // TODO: 2023/04/28 ipcjs 查询请求不支持该字段...
2288
2316
  ],
2289
2317
  locationBias: r
2290
- }, (a, c) => {
2291
- switch (c) {
2318
+ }, (a, d) => {
2319
+ switch (d) {
2292
2320
  case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:
2293
2321
  case google.maps.places.PlacesServiceStatus.OK: {
2294
- const o = (a ?? []).map((l) => {
2295
- var p;
2296
- const h = l.address_components && Gt(l.address_components);
2297
- return {
2298
- country: (h == null ? void 0 : h.country) ?? "",
2299
- province: (h == null ? void 0 : h.province) ?? "",
2300
- city: (h == null ? void 0 : h.city) ?? "",
2301
- id: l.place_id ?? "",
2302
- address: l.formatted_address ?? "",
2303
- position: y.fromGoogle(((p = l.geometry) == null ? void 0 : p.location) ?? te.LATLNG_ZERO, this.map.coordType),
2304
- title: l.name ?? ""
2305
- };
2306
- });
2322
+ const o = (a ?? []).map((l) => Vt(l, this.map));
2307
2323
  s(o);
2308
2324
  break;
2309
2325
  }
2310
2326
  default:
2311
- n(new Error(`status: ${c}`));
2327
+ n(new Error(`status: ${d}`));
2312
2328
  break;
2313
2329
  }
2314
2330
  });
2315
2331
  });
2316
2332
  }
2317
2333
  }
2318
- class Kr extends Yt {
2334
+ class Qr extends Xt {
2319
2335
  constructor(t, r) {
2320
- super(t);
2321
- d(this, "searchRequestMap", /* @__PURE__ */ new Map());
2322
- d(this, "currentSearch");
2336
+ super();
2337
+ c(this, "searchRequestMap", /* @__PURE__ */ new Map());
2338
+ c(this, "currentSearch");
2339
+ this.map = t;
2323
2340
  }
2324
2341
  get inner() {
2325
2342
  return this.currentSearch;
2326
2343
  }
2327
- search(t) {
2328
- return this.newSearch((r) => {
2329
- r.search(t);
2330
- });
2344
+ search(t, r) {
2345
+ return this.newSearch(
2346
+ r instanceof y ? r.toBaidu(this.map.coordType) : r ?? this.map.innerMap.getCenter(),
2347
+ (s) => {
2348
+ s.search(t);
2349
+ }
2350
+ );
2331
2351
  }
2332
2352
  searchInBounds(t, r) {
2333
- return this.newSearch((s) => {
2353
+ return this.newSearch(void 0, (s) => {
2334
2354
  s.searchInBounds(t, r.toBaidu(this.map.coordType));
2335
2355
  });
2336
2356
  }
2337
2357
  searchNearBy(t, r, s) {
2338
- return this.newSearch((n) => {
2358
+ return this.newSearch(void 0, (n) => {
2339
2359
  n.searchNearby(t, r.toBaidu(this.map.coordType), s);
2340
2360
  });
2341
2361
  }
2342
- newSearch(t) {
2343
- return new Promise((r, s) => {
2344
- const n = new BMap.LocalSearch(this.map.innerMap, {
2345
- onSearchComplete: (a) => {
2346
- Array.isArray(a) && It("当前只支持一次搜索一条数据");
2347
- const c = n.getStatus();
2348
- switch (c) {
2362
+ newSearch(t, r) {
2363
+ return new Promise((s, n) => {
2364
+ const a = new BMap.LocalSearch(t ?? this.map.innerMap, {
2365
+ onSearchComplete: (d) => {
2366
+ Array.isArray(d) && Bt("当前只支持一次搜索一条数据");
2367
+ const o = a.getStatus();
2368
+ switch (o) {
2349
2369
  case BMAP_STATUS_SUCCESS: {
2350
- const o = [];
2351
- for (let l = 0; l < a.getCurrentNumPois(); l++) {
2352
- const h = a.getPoi(l);
2353
- o.push({
2354
- id: h.uid,
2355
- city: h.city,
2370
+ const l = [];
2371
+ for (let h = 0; h < d.getCurrentNumPois(); h++) {
2372
+ const p = d.getPoi(h);
2373
+ l.push({
2374
+ id: p.uid,
2375
+ city: p.city,
2356
2376
  country: "",
2357
2377
  // 百度地图只支持中国
2358
- position: y.fromBaidu(h.point, this.map.coordType),
2359
- province: h.province,
2360
- title: h.title,
2361
- address: h.address
2378
+ position: y.fromBaidu(p.point, this.map.coordType),
2379
+ province: p.province,
2380
+ title: p.title,
2381
+ address: p.address
2362
2382
  });
2363
2383
  }
2364
- r(o);
2384
+ s(l);
2365
2385
  break;
2366
2386
  }
2367
2387
  case BMAP_STATUS_UNKNOWN_LOCATION:
2368
- r([]);
2388
+ s([]);
2369
2389
  break;
2370
2390
  default:
2371
- s(new Error(`status: ${c}`));
2391
+ n(new Error(`status: ${o}`));
2372
2392
  break;
2373
2393
  }
2374
2394
  }
2375
2395
  });
2376
- t(n);
2396
+ r(a);
2397
+ });
2398
+ }
2399
+ }
2400
+ class Jt {
2401
+ constructor(e, t) {
2402
+ c(this, "onData");
2403
+ c(this, "onError");
2404
+ this.map = e, this.input = t;
2405
+ }
2406
+ /**
2407
+ * 设置搜索结果监听
2408
+ *
2409
+ * @mustCallSuper 子类必须调用一次`super.setSearchListener`, 用来保存{@link onData}和{@link onError}
2410
+ * */
2411
+ setSearchListener(e, t) {
2412
+ return this.onData && C("setSearchListener只能调用一次"), this.onData = e, this.onError = t, ge;
2413
+ }
2414
+ }
2415
+ class ei extends Jt {
2416
+ constructor(t, r) {
2417
+ super(t, r.input);
2418
+ c(this, "searchBox");
2419
+ this.searchBox = new google.maps.places.SearchBox(r.input), this.searchBox.bindTo("bounds", t.innerMap);
2420
+ }
2421
+ setSearchListener(t, r) {
2422
+ return super.setSearchListener(t, r), Nt(this.searchBox, "places_changed", () => {
2423
+ const s = this.searchBox.getPlaces();
2424
+ t((s ?? []).map((n) => Vt(n, this.map)));
2377
2425
  });
2378
2426
  }
2427
+ search() {
2428
+ this.input.value && (google.maps.event.trigger(this.input, "focus", {}), google.maps.event.trigger(this.input, "keydown", { keyCode: 13 }));
2429
+ }
2430
+ }
2431
+ class ti extends Jt {
2432
+ constructor(t, r) {
2433
+ super(t, r.input);
2434
+ c(this, "autocomplete");
2435
+ c(this, "placeService");
2436
+ this.autocomplete = t.createAutocomplete({ input: r.input, bindToMap: !0 }), this.placeService = t.createPlaceService({});
2437
+ }
2438
+ setSearchListener(t, r) {
2439
+ return super.setSearchListener(t, r), this.autocomplete.addResultListener((s) => {
2440
+ this.searchImpl(s.country + s.province + s.city + s.district + s.street + s.streetNumber + s.title);
2441
+ });
2442
+ }
2443
+ search() {
2444
+ this.input.value && this.searchImpl(this.input.value);
2445
+ }
2446
+ searchImpl(t) {
2447
+ this.placeService.search(t).then(this.onData, this.onError);
2448
+ }
2379
2449
  }
2380
- var Xr = /* @__PURE__ */ ((i) => (i[i.WORLD = 1] = "WORLD", i[i.STATE = 5] = "STATE", i[i.CITY = 10] = "CITY", i[i.STREET = 15] = "STREET", i[i.BUILDING = 20] = "BUILDING", i))(Xr || {});
2450
+ var ri = /* @__PURE__ */ ((i) => (i[i.WORLD = 1] = "WORLD", i[i.STATE = 5] = "STATE", i[i.CITY = 10] = "CITY", i[i.STREET = 15] = "STREET", i[i.BUILDING = 20] = "BUILDING", i))(ri || {});
2381
2451
  class et {
2382
2452
  constructor(e) {
2383
- d(this, "latestInfoWindow");
2453
+ c(this, "latestInfoWindow");
2384
2454
  /** 使用{@link setEventTargetDelegate}初始化 */
2385
- d(this, "delegate", void 0);
2455
+ c(this, "delegate", void 0);
2386
2456
  this.element = e, process.env.NODE_ENV !== "production" && setTimeout(() => {
2387
2457
  this.delegate || console.warn(`${this.constructor.name}继承了AbstractMap, 但未调用setEventTargetDelegate(delegate)`);
2388
2458
  });
@@ -2430,7 +2500,7 @@ class et {
2430
2500
  * Copyright (c) 2014-2017, Jon Schlinkert.
2431
2501
  * Released under the MIT License.
2432
2502
  */
2433
- function Jr(i) {
2503
+ function ii(i) {
2434
2504
  return i != null && typeof i == "object" && Array.isArray(i) === !1;
2435
2505
  }
2436
2506
  /*!
@@ -2439,58 +2509,58 @@ function Jr(i) {
2439
2509
  * Copyright (c) 2014-2017, Jon Schlinkert.
2440
2510
  * Released under the MIT License.
2441
2511
  */
2442
- function xt(i) {
2443
- return Jr(i) === !0 && Object.prototype.toString.call(i) === "[object Object]";
2512
+ function Et(i) {
2513
+ return ii(i) === !0 && Object.prototype.toString.call(i) === "[object Object]";
2444
2514
  }
2445
- function qt(i) {
2515
+ function Qt(i) {
2446
2516
  var e, t;
2447
- return !(xt(i) === !1 || (e = i.constructor, typeof e != "function") || (t = e.prototype, xt(t) === !1) || t.hasOwnProperty("isPrototypeOf") === !1);
2517
+ return !(Et(i) === !1 || (e = i.constructor, typeof e != "function") || (t = e.prototype, Et(t) === !1) || t.hasOwnProperty("isPrototypeOf") === !1);
2448
2518
  }
2449
- var me;
2519
+ var fe;
2450
2520
  ((i) => {
2451
2521
  function e(n, a) {
2452
- return n.reduce((c, o) => (c[a(o)] = o, c), {});
2522
+ return n.reduce((d, o) => (d[a(o)] = o, d), {});
2453
2523
  }
2454
2524
  i.fromArray = e;
2455
2525
  function t(n) {
2456
- return n.reduce((a, c) => (a[c[0]] = c[1], a), {});
2526
+ return n.reduce((a, d) => (a[d[0]] = d[1], a), {});
2457
2527
  }
2458
2528
  i.fromEntries = t;
2459
2529
  function r(n) {
2460
- return JSON.stringify(n, (a, c) => typeof c == "object" && Object.getPrototypeOf(c) !== Object.prototype ? c.toString !== Object.prototype.toString ? c.toString() : `[object ${Object.getPrototypeOf(c).constructor.name}]` : c);
2530
+ return JSON.stringify(n, (a, d) => typeof d == "object" && Object.getPrototypeOf(d) !== Object.prototype ? d.toString !== Object.prototype.toString ? d.toString() : `[object ${Object.getPrototypeOf(d).constructor.name}]` : d);
2461
2531
  }
2462
2532
  i.toJsonSafely = r;
2463
2533
  function s(n) {
2464
- qt(n) && Object.keys(n).forEach((a) => {
2534
+ Qt(n) && Object.keys(n).forEach((a) => {
2465
2535
  n[a] === void 0 ? delete n[a] : s(n[a]);
2466
2536
  });
2467
2537
  }
2468
2538
  i.deleteUndefinedPropertyOnPlainObjectDeeply = s;
2469
- })(me || (me = {}));
2470
- me.toJsonSafely;
2471
- const Qr = ["single", "multi"];
2539
+ })(fe || (fe = {}));
2540
+ fe.toJsonSafely;
2541
+ const si = ["single", "multi"];
2472
2542
  var D = /* @__PURE__ */ ((i) => (i.auto = "auto", i.none = "none", i.greedy = "greedy", i.cooperative = "cooperative", i))(D || {}), We;
2473
2543
  ((i) => {
2474
2544
  function e(t) {
2475
- me.deleteUndefinedPropertyOnPlainObjectDeeply(t);
2545
+ fe.deleteUndefinedPropertyOnPlainObjectDeeply(t);
2476
2546
  const r = { center: y.ZERO, zoom: 5 };
2477
- return St(r, t || {}, {
2478
- isMergeableObject: qt
2547
+ return At(r, t || {}, {
2548
+ isMergeableObject: Qt
2479
2549
  });
2480
2550
  }
2481
2551
  i.create = e;
2482
2552
  })(We || (We = {}));
2483
- class Kt {
2553
+ class er {
2484
2554
  constructor(e, t, r, s) {
2485
- d(this, "addEventListener");
2486
- d(this, "removeEventListener");
2555
+ c(this, "addEventListener");
2556
+ c(this, "removeEventListener");
2487
2557
  this.innerOverlay = e, this.coordType = t, this.map = r, this.delegate = s, this.delegate.setTarget(this), this.addEventListener = this.delegate.addEventListener, this.removeEventListener = this.delegate.removeEventListener;
2488
2558
  }
2489
2559
  remove() {
2490
2560
  this.map.removeOverlay(this);
2491
2561
  }
2492
2562
  }
2493
- class tt extends Kt {
2563
+ class tt extends er {
2494
2564
  constructor(e, t, r) {
2495
2565
  super(e, t, r, new ee(e, r));
2496
2566
  }
@@ -2501,7 +2571,7 @@ class tt extends Kt {
2501
2571
  this.innerOverlay.setVisible(e);
2502
2572
  }
2503
2573
  }
2504
- class Be extends Kt {
2574
+ class Be extends er {
2505
2575
  constructor(e, t, r) {
2506
2576
  super(e, t, r, new se(e, r));
2507
2577
  }
@@ -2624,7 +2694,7 @@ class nt extends it {
2624
2694
  return this.innerOverlay.getRadius();
2625
2695
  }
2626
2696
  }
2627
- function Xt() {
2697
+ function tr() {
2628
2698
  BMap.OverlayV3 || (BMap.OverlayV3 = BMap.Overlay);
2629
2699
  }
2630
2700
  var U;
@@ -2632,28 +2702,28 @@ var U;
2632
2702
  i.ZERO = { x: 0, y: 0 };
2633
2703
  })(U || (U = {}));
2634
2704
  let ze;
2635
- function ei(i, e, t, r, s, n) {
2636
- return ze || (ze = ti()), new ze(i, e, t, r, s, n);
2705
+ function ni(i, e, t, r, s, n) {
2706
+ return ze || (ze = oi()), new ze(i, e, t, r, s, n);
2637
2707
  }
2638
- function ti() {
2639
- Xt();
2708
+ function oi() {
2709
+ tr();
2640
2710
  const i = new BMap.Point(0, 0);
2641
2711
  return class extends BMap.OverlayV3 {
2642
- constructor(r, s = i, n = U.ZERO, a, c = 654, o = "") {
2712
+ constructor(r, s = i, n = U.ZERO, a, d = 654, o = "") {
2643
2713
  super();
2644
2714
  // 类表达式不能有私有成员, 故改成public
2645
- d(this, "container");
2646
- d(this, "border");
2647
- d(this, "inner");
2648
- d(this, "map");
2649
- d(this, "marker");
2715
+ c(this, "container");
2716
+ c(this, "border");
2717
+ c(this, "inner");
2718
+ c(this, "map");
2719
+ c(this, "marker");
2650
2720
  this.content = r, this.position = s, this.offset = n;
2651
2721
  const l = "baidu-info-box-container";
2652
2722
  this.container = document.createElement("div"), this.container.className = l, this.container.style.position = "absolute", this.border = document.createElement("div"), this.border.className = `${l}__border ${o}`, this.inner = document.createElement("div"), this.inner.className = l + "__inner";
2653
2723
  const h = document.createElement("img");
2654
2724
  h.className = l + "__close", h.src = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22%23000000%22%3E%0A%20%20%20%20%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%2F%3E%0A%20%20%20%20%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22%2F%3E%0A%3C%2Fsvg%3E%0A", h.addEventListener("click", () => {
2655
2725
  this.close(), this.dispatchEvent({ type: "onclickclose" });
2656
- }), this.inner.appendChild(r), this.border.appendChild(this.inner), this.border.appendChild(h), this.container.appendChild(this.border), a && this.setZIndex(a), this.setMaxWidth(c), this.onMarkerPositionChanged = this.onMarkerPositionChanged.bind(this);
2726
+ }), this.inner.appendChild(r), this.border.appendChild(this.inner), this.border.appendChild(h), this.container.appendChild(this.border), a && this.setZIndex(a), this.setMaxWidth(d), this.onMarkerPositionChanged = this.onMarkerPositionChanged.bind(this);
2657
2727
  }
2658
2728
  /** @override */
2659
2729
  initialize(r) {
@@ -2747,8 +2817,8 @@ class at extends ot {
2747
2817
  class lt extends ot {
2748
2818
  constructor(t, r) {
2749
2819
  super(new ee(t, r));
2750
- d(this, "eventHub", new zr());
2751
- d(this, "isOpened", !1);
2820
+ c(this, "eventHub", new Dr());
2821
+ c(this, "isOpened", !1);
2752
2822
  this.inner = t, this.map = r, t.addListener("closeclick", () => {
2753
2823
  this.isOpened = !1, this.eventHub.hasListener("close") && this.eventHub.notify({ type: "close", target: this });
2754
2824
  }), t.addListener("map_changed", () => {
@@ -2808,7 +2878,7 @@ class ht extends Be {
2808
2878
  }
2809
2879
  static create(e) {
2810
2880
  var s;
2811
- const t = this.coordType, r = ei(
2881
+ const t = this.coordType, r = ni(
2812
2882
  e.content,
2813
2883
  (s = e.position) == null ? void 0 : s.toBaidu(t),
2814
2884
  e.offset,
@@ -2851,8 +2921,8 @@ class ct extends ot {
2851
2921
  maxWidth: e.maxWidth
2852
2922
  }), s = e.borderClass;
2853
2923
  return s && r.addListener("domready", () => {
2854
- var c;
2855
- const a = (c = e.content.parentElement) == null ? void 0 : c.parentElement;
2924
+ var d;
2925
+ const a = (d = e.content.parentElement) == null ? void 0 : d.parentElement;
2856
2926
  a && a.className.includes("gm-style-iw-c") && !a.className.includes(s) && (a.className += ` ${s}`);
2857
2927
  }), new ct(r, t, this);
2858
2928
  }
@@ -2883,14 +2953,14 @@ class ct extends ot {
2883
2953
  }
2884
2954
  }
2885
2955
  let Ne;
2886
- function ri(i, e, t, r) {
2887
- return Ne || (Ne = ii()), new Ne(i, e, t, r);
2956
+ function ai(i, e, t, r) {
2957
+ return Ne || (Ne = li()), new Ne(i, e, t, r);
2888
2958
  }
2889
- function ii() {
2959
+ function li() {
2890
2960
  return class extends google.maps.OverlayView {
2891
2961
  constructor(t, r, s, n) {
2892
2962
  super();
2893
- d(this, "container");
2963
+ c(this, "container");
2894
2964
  this.position = r, this.offset = s, this.zIndex = n, this.container = document.createElement("div"), this.container.className = "label-container", this.container.style.position = "absolute", n && this.setZIndex(n), this.container.addEventListener("click", () => {
2895
2965
  google.maps.event.trigger(this, "click");
2896
2966
  }), this.setElement(t);
@@ -2904,7 +2974,7 @@ function ii() {
2904
2974
  }
2905
2975
  /** @override */
2906
2976
  onAdd() {
2907
- const t = this.getPanes() ?? x("onAdd回调中一定能够获取panes");
2977
+ const t = this.getPanes() ?? C("onAdd回调中一定能够获取panes");
2908
2978
  this.zIndex ? t.overlayMouseTarget.appendChild(this.container) : t.overlayLayer.appendChild(this.container);
2909
2979
  }
2910
2980
  /** @override */
@@ -2961,9 +3031,9 @@ var oe;
2961
3031
  class dt extends Be {
2962
3032
  constructor(t, r, s, n) {
2963
3033
  super(t, r, s);
2964
- d(this, "icon");
2965
- d(this, "content", void 0);
2966
- d(this, "contentObserver");
3034
+ c(this, "icon");
3035
+ c(this, "content", void 0);
3036
+ c(this, "contentObserver");
2967
3037
  this.setContentInternal(n, !0);
2968
3038
  }
2969
3039
  static create(t) {
@@ -3024,7 +3094,7 @@ class dt extends Be {
3024
3094
  class pt extends tt {
3025
3095
  static create(e) {
3026
3096
  var s;
3027
- const t = this.coordType, r = ri(
3097
+ const t = this.coordType, r = ai(
3028
3098
  oe.toElement(e.content),
3029
3099
  (s = e.position) == null ? void 0 : s.toGoogle(t),
3030
3100
  e.offset,
@@ -3075,7 +3145,7 @@ var ae;
3075
3145
  }
3076
3146
  i.toBaidu = t;
3077
3147
  })(ae || (ae = {}));
3078
- class fe extends Be {
3148
+ class ye extends Be {
3079
3149
  constructor(e, t, r, s) {
3080
3150
  super(e, t, r), this.state = s;
3081
3151
  }
@@ -3090,8 +3160,8 @@ class fe extends Be {
3090
3160
  draggingCursor: e.cursor
3091
3161
  }, n = new BMap.Marker(e.position.toBaidu(t), s);
3092
3162
  e.zIndex !== void 0 && n.setZIndex(e.zIndex);
3093
- const a = e.clickable === void 0 ? !0 : e.clickable, c = !!e.draggable;
3094
- return new fe(n, t, this, { clickable: a, draggable: c, zIndex: e.zIndex }).visibleOptionInternal(e.visible);
3163
+ const a = e.clickable === void 0 ? !0 : e.clickable, d = !!e.draggable;
3164
+ return new ye(n, t, this, { clickable: a, draggable: d, zIndex: e.zIndex }).visibleOptionInternal(e.visible);
3095
3165
  }
3096
3166
  getPosition() {
3097
3167
  return y.fromBaidu(this.innerOverlay.getPosition(), this.coordType);
@@ -3145,10 +3215,10 @@ class fe extends Be {
3145
3215
  class ut extends tt {
3146
3216
  constructor() {
3147
3217
  super(...arguments);
3148
- d(this, "label");
3149
- d(this, "labelPositionListener");
3150
- d(this, "labelVisibleListener");
3151
- d(this, "labelMapChangedListener");
3218
+ c(this, "label");
3219
+ c(this, "labelPositionListener");
3220
+ c(this, "labelVisibleListener");
3221
+ c(this, "labelMapChangedListener");
3152
3222
  }
3153
3223
  static create(t) {
3154
3224
  const r = this.coordType, s = t.icon, n = {
@@ -3310,24 +3380,24 @@ class yt extends it {
3310
3380
  }
3311
3381
  }
3312
3382
  const X = 1;
3313
- class si extends et {
3383
+ class hi extends et {
3314
3384
  constructor(t, r) {
3315
3385
  var s;
3316
3386
  super(t);
3317
- d(this, "buildInMapTypeId2BIMT");
3318
- d(this, "baiduMapType2BIMT");
3319
- d(this, "map");
3320
- d(this, "createLabel", dt.create);
3321
- d(this, "createCircle", st.create);
3322
- d(this, "createPolygon", gt.create);
3323
- d(this, "createPolyline", ft.create);
3324
- d(this, "createInfoWindow", at.create);
3325
- d(this, "createInfoBox", ht.create);
3326
- d(this, "createMarker", fe.create);
3327
- d(this, "createMapTypeControl", Ye.create);
3328
- d(this, "createZoomControl", Xe.create);
3329
- d(this, "createScaleControl", qe.create);
3330
- this.buildInMapTypeId2BIMT = I.BUILD_IN_MAP_TYPES.getValueMap(P.prototype.getId), this.baiduMapType2BIMT = I.BUILD_IN_MAP_TYPES.getValueMap(P.prototype.asBaiduMapType), this.map = new BMap.Map(t, {
3387
+ c(this, "buildInMapTypeId2BIMT");
3388
+ c(this, "baiduMapType2BIMT");
3389
+ c(this, "map");
3390
+ c(this, "createLabel", dt.create);
3391
+ c(this, "createCircle", st.create);
3392
+ c(this, "createPolygon", gt.create);
3393
+ c(this, "createPolyline", ft.create);
3394
+ c(this, "createInfoWindow", at.create);
3395
+ c(this, "createInfoBox", ht.create);
3396
+ c(this, "createMarker", ye.create);
3397
+ c(this, "createMapTypeControl", Ye.create);
3398
+ c(this, "createZoomControl", Xe.create);
3399
+ c(this, "createScaleControl", qe.create);
3400
+ this.buildInMapTypeId2BIMT = I.BUILD_IN_MAP_TYPES.getValueMap(k.prototype.getId), this.baiduMapType2BIMT = I.BUILD_IN_MAP_TYPES.getValueMap(k.prototype.asBaiduMapType), this.map = new BMap.Map(t, {
3331
3401
  minZoom: r.minZoom && r.minZoom + X,
3332
3402
  maxZoom: r.maxZoom && r.maxZoom + X,
3333
3403
  mapType: r.buildInMapTypeId && ((s = this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId)) == null ? void 0 : s.asBaiduMapType()),
@@ -3345,7 +3415,7 @@ class si extends et {
3345
3415
  this.innerMap.setDefaultCursor(t);
3346
3416
  }
3347
3417
  setGestureHandling(t = D.auto) {
3348
- switch (t === D.auto && (t = this.element.parentElement && Ze.isScrollable(this.element.parentElement) ? D.cooperative : D.greedy), t) {
3418
+ switch (t === D.auto && (t = this.element.parentElement && Ge.isScrollable(this.element.parentElement) ? D.cooperative : D.greedy), t) {
3349
3419
  case D.cooperative:
3350
3420
  this.map.disableScrollWheelZoom(), this.map.enableDragging(), this.map.enableDoubleClickZoom();
3351
3421
  break;
@@ -3413,14 +3483,14 @@ class si extends et {
3413
3483
  setBuildInMapTypeId(t) {
3414
3484
  var s;
3415
3485
  const r = (s = this.buildInMapTypeId2BIMT.get(t)) == null ? void 0 : s.asBaiduMapType();
3416
- this.map.setMapType(r ?? x("理论上来说不可能为空"));
3486
+ this.map.setMapType(r ?? C("理论上来说不可能为空"));
3417
3487
  }
3418
3488
  setMapType(t) {
3419
3489
  this.map.setMapType(t.asBaiduMapType());
3420
3490
  }
3421
3491
  getMapType() {
3422
3492
  const t = this.map.getMapType(), r = this.baiduMapType2BIMT.get(t);
3423
- return r || (t.__baidu_map_type__ ?? x("实现asBaiduMapType()时, 忘了给实例设置__baidu_map_type__?"));
3493
+ return r || (t.__baidu_map_type__ ?? C("实现asBaiduMapType()时, 忘了给实例设置__baidu_map_type__?"));
3424
3494
  }
3425
3495
  addLayer(t) {
3426
3496
  this.map.addTileLayer(t.asBaiduLayer());
@@ -3460,8 +3530,8 @@ class si extends et {
3460
3530
  const r = class extends BMap.Control {
3461
3531
  constructor() {
3462
3532
  super(...arguments);
3463
- d(this, "defaultAnchor", B.getBaidu().toValue(t.position));
3464
- d(this, "defaultOffset", new BMap.Size(0, 0));
3533
+ c(this, "defaultAnchor", B.getBaidu().toValue(t.position));
3534
+ c(this, "defaultOffset", new BMap.Size(0, 0));
3465
3535
  }
3466
3536
  initialize(n) {
3467
3537
  const a = t.onCreateElement();
@@ -3475,33 +3545,36 @@ class si extends et {
3475
3545
  t.inner && (pe(t.inner instanceof BMap.Control, `control.inner(${t.inner})需要是BMap.Control`), this.map.removeControl(t.inner));
3476
3546
  }
3477
3547
  createMarkerClusterer(t) {
3478
- return new Ur(this, t);
3548
+ return new Kr(this, t);
3479
3549
  }
3480
3550
  createAutocomplete(t) {
3481
- return new jr(this, t);
3551
+ return new Hr(this, t);
3552
+ }
3553
+ createSearchBox(t) {
3554
+ return new ti(this, t);
3482
3555
  }
3483
3556
  createPlaceService(t) {
3484
- return new Kr(this, t);
3557
+ return new Qr(this, t);
3485
3558
  }
3486
3559
  }
3487
- class ni extends et {
3560
+ class ci extends et {
3488
3561
  constructor(t, r) {
3489
3562
  var n;
3490
3563
  super(t);
3491
- d(this, "buildInMapTypeId2BIMT");
3492
- d(this, "googleMapTypeId2BIMT");
3493
- d(this, "map");
3494
- d(this, "createLabel", pt.create);
3495
- d(this, "createCircle", nt.create);
3496
- d(this, "createPolygon", mt.create);
3497
- d(this, "createPolyline", yt.create);
3498
- d(this, "createInfoWindow", lt.create);
3499
- d(this, "createInfoBox", ct.create);
3500
- d(this, "createMarker", ut.create);
3501
- d(this, "createMapTypeControl", Te.create);
3502
- d(this, "createZoomControl", Je.create);
3503
- d(this, "createScaleControl", Ke.create);
3504
- this.mapOptions = r, this.buildInMapTypeId2BIMT = I.BUILD_IN_MAP_TYPES.getValueMap(P.prototype.getId), this.googleMapTypeId2BIMT = I.BUILD_IN_MAP_TYPES.getValueMap(P.prototype.getGoogleMapTypeId);
3564
+ c(this, "buildInMapTypeId2BIMT");
3565
+ c(this, "googleMapTypeId2BIMT");
3566
+ c(this, "map");
3567
+ c(this, "createLabel", pt.create);
3568
+ c(this, "createCircle", nt.create);
3569
+ c(this, "createPolygon", mt.create);
3570
+ c(this, "createPolyline", yt.create);
3571
+ c(this, "createInfoWindow", lt.create);
3572
+ c(this, "createInfoBox", ct.create);
3573
+ c(this, "createMarker", ut.create);
3574
+ c(this, "createMapTypeControl", we.create);
3575
+ c(this, "createZoomControl", Je.create);
3576
+ c(this, "createScaleControl", Ke.create);
3577
+ this.mapOptions = r, this.buildInMapTypeId2BIMT = I.BUILD_IN_MAP_TYPES.getValueMap(k.prototype.getId), this.googleMapTypeId2BIMT = I.BUILD_IN_MAP_TYPES.getValueMap(k.prototype.getGoogleMapTypeId);
3505
3578
  const s = r.buildInMapTypeId && this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId);
3506
3579
  this.map = new google.maps.Map(t, {
3507
3580
  center: r.center.toGoogle((s ?? I.NORMAL).getGoogleCoordType()),
@@ -3533,20 +3606,20 @@ class ni extends et {
3533
3606
  const r = this.innerMap.getProjection(), s = this.innerMap.getBounds();
3534
3607
  if (r == null || s == null)
3535
3608
  return y.ZERO;
3536
- const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()), c = this.innerMap.getZoom();
3537
- if (n == null || a == null || c == null)
3609
+ const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()), d = this.innerMap.getZoom();
3610
+ if (n == null || a == null || d == null)
3538
3611
  return y.ZERO;
3539
- const o = Math.pow(2, c), l = new google.maps.Point(t.x / o + n.x, t.y / o + a.y);
3612
+ const o = Math.pow(2, d), l = new google.maps.Point(t.x / o + n.x, t.y / o + a.y);
3540
3613
  return y.fromGoogle(r.fromPointToLatLng(l) ?? te.LATLNG_ZERO, this.coordType);
3541
3614
  }
3542
3615
  fromLatLngToContainerPoint(t) {
3543
3616
  const r = this.innerMap.getProjection(), s = this.innerMap.getBounds();
3544
3617
  if (r == null || s == null)
3545
3618
  return U.ZERO;
3546
- const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()), c = this.innerMap.getZoom();
3547
- if (n == null || a == null || c == null)
3619
+ const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()), d = this.innerMap.getZoom();
3620
+ if (n == null || a == null || d == null)
3548
3621
  return U.ZERO;
3549
- const o = Math.pow(2, c), l = r.fromLatLngToPoint(t.toGoogle(this.coordType));
3622
+ const o = Math.pow(2, d), l = r.fromLatLngToPoint(t.toGoogle(this.coordType));
3550
3623
  return l == null ? U.ZERO : { x: (l.x - n.x) * o, y: (l.y - a.y) * o };
3551
3624
  }
3552
3625
  setDraggable(t) {
@@ -3573,14 +3646,14 @@ class ni extends et {
3573
3646
  setBuildInMapTypeId(t) {
3574
3647
  var s;
3575
3648
  const r = (s = this.buildInMapTypeId2BIMT.get(t)) == null ? void 0 : s.getGoogleMapTypeId();
3576
- this.map.setMapTypeId(r ?? x("理论上来说不可能为空"));
3649
+ this.map.setMapTypeId(r ?? C("理论上来说不可能为空"));
3577
3650
  }
3578
3651
  setMapType(t) {
3579
- t instanceof P ? this.map.setMapTypeId(t.getGoogleMapTypeId()) : (this.map.mapTypes.set(t.id, t.asGoogleMapType()), this.map.setMapTypeId(t.id));
3652
+ t instanceof k ? this.map.setMapTypeId(t.getGoogleMapTypeId()) : (this.map.mapTypes.set(t.id, t.asGoogleMapType()), this.map.setMapTypeId(t.id));
3580
3653
  }
3581
3654
  getMapType() {
3582
3655
  const t = this.map.getMapTypeId() ?? google.maps.MapTypeId.ROADMAP, r = this.googleMapTypeId2BIMT.get(t);
3583
- return r || (this.map.mapTypes.get(t).__google_map_type__ ?? x(`实现${t}的asGoogleMapType()时, 忘了给实例设置__google_map_type__?`));
3656
+ return r || (this.map.mapTypes.get(t).__google_map_type__ ?? C(`实现${t}的asGoogleMapType()时, 忘了给实例设置__google_map_type__?`));
3584
3657
  }
3585
3658
  addOverlayMapType(t) {
3586
3659
  this.map.overlayMapTypes.push(t.asGoogleMapType());
@@ -3629,24 +3702,27 @@ class ni extends et {
3629
3702
  }
3630
3703
  }
3631
3704
  createMarkerClusterer(t) {
3632
- return new Yr(this, t);
3705
+ return new Xr(this, t);
3633
3706
  }
3634
3707
  createAutocomplete(t) {
3635
- return new Gr(this, t);
3708
+ return new Vr(this, t);
3709
+ }
3710
+ createSearchBox(t) {
3711
+ return new ei(this, t);
3636
3712
  }
3637
3713
  createPlaceService(t) {
3638
- return new qr(this, t);
3714
+ return new Jr(this, t);
3639
3715
  }
3640
3716
  }
3641
- class oi extends et {
3717
+ class di extends et {
3642
3718
  constructor(t, r) {
3643
3719
  var a;
3644
3720
  super(t);
3645
- d(this, "map");
3646
- d(this, "defaultLayers");
3721
+ c(this, "map");
3722
+ c(this, "defaultLayers");
3647
3723
  this.mapOptions = r;
3648
- const s = $t().here;
3649
- Ce.includes(s.version) || x(`不支持${s.version}, HereMap当前只支持如下版本: ${Ce}`);
3724
+ const s = zt().here;
3725
+ Ce.includes(s.version) || C(`不支持${s.version}, HereMap当前只支持如下版本: ${Ce}`);
3650
3726
  const n = new H.service.Platform({
3651
3727
  app_id: s.key.split(",")[0],
3652
3728
  app_code: s.key.split(",")[1]
@@ -3777,6 +3853,9 @@ class oi extends et {
3777
3853
  createAutocomplete(t) {
3778
3854
  throw new Error("Method not implemented.");
3779
3855
  }
3856
+ createSearchBox(t) {
3857
+ throw new Error("Method not implemented.");
3858
+ }
3780
3859
  createPlaceService(t) {
3781
3860
  throw new Error("Method not implemented.");
3782
3861
  }
@@ -3787,28 +3866,28 @@ var $ = /* @__PURE__ */ ((i) => (i.google = "google", i.baidu = "baidu", i.here
3787
3866
  const n = We.create(s);
3788
3867
  switch (t) {
3789
3868
  case "google":
3790
- return new ni(r, n);
3869
+ return new ci(r, n);
3791
3870
  case "baidu":
3792
- return new si(r, n);
3871
+ return new hi(r, n);
3793
3872
  case "here":
3794
- return new oi(r, n);
3873
+ return new di(r, n);
3795
3874
  }
3796
3875
  }
3797
3876
  i.createMap = e;
3798
3877
  })(Ve || (Ve = {}));
3799
- function ai({ type: i, config: e }) {
3800
- const t = window, r = li(i);
3878
+ function pi({ type: i, config: e }) {
3879
+ const t = window, r = ui(i);
3801
3880
  if (t[r])
3802
3881
  return Promise.resolve();
3803
- switch (i !== $.here && !e.key && x(`请先配置${i}地图的key`), i) {
3882
+ switch (i !== $.here && !e.key && C(`请先配置${i}地图的key`), i) {
3804
3883
  case $.google:
3805
- return {}.VITE_FALSE ? (Zr({
3884
+ return {}.VITE_FALSE ? (Wr({
3806
3885
  key: e.key,
3807
3886
  v: "3.52"
3808
3887
  // v: config.version,
3809
- }), google.maps.importLibrary("core")) : Et(`https://maps.googleapis.com/maps/api/js?key=${e.key}&language=${e.language}&v=${e.version}&libraries=${e.libraries.join(",")}`);
3888
+ }), google.maps.importLibrary("core")) : Lt(`https://maps.googleapis.com/maps/api/js?key=${e.key}&language=${e.language}&v=${e.version}&libraries=${e.libraries.join(",")}`);
3810
3889
  case $.baidu:
3811
- return Et(`https://api.map.baidu.com/api?v=${e.version}&ak=${e.key}`);
3890
+ return Lt(`https://api.map.baidu.com/api?v=${e.version}&ak=${e.key}`);
3812
3891
  case $.here:
3813
3892
  return ce(he("core", e.version)).then(() => Promise.all([
3814
3893
  // 其他大多数模块都可以同时载入
@@ -3824,7 +3903,7 @@ function ai({ type: i, config: e }) {
3824
3903
  function he(i, e = Ce[0]) {
3825
3904
  return `https://js.api.here.com/v3/${e}/mapsjs-${i}.js`;
3826
3905
  }
3827
- function li(i) {
3906
+ function ui(i) {
3828
3907
  switch (i) {
3829
3908
  case $.google:
3830
3909
  return "google";
@@ -3834,10 +3913,10 @@ function li(i) {
3834
3913
  return "H";
3835
3914
  }
3836
3915
  }
3837
- let hi = 0;
3838
- function Et(i, e = "callback") {
3916
+ let gi = 0;
3917
+ function Lt(i, e = "callback") {
3839
3918
  return new Promise((t, r) => {
3840
- const s = `__callback${hi++}`;
3919
+ const s = `__callback${gi++}`;
3841
3920
  window[s] = t;
3842
3921
  const n = document.createElement("script");
3843
3922
  n.src = `${i}&${e}=${s}`, n.onerror = r, document.body.appendChild(n);
@@ -3849,7 +3928,7 @@ function ce(i) {
3849
3928
  r.src = i, r.onload = e, r.onerror = t, document.body.appendChild(r);
3850
3929
  });
3851
3930
  }
3852
- var ke;
3931
+ var Pe;
3853
3932
  ((i) => {
3854
3933
  function e(s, n) {
3855
3934
  if (s !== void 0)
@@ -3863,25 +3942,25 @@ var ke;
3863
3942
  }
3864
3943
  i.trimIndent = t;
3865
3944
  function r(s) {
3866
- return s.replace(/([^A-Z]?)([A-Z])/g, (n, a, c) => a ? `${a}-${c.toLowerCase()}` : c.toLowerCase());
3945
+ return s.replace(/([^A-Z]?)([A-Z])/g, (n, a, d) => a ? `${a}-${d.toLowerCase()}` : d.toLowerCase());
3867
3946
  }
3868
3947
  i.pascal2kebab = r;
3869
- })(ke || (ke = {}));
3870
- const ci = {
3948
+ })(Pe || (Pe = {}));
3949
+ const mi = {
3871
3950
  /** @see https://nodejs.org/docs/v10.3.0/api/path.html#path_path_basename_path_ext */
3872
3951
  basename(i, e) {
3873
3952
  const t = i.endsWith("/") ? i.slice(0, -1) : i, r = t.lastIndexOf("/"), s = r >= 0 ? t.substring(r + 1) : t;
3874
3953
  return e && s.endsWith(e) ? s.slice(0, -e.length) : s;
3875
3954
  }
3876
3955
  };
3877
- function Z(i, e) {
3956
+ function G(i, e) {
3878
3957
  return {
3879
3958
  type: String,
3880
3959
  default: e,
3881
3960
  validator: (t) => Object.values(i).includes(t)
3882
3961
  };
3883
3962
  }
3884
- function di(i, e) {
3963
+ function fi(i, e) {
3885
3964
  return {
3886
3965
  type: String,
3887
3966
  default: e,
@@ -3900,7 +3979,7 @@ function f(i, e) {
3900
3979
  default: e
3901
3980
  };
3902
3981
  }
3903
- function ts(i) {
3982
+ function os(i) {
3904
3983
  const e = {};
3905
3984
  return Object.entries(i).forEach(([t, r]) => {
3906
3985
  const s = `__${t}`;
@@ -3920,34 +3999,34 @@ function ts(i) {
3920
3999
  const de = {
3921
4000
  enumerable: !0,
3922
4001
  configurable: !0,
3923
- get: we,
3924
- set: we
4002
+ get: ge,
4003
+ set: ge
3925
4004
  };
3926
- function pi(i) {
4005
+ function yi(i) {
3927
4006
  return Object.keys(i).forEach((e) => {
3928
4007
  const t = i[e];
3929
4008
  let r = !1;
3930
- typeof t == "function" ? (de.get = t, de.set = we, r = !0) : typeof t == "object" && typeof t.get == "function" && (de.get = t.get, de.set = t.set, r = !0), r && (i[e] = Object.defineProperty(i, e, de));
4009
+ typeof t == "function" ? (de.get = t, de.set = ge, r = !0) : typeof t == "object" && typeof t.get == "function" && (de.get = t.get, de.set = t.set, r = !0), r && (i[e] = Object.defineProperty(i, e, de));
3931
4010
  }), i;
3932
4011
  }
3933
- function rs(i) {
3934
- return pi(i);
4012
+ function as(i) {
4013
+ return yi(i);
3935
4014
  }
3936
- function Jt() {
4015
+ function rr() {
3937
4016
  return Re();
3938
4017
  }
3939
- function be(i, e) {
4018
+ function Te(i, e) {
3940
4019
  const t = i.$options[e];
3941
4020
  if (t)
3942
4021
  for (const r of t)
3943
4022
  r.call(i);
3944
4023
  }
3945
- function is(i, e) {
4024
+ function ls(i, e) {
3946
4025
  for (const t of i)
3947
4026
  if (t.$options.name === e.name)
3948
4027
  return t;
3949
4028
  }
3950
- function ss(i, e) {
4029
+ function hs(i, e) {
3951
4030
  if (!i.default)
3952
4031
  return;
3953
4032
  const t = i.default();
@@ -3955,12 +4034,12 @@ function ss(i, e) {
3955
4034
  if ((r == null ? void 0 : r.type).name === e.name)
3956
4035
  return r;
3957
4036
  }
3958
- function ui(i, e) {
4037
+ function vi(i, e) {
3959
4038
  const t = {}, r = {}, s = {};
3960
4039
  return Object.keys(i).forEach((n) => {
3961
- n.startsWith("on") ? t[ke.pascal2kebab(n.substring(2))] = i[n] : r[n] = i[n];
4040
+ n.startsWith("on") ? t[Pe.pascal2kebab(n.substring(2))] = i[n] : r[n] = i[n];
3962
4041
  }), e && Object.keys(e).forEach((n) => {
3963
- n.startsWith("on") && (s[ke.pascal2kebab(n.substring(2))] = e[n]);
4042
+ n.startsWith("on") && (s[Pe.pascal2kebab(n.substring(2))] = e[n]);
3964
4043
  }), {
3965
4044
  /** class/style/未声明的属性 等 */
3966
4045
  binds: r,
@@ -3971,12 +4050,12 @@ function ui(i, e) {
3971
4050
  };
3972
4051
  }
3973
4052
  function q(i, e) {
3974
- return kt(() => ui(i, e));
4053
+ return kt(() => vi(i, e));
3975
4054
  }
3976
4055
  function R() {
3977
4056
  return Function;
3978
4057
  }
3979
- const ns = {
4058
+ const cs = {
3980
4059
  /**
3981
4060
  * @event 一般来说传{@link Tg.Event}对象, 但传其他对象也不会报错
3982
4061
  */
@@ -3987,23 +4066,23 @@ const ns = {
3987
4066
  eventLogLess(i) {
3988
4067
  ((i && i.type) !== this.$_prev_type || Date.now() - (this.$_prev_time ?? 0) > 1e3) && this.eventLog(i);
3989
4068
  }
3990
- }, vt = "$map", ye = "onCreate", ve = "onDestroy", L = C({
4069
+ }, vt = "$map", ve = "onCreate", _e = "onDestroy", L = x({
3991
4070
  inject: [vt],
3992
4071
  mounted() {
3993
- be(this, ye);
4072
+ Te(this, ve);
3994
4073
  },
3995
4074
  beforeUnmount() {
3996
- be(this, ve);
4075
+ Te(this, _e);
3997
4076
  },
3998
4077
  methods: {
3999
4078
  recreate() {
4000
- be(this, ve), be(this, ye);
4079
+ Te(this, _e), Te(this, ve);
4001
4080
  }
4002
4081
  },
4003
4082
  render() {
4004
- return Jt();
4083
+ return rr();
4005
4084
  }
4006
- }), gi = C({
4085
+ }), _i = x({
4007
4086
  name: "tg-map",
4008
4087
  provide() {
4009
4088
  return {
@@ -4013,7 +4092,7 @@ const ns = {
4013
4092
  inheritAttrs: !1,
4014
4093
  props: {
4015
4094
  /** type没做响应式, 但外部可以把type作为tg-map的key, 让type修改时完全重建tg-map */
4016
- type: Z($, $.google),
4095
+ type: G($, $.google),
4017
4096
  /**
4018
4097
  * 当对该属性使用双向绑定时, 改变center将触发update:center又反过来触发center改变, 最终导致无限循环...
4019
4098
  * 当前通过setCenter()时判断center是否有改变来避免该问题, 但为了避免可能存在的问题, 另外设计了如下机制:
@@ -4040,12 +4119,12 @@ const ns = {
4040
4119
  */
4041
4120
  lastCenter: f(y),
4042
4121
  zoom: N(Number),
4043
- infoWindowMode: di(Qr),
4044
- gestureHandling: Z(D),
4122
+ infoWindowMode: fi(si),
4123
+ gestureHandling: G(D),
4045
4124
  minZoom: f(Number),
4046
4125
  maxZoom: f(Number),
4047
4126
  mapStyle: f(Object),
4048
- mapTypeId: Z(Rt),
4127
+ mapTypeId: G(Gt),
4049
4128
  /** 地图类型对象, 优先级比mapTypeId高 */
4050
4129
  mapType: f(Object),
4051
4130
  hideLogo: f(Boolean),
@@ -4068,13 +4147,13 @@ const ns = {
4068
4147
  },
4069
4148
  data() {
4070
4149
  return {
4071
- map: Ge(),
4150
+ map: Ze(),
4072
4151
  isDestroyed: !1
4073
4152
  };
4074
4153
  },
4075
4154
  computed: {
4076
4155
  propsJson() {
4077
- return me.toJsonSafely(this.$props);
4156
+ return fe.toJsonSafely(this.$props);
4078
4157
  }
4079
4158
  },
4080
4159
  watch: {
@@ -4113,7 +4192,7 @@ const ns = {
4113
4192
  async mounted() {
4114
4193
  const i = this.type;
4115
4194
  try {
4116
- await ai({ type: i, config: $t()[i] });
4195
+ await pi({ type: i, config: zt()[i] });
4117
4196
  } catch (s) {
4118
4197
  this.$emit("error", s);
4119
4198
  return;
@@ -4137,7 +4216,7 @@ const ns = {
4137
4216
  buildInMapTypeId: this.mapTypeId
4138
4217
  }
4139
4218
  );
4140
- if (this.map = nr(e), this.mapType && e.setMapType(this.mapType), "ready" in this.attrs.listeners && console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"), Y(
4219
+ if (this.map = hr(e), this.mapType && e.setMapType(this.mapType), "ready" in this.attrs.listeners && console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"), Y(
4141
4220
  this.attrs.listeners,
4142
4221
  e,
4143
4222
  /* excludes: */
@@ -4170,9 +4249,9 @@ const W = (i, e) => {
4170
4249
  t[r] = s;
4171
4250
  return t;
4172
4251
  };
4173
- function mi(i, e, t, r, s, n) {
4174
- return G(), j("div", le({ class: "tg-map" }, i.attrs.binds), [
4175
- or("div", {
4252
+ function Mi(i, e, t, r, s, n) {
4253
+ return Z(), j("div", le({ class: "tg-map" }, i.attrs.binds), [
4254
+ cr("div", {
4176
4255
  ref: "map",
4177
4256
  class: Ie({
4178
4257
  "tg-map__map": !0,
@@ -4184,8 +4263,8 @@ function mi(i, e, t, r, s, n) {
4184
4263
  z(i.$slots, "overlay")
4185
4264
  ], 16);
4186
4265
  }
4187
- const fi = /* @__PURE__ */ W(gi, [["render", mi]]);
4188
- function yi(i) {
4266
+ const bi = /* @__PURE__ */ W(_i, [["render", Mi]]);
4267
+ function Ti(i) {
4189
4268
  if (i == null)
4190
4269
  return;
4191
4270
  let e;
@@ -4196,7 +4275,7 @@ function yi(i) {
4196
4275
  e = i;
4197
4276
  return `${e}px`;
4198
4277
  }
4199
- const vi = C({
4278
+ const wi = x({
4200
4279
  name: "tg-map-widget",
4201
4280
  props: {
4202
4281
  left: {
@@ -4222,22 +4301,22 @@ const vi = C({
4222
4301
  }
4223
4302
  },
4224
4303
  methods: {
4225
- dimen: yi
4304
+ dimen: Ti
4226
4305
  }
4227
4306
  });
4228
- function _i(i, e, t, r, s, n) {
4229
- return G(), j("div", {
4307
+ function Oi(i, e, t, r, s, n) {
4308
+ return Z(), j("div", {
4230
4309
  class: Ie(i.$options.name),
4231
- style: ar({ left: i.dimen(i.left), top: i.dimen(i.topValue), right: i.dimen(i.right), bottom: i.dimen(i.bottom) })
4310
+ style: dr({ left: i.dimen(i.left), top: i.dimen(i.topValue), right: i.dimen(i.right), bottom: i.dimen(i.bottom) })
4232
4311
  }, [
4233
4312
  z(i.$slots, "default")
4234
4313
  ], 6);
4235
4314
  }
4236
- const os = /* @__PURE__ */ W(vi, [["render", _i]]), Mi = C({
4315
+ const ds = /* @__PURE__ */ W(wi, [["render", Oi]]), Ci = x({
4237
4316
  name: "tg-custom-control",
4238
4317
  mixins: [L],
4239
4318
  props: {
4240
- position: Z(k, k.RIGHT_BOTTOM)
4319
+ position: G(P, P.RIGHT_BOTTOM)
4241
4320
  },
4242
4321
  setup() {
4243
4322
  return {
@@ -4250,8 +4329,8 @@ const os = /* @__PURE__ */ W(vi, [["render", _i]]), Mi = C({
4250
4329
  }
4251
4330
  },
4252
4331
  onCreate() {
4253
- _e(this.$parent, fi) || console.warn("请将tg-custom-control放到tg-map中");
4254
- const { $el: i } = this, e = class extends Rr {
4332
+ Me(this.$parent, bi) || console.warn("请将tg-custom-control放到tg-map中");
4333
+ const { $el: i } = this, e = class extends Zr {
4255
4334
  onCreateElement() {
4256
4335
  return i;
4257
4336
  }
@@ -4262,19 +4341,19 @@ const os = /* @__PURE__ */ W(vi, [["render", _i]]), Mi = C({
4262
4341
  this.$map.removeCustomControl(this.control);
4263
4342
  }
4264
4343
  });
4265
- function bi(i, e, t, r, s, n) {
4266
- return G(), j("div", {
4344
+ function xi(i, e, t, r, s, n) {
4345
+ return Z(), j("div", {
4267
4346
  class: Ie(i.$options.name)
4268
4347
  }, [
4269
4348
  z(i.$slots, "default")
4270
4349
  ], 2);
4271
4350
  }
4272
- const as = /* @__PURE__ */ W(Mi, [["render", bi]]), ls = C({
4351
+ const ps = /* @__PURE__ */ W(Ci, [["render", xi]]), us = x({
4273
4352
  name: "tg-map-type-control",
4274
4353
  mixins: [L],
4275
4354
  props: {
4276
- position: Z(k, k.TOP_LEFT),
4277
- type: Z(Dt),
4355
+ position: G(P, P.TOP_LEFT),
4356
+ type: G(Zt),
4278
4357
  mapTypes: f(Array)
4279
4358
  },
4280
4359
  setup() {
@@ -4302,11 +4381,11 @@ const as = /* @__PURE__ */ W(Mi, [["render", bi]]), ls = C({
4302
4381
  onDestroy() {
4303
4382
  this.$map.removeControl(this.control);
4304
4383
  }
4305
- }), hs = C({
4384
+ }), gs = x({
4306
4385
  name: "tg-scale-control",
4307
4386
  mixins: [L],
4308
4387
  props: {
4309
- position: Z(k, k.BOTTOM_RIGHT)
4388
+ position: G(P, P.BOTTOM_RIGHT)
4310
4389
  },
4311
4390
  setup() {
4312
4391
  return {
@@ -4325,32 +4404,32 @@ const as = /* @__PURE__ */ W(Mi, [["render", bi]]), ls = C({
4325
4404
  this.$map.removeControl(this.control);
4326
4405
  }
4327
4406
  });
4328
- function Qt() {
4407
+ function ir() {
4329
4408
  var t;
4330
- const i = (t = lr()) == null ? void 0 : t.type;
4409
+ const i = (t = pr()) == null ? void 0 : t.type;
4331
4410
  let e = (i == null ? void 0 : i.name) ?? (i == null ? void 0 : i.__name);
4332
4411
  if (!e) {
4333
4412
  const r = i == null ? void 0 : i.__file;
4334
- r && (e = ci.basename(r, ".vue"));
4413
+ r && (e = mi.basename(r, ".vue"));
4335
4414
  }
4336
4415
  return e;
4337
4416
  }
4338
- function Ti() {
4339
- const i = hr(vt);
4417
+ function Ei() {
4418
+ const i = ur(vt);
4340
4419
  let e, t;
4341
- return i == null && x(`<${Qt() || "unknown"}>必须作为<tg-map>的子代组件`), {
4420
+ return i == null && C(`<${ir() || "unknown"}>必须作为<tg-map>的子代组件`), {
4342
4421
  mapRef: i,
4343
4422
  /** 读取map对象, 只要放在<tg-map>里面的组件(除#overlay插槽外)都能够立即读取到map对象 */
4344
4423
  get map() {
4345
- return i.value ?? x("map尚未初始化");
4424
+ return i.value ?? C("map尚未初始化");
4346
4425
  },
4347
4426
  /** 地图元素创建回调 */
4348
- [ye](r) {
4349
- cr(r), e && x(`${ye}只能调用一次`), e = r;
4427
+ [ve](r) {
4428
+ gr(r), e && C(`${ve}只能调用一次`), e = r;
4350
4429
  },
4351
4430
  /** 地图元素销毁回调 */
4352
- [ve](r) {
4353
- dr(r), t && x(`${ve}只能调用一次`), t = r;
4431
+ [_e](r) {
4432
+ mr(r), t && C(`${_e}只能调用一次`), t = r;
4354
4433
  },
4355
4434
  /** 重新创建地图元素 */
4356
4435
  recreate() {
@@ -4358,23 +4437,23 @@ function Ti() {
4358
4437
  }
4359
4438
  };
4360
4439
  }
4361
- const cs = C({
4440
+ const ms = x({
4362
4441
  name: "tg-zoom-control",
4363
4442
  props: {
4364
- position: Z(k, k.RIGHT_BOTTOM)
4443
+ position: G(P, P.RIGHT_BOTTOM)
4365
4444
  },
4366
4445
  setup(i) {
4367
4446
  let e = void 0;
4368
- const { map: t, onCreate: r, onDestroy: s } = Ti();
4447
+ const { map: t, onCreate: r, onDestroy: s } = Ei();
4369
4448
  return r(() => {
4370
4449
  e = t.createZoomControl(i), t.addControl(e);
4371
4450
  }), s(() => {
4372
4451
  t.removeControl(e);
4373
- }), pr(() => i.position, (n) => {
4452
+ }), fr(() => i.position, (n) => {
4374
4453
  e.setPosition(n);
4375
- }), Jt;
4454
+ }), rr;
4376
4455
  }
4377
- }), Oi = C({
4456
+ }), Li = x({
4378
4457
  name: "tg-marker-clusterer",
4379
4458
  mixins: [L],
4380
4459
  // markers从this.$children中读取, 故需要省略(Omit)
@@ -4438,14 +4517,14 @@ const cs = C({
4438
4517
  }
4439
4518
  }
4440
4519
  });
4441
- function wi(i, e, t, r, s, n) {
4442
- return G(), j("div", {
4520
+ function Pi(i, e, t, r, s, n) {
4521
+ return Z(), j("div", {
4443
4522
  class: Ie(i.$options.name)
4444
4523
  }, [
4445
4524
  z(i.$slots, "default")
4446
4525
  ], 2);
4447
4526
  }
4448
- const Ci = /* @__PURE__ */ W(Oi, [["render", wi]]), ds = C({
4527
+ const ki = /* @__PURE__ */ W(Li, [["render", Pi]]), fs = x({
4449
4528
  name: "tg-traffic-layer",
4450
4529
  mixins: [L],
4451
4530
  // 请直接使用v-if来控制它的显隐
@@ -4458,12 +4537,12 @@ const Ci = /* @__PURE__ */ W(Oi, [["render", wi]]), ds = C({
4458
4537
  },
4459
4538
  watch: {},
4460
4539
  onCreate() {
4461
- this.layer = new Dr(), this.$map.addLayer(this.layer);
4540
+ this.layer = new jr(), this.$map.addLayer(this.layer);
4462
4541
  },
4463
4542
  onDestroy() {
4464
4543
  this.$map.removeLayer(this.layer);
4465
4544
  }
4466
- }), ps = C({
4545
+ }), ys = x({
4467
4546
  name: "tg-circle",
4468
4547
  mixins: [L],
4469
4548
  inheritAttrs: !1,
@@ -4525,13 +4604,13 @@ const Ci = /* @__PURE__ */ W(Oi, [["render", wi]]), ds = C({
4525
4604
  }
4526
4605
  });
4527
4606
  var He = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overlayMouseTarget = "overlayMouseTarget", i.float = "float", i))(He || {});
4528
- class xi {
4607
+ class Ii {
4529
4608
  constructor(e, t) {
4530
- d(this, "baidu");
4531
- d(this, "google");
4532
- d(this, "projection");
4533
- d(this, "element", void 0);
4534
- d(this, "mapPane");
4609
+ c(this, "baidu");
4610
+ c(this, "google");
4611
+ c(this, "projection");
4612
+ c(this, "element", void 0);
4613
+ c(this, "mapPane");
4535
4614
  this.map = e, this.mapPane = t.mapPane;
4536
4615
  }
4537
4616
  create() {
@@ -4546,23 +4625,23 @@ class xi {
4546
4625
  asBaidu() {
4547
4626
  if (!this.baidu) {
4548
4627
  const e = this;
4549
- Xt();
4628
+ tr();
4550
4629
  class t extends BMap.OverlayV3 {
4551
4630
  initialize(n) {
4552
- const a = e.create(), c = n.getPanes();
4631
+ const a = e.create(), d = n.getPanes();
4553
4632
  let o;
4554
4633
  switch (e.mapPane) {
4555
4634
  case "float":
4556
- o = c.floatPane;
4635
+ o = d.floatPane;
4557
4636
  break;
4558
4637
  case "overlayMouseTarget":
4559
- o = c.markerMouseTarget;
4638
+ o = d.markerMouseTarget;
4560
4639
  break;
4561
4640
  case "overlay":
4562
- o = c.markerPane;
4641
+ o = d.markerPane;
4563
4642
  break;
4564
4643
  case "map":
4565
- o = c.mapPane;
4644
+ o = d.mapPane;
4566
4645
  break;
4567
4646
  default:
4568
4647
  De(e.mapPane);
@@ -4592,7 +4671,7 @@ class xi {
4592
4671
  const e = this;
4593
4672
  class t extends google.maps.OverlayView {
4594
4673
  onAdd() {
4595
- const s = e.create(), n = this.getPanes() ?? x("onAdd回调中一定会有panes");
4674
+ const s = e.create(), n = this.getPanes() ?? C("onAdd回调中一定会有panes");
4596
4675
  let a;
4597
4676
  switch (e.mapPane) {
4598
4677
  case "float":
@@ -4633,7 +4712,7 @@ class xi {
4633
4712
  return this.google;
4634
4713
  }
4635
4714
  }
4636
- class Ei extends xi {
4715
+ class Bi extends Ii {
4637
4716
  constructor(e, t, r, s) {
4638
4717
  super(e, t), this.content = r, this.position = s;
4639
4718
  }
@@ -4648,11 +4727,11 @@ class Ei extends xi {
4648
4727
  this.position = e, this.draw();
4649
4728
  }
4650
4729
  }
4651
- const Li = C({
4730
+ const Si = x({
4652
4731
  name: "tg-element-overlay",
4653
4732
  mixins: [L],
4654
4733
  props: {
4655
- mapPane: Z(He, He.overlayMouseTarget),
4734
+ mapPane: G(He, He.overlayMouseTarget),
4656
4735
  position: N(y)
4657
4736
  },
4658
4737
  setup() {
@@ -4674,20 +4753,20 @@ const Li = C({
4674
4753
  }
4675
4754
  },
4676
4755
  onCreate() {
4677
- this.overlay = new Ei(this.$map, this, this.content(), this.position), this.$map.addElementOverlay(this.overlay);
4756
+ this.overlay = new Bi(this.$map, this, this.content(), this.position), this.$map.addElementOverlay(this.overlay);
4678
4757
  },
4679
4758
  onDestroy() {
4680
4759
  this.$map.removeElementOverlay(this.overlay);
4681
4760
  }
4682
4761
  });
4683
- function ki(i, e, t, r, s, n) {
4684
- return G(), j("div", le({
4762
+ function Ai(i, e, t, r, s, n) {
4763
+ return Z(), j("div", le({
4685
4764
  class: i.$options.name
4686
4765
  }, i.$attrs), [
4687
4766
  z(i.$slots, "default")
4688
4767
  ], 16);
4689
4768
  }
4690
- const us = /* @__PURE__ */ W(Li, [["render", ki]]), Pi = C({
4769
+ const vs = /* @__PURE__ */ W(Si, [["render", Ai]]), $i = x({
4691
4770
  name: "tg-marker",
4692
4771
  mixins: [L],
4693
4772
  inheritAttrs: !1,
@@ -4706,8 +4785,8 @@ const us = /* @__PURE__ */ W(Li, [["render", ki]]), Pi = C({
4706
4785
  return {
4707
4786
  attrs: q(e),
4708
4787
  marker: void 0,
4709
- label: Ge(),
4710
- info: Ge()
4788
+ label: Ze(),
4789
+ info: Ze()
4711
4790
  };
4712
4791
  },
4713
4792
  watch: {
@@ -4721,7 +4800,7 @@ const us = /* @__PURE__ */ W(Li, [["render", ki]]), Pi = C({
4721
4800
  i ? this.marker.setIcon(i) : this.recreate();
4722
4801
  },
4723
4802
  clickable(i) {
4724
- this.marker instanceof fe ? this.recreate() : this.marker.setClickable(i);
4803
+ this.marker instanceof ye ? this.recreate() : this.marker.setClickable(i);
4725
4804
  },
4726
4805
  draggable(i) {
4727
4806
  this.marker.setDraggable(i);
@@ -4733,7 +4812,7 @@ const us = /* @__PURE__ */ W(Li, [["render", ki]]), Pi = C({
4733
4812
  this.recreate();
4734
4813
  },
4735
4814
  zIndex(i) {
4736
- this.marker instanceof fe ? this.recreate() : this.marker.setZIndex(i);
4815
+ this.marker instanceof ye ? this.recreate() : this.marker.setZIndex(i);
4737
4816
  },
4738
4817
  visible(i) {
4739
4818
  this.marker.setVisible(i);
@@ -4747,7 +4826,7 @@ const us = /* @__PURE__ */ W(Li, [["render", ki]]), Pi = C({
4747
4826
  },
4748
4827
  methods: {
4749
4828
  $clusterer() {
4750
- return _e(this.$parent, Ci);
4829
+ return Me(this.$parent, ki);
4751
4830
  },
4752
4831
  onAddLabel(i) {
4753
4832
  this.label = i, this.marker && this.marker.setLabel(i.overlay);
@@ -4766,14 +4845,14 @@ const us = /* @__PURE__ */ W(Li, [["render", ki]]), Pi = C({
4766
4845
  }
4767
4846
  }
4768
4847
  });
4769
- function Ii(i, e, t, r, s, n) {
4770
- return G(), j("div", le({
4848
+ function zi(i, e, t, r, s, n) {
4849
+ return Z(), j("div", le({
4771
4850
  class: i.$options.name
4772
4851
  }, i.attrs.binds), [
4773
4852
  z(i.$slots, "default")
4774
4853
  ], 16);
4775
4854
  }
4776
- const _t = /* @__PURE__ */ W(Pi, [["render", Ii]]), Bi = C({
4855
+ const _t = /* @__PURE__ */ W($i, [["render", zi]]), Ni = x({
4777
4856
  name: "tg-info-box",
4778
4857
  mixins: [L],
4779
4858
  inheritAttrs: !1,
@@ -4836,7 +4915,7 @@ const _t = /* @__PURE__ */ W(Pi, [["render", Ii]]), Bi = C({
4836
4915
  return this.$el;
4837
4916
  },
4838
4917
  $marker() {
4839
- return _e(this.$parent, _t);
4918
+ return Me(this.$parent, _t);
4840
4919
  },
4841
4920
  open(i) {
4842
4921
  this.overlay.open(i);
@@ -4846,14 +4925,14 @@ const _t = /* @__PURE__ */ W(Pi, [["render", Ii]]), Bi = C({
4846
4925
  }
4847
4926
  }
4848
4927
  });
4849
- function Si(i, e, t, r, s, n) {
4850
- return G(), j("div", le({
4928
+ function Ri(i, e, t, r, s, n) {
4929
+ return Z(), j("div", le({
4851
4930
  class: i.$options.name
4852
4931
  }, i.attrs.binds), [
4853
4932
  z(i.$slots, "default")
4854
4933
  ], 16);
4855
4934
  }
4856
- const gs = /* @__PURE__ */ W(Bi, [["render", Si]]), Ai = C({
4935
+ const _s = /* @__PURE__ */ W(Ni, [["render", Ri]]), Di = x({
4857
4936
  name: "tg-info-window",
4858
4937
  mixins: [L],
4859
4938
  inheritAttrs: !1,
@@ -4892,7 +4971,7 @@ const gs = /* @__PURE__ */ W(Bi, [["render", Si]]), Ai = C({
4892
4971
  return this.$el;
4893
4972
  },
4894
4973
  $marker() {
4895
- return _e(this.$parent, _t);
4974
+ return Me(this.$parent, _t);
4896
4975
  },
4897
4976
  getOptions() {
4898
4977
  return {
@@ -4915,16 +4994,16 @@ const gs = /* @__PURE__ */ W(Bi, [["render", Si]]), Ai = C({
4915
4994
  this.$marker() ? this.$marker().onRemoveInfo(this) : this.overlay.close();
4916
4995
  }
4917
4996
  });
4918
- function $i(i, e, t, r, s, n) {
4919
- return ur((G(), j("div", le({
4997
+ function Gi(i, e, t, r, s, n) {
4998
+ return yr((Z(), j("div", le({
4920
4999
  class: i.$options.name
4921
5000
  }, i.attrs.binds), [
4922
5001
  z(i.$slots, "default")
4923
5002
  ], 16)), [
4924
- [gr, i.show]
5003
+ [vr, i.show]
4925
5004
  ]);
4926
5005
  }
4927
- const ms = /* @__PURE__ */ W(Ai, [["render", $i]]), zi = C({
5006
+ const Ms = /* @__PURE__ */ W(Di, [["render", Gi]]), Zi = x({
4928
5007
  name: "tg-label",
4929
5008
  mixins: [L],
4930
5009
  inheritAttrs: !1,
@@ -4962,7 +5041,7 @@ const ms = /* @__PURE__ */ W(Ai, [["render", $i]]), zi = C({
4962
5041
  return (i = this.$marker()) == null ? void 0 : i.marker;
4963
5042
  },
4964
5043
  $marker() {
4965
- return _e(this.$parent, _t);
5044
+ return Me(this.$parent, _t);
4966
5045
  },
4967
5046
  getOptions() {
4968
5047
  return {
@@ -4980,14 +5059,14 @@ const ms = /* @__PURE__ */ W(Ai, [["render", $i]]), zi = C({
4980
5059
  this.$marker() ? this.$marker().onRemoveLabel(this) : this.$map.removeOverlay(this.overlay);
4981
5060
  }
4982
5061
  });
4983
- function Ni(i, e, t, r, s, n) {
4984
- return G(), j("div", le({
5062
+ function ji(i, e, t, r, s, n) {
5063
+ return Z(), j("div", le({
4985
5064
  class: i.$options.name
4986
5065
  }, i.attrs.binds), [
4987
5066
  z(i.$slots, "default")
4988
5067
  ], 16);
4989
5068
  }
4990
- const fs = /* @__PURE__ */ W(zi, [["render", Ni]]), ys = C({
5069
+ const bs = /* @__PURE__ */ W(Zi, [["render", ji]]), Ts = x({
4991
5070
  name: "tg-polygon",
4992
5071
  mixins: [L],
4993
5072
  inheritAttrs: !1,
@@ -5046,7 +5125,7 @@ const fs = /* @__PURE__ */ W(zi, [["render", Ni]]), ys = C({
5046
5125
  onDestroy() {
5047
5126
  this.$map.removeOverlay(this.polygon);
5048
5127
  }
5049
- }), vs = C({
5128
+ }), ws = x({
5050
5129
  name: "tg-polyline",
5051
5130
  mixins: [L],
5052
5131
  inheritAttrs: !1,
@@ -5097,14 +5176,14 @@ const fs = /* @__PURE__ */ W(zi, [["render", Ni]]), ys = C({
5097
5176
  onDestroy() {
5098
5177
  this.$map.removeOverlay(this.polyline);
5099
5178
  }
5100
- }), Ri = ["beforeUpdate", "updated"], _s = {
5179
+ }), Wi = ["beforeUpdate", "updated"], Os = {
5101
5180
  install(i, e = {}) {
5102
5181
  if (e.enable !== !1) {
5103
- const t = C({
5182
+ const t = x({
5104
5183
  beforeCreate() {
5105
- const r = Qt() ?? "", n = (e.nameRegex || /^[A-Z]/).test(r) ? (a) => {
5106
- e.hookNames ? e.hookNames.includes(a) && console.debug("[lifecycle]", r, a) : Ri.includes(a) || console.debug("[lifecycle]", r, a);
5107
- } : we;
5184
+ const r = ir() ?? "", n = (e.nameRegex || /^[A-Z]/).test(r) ? (a) => {
5185
+ e.hookNames ? e.hookNames.includes(a) && console.debug("[lifecycle]", r, a) : Wi.includes(a) || console.debug("[lifecycle]", r, a);
5186
+ } : ge;
5108
5187
  n("beforeCreate"), this.__life_impl = n;
5109
5188
  },
5110
5189
  created() {
@@ -5143,156 +5222,159 @@ const fs = /* @__PURE__ */ W(zi, [["render", Ni]]), ys = C({
5143
5222
  i.mixin(t);
5144
5223
  }
5145
5224
  }
5146
- }, Di = 6378137;
5225
+ }, Vi = 6378137;
5147
5226
  function ue(i) {
5148
5227
  return i * Math.PI / 180;
5149
5228
  }
5150
- function Lt(i) {
5229
+ function Pt(i) {
5151
5230
  return i * 180 / Math.PI;
5152
5231
  }
5153
- function Zi(i, e) {
5232
+ function Hi(i, e) {
5154
5233
  if (i.lat === e.lat && i.lng === e.lng)
5155
5234
  return 0;
5156
5235
  const t = ue((i.lat + e.lat) / 2), r = ue((i.lat - e.lat) / 2), s = ue((i.lng - e.lng) / 2);
5157
- let n = Math.sin(r), a = Math.sin(s), c = Math.sin(t);
5158
- const o = Di, l = 1 / 298.257;
5159
- n = n * n, a = a * a, c = c * c;
5160
- const h = n * (1 - a) + (1 - c) * a, u = (1 - n) * (1 - a) + c * a, p = Math.atan(Math.sqrt(h / u)), M = Math.sqrt(h * u) / p, b = 2 * p * o, _ = (3 * M - 1) / 2 / u, g = (3 * M + 1) / 2 / h;
5161
- return b * (1 + l * (_ * c * (1 - n) - g * (1 - c) * n));
5162
- }
5163
- function Gi(i, e, t) {
5164
- const s = 63567523142e-4, n = 1 / 298.257223563, a = ue(e), c = Math.sin(a), o = Math.cos(a), l = (1 - n) * Math.tan(ue(i.lat)), h = 1 / Math.sqrt(1 + l * l), u = l * h, p = Math.atan2(l, o), M = h * c, b = 1 - M * M, _ = b * (6378137 * 6378137 - s * s) / (s * s), g = 1 + _ / 16384 * (4096 + _ * (-768 + _ * (320 - 175 * _))), m = _ / 1024 * (256 + _ * (-128 + _ * (74 - 47 * _)));
5165
- let v = 0, O = 0, E = 0, w = t / (s * g), K = 2 * Math.PI;
5166
- for (; Math.abs(w - K) > 1e-12; ) {
5167
- v = Math.cos(2 * p + w), O = Math.sin(w), E = Math.cos(w);
5168
- const rr = m * O * (v + m / 4 * (E * (-1 + 2 * v * v) - m / 6 * v * (-3 + 4 * O * O) * (-3 + 4 * v * v)));
5169
- K = w, w = t / (s * g) + rr;
5170
- }
5171
- const re = u * O - h * E * o, Se = Math.atan2(
5172
- u * E + h * O * o,
5236
+ let n = Math.sin(r), a = Math.sin(s), d = Math.sin(t);
5237
+ const o = Vi, l = 1 / 298.257;
5238
+ n = n * n, a = a * a, d = d * d;
5239
+ const h = n * (1 - a) + (1 - d) * a, p = (1 - n) * (1 - a) + d * a, u = Math.atan(Math.sqrt(h / p)), M = Math.sqrt(h * p) / u, b = 2 * u * o, _ = (3 * M - 1) / 2 / p, g = (3 * M + 1) / 2 / h;
5240
+ return b * (1 + l * (_ * d * (1 - n) - g * (1 - d) * n));
5241
+ }
5242
+ function Fi(i, e, t) {
5243
+ const s = 63567523142e-4, n = 1 / 298.257223563, a = ue(e), d = Math.sin(a), o = Math.cos(a), l = (1 - n) * Math.tan(ue(i.lat)), h = 1 / Math.sqrt(1 + l * l), p = l * h, u = Math.atan2(l, o), M = h * d, b = 1 - M * M, _ = b * (6378137 * 6378137 - s * s) / (s * s), g = 1 + _ / 16384 * (4096 + _ * (-768 + _ * (320 - 175 * _))), m = _ / 1024 * (256 + _ * (-128 + _ * (74 - 47 * _)));
5244
+ let v = 0, w = 0, E = 0, O = t / (s * g), K = 2 * Math.PI;
5245
+ for (; Math.abs(O - K) > 1e-12; ) {
5246
+ v = Math.cos(2 * u + O), w = Math.sin(O), E = Math.cos(O);
5247
+ const or = m * w * (v + m / 4 * (E * (-1 + 2 * v * v) - m / 6 * v * (-3 + 4 * w * w) * (-3 + 4 * v * v)));
5248
+ K = O, O = t / (s * g) + or;
5249
+ }
5250
+ const re = p * w - h * E * o, Se = Math.atan2(
5251
+ p * E + h * w * o,
5173
5252
  (1 - n) * Math.sqrt(M * M + re * re)
5174
- ), er = Math.atan2(O * c, h * E - u * O * o), Ae = n / 16 * b * (4 + n * (4 - 3 * b)), tr = er - (1 - Ae) * n * M * (w + Ae * O * (v + Ae * E * (-1 + 2 * v * v)));
5175
- return { lng: i.lng + Lt(tr), lat: Lt(Se) };
5253
+ ), sr = Math.atan2(w * d, h * E - p * w * o), Ae = n / 16 * b * (4 + n * (4 - 3 * b)), nr = sr - (1 - Ae) * n * M * (O + Ae * w * (v + Ae * E * (-1 + 2 * v * v)));
5254
+ return { lng: i.lng + Pt(nr), lat: Pt(Se) };
5176
5255
  }
5177
- const Ms = {
5178
- getDistance: Zi,
5179
- getDestination: Gi
5180
- }, bs = {
5256
+ const Cs = {
5257
+ getDistance: Hi,
5258
+ getDestination: Fi
5259
+ }, xs = {
5181
5260
  install(i, e) {
5182
- Br(e), i.config.unwrapInjectedRef = !0;
5261
+ zr(e), i.config.unwrapInjectedRef = !0;
5183
5262
  const t = i.config.optionMergeStrategies;
5184
- t[ye] = t[ve] = (r, s) => r ? [...new Set([].concat(r, s))] : Array.isArray(s) ? s : [s];
5263
+ t[ve] = t[_e] = (r, s) => r ? [...new Set([].concat(r, s))] : Array.isArray(s) ? s : [s];
5185
5264
  }
5186
5265
  };
5187
5266
  export {
5188
- Nt as AbstractControl,
5267
+ Dt as AbstractControl,
5189
5268
  et as AbstractMap,
5190
5269
  xe as Arrays,
5191
- jt as Autocomplete,
5192
- jr as BaiduAutocomplete,
5270
+ Ht as Autocomplete,
5271
+ Hr as BaiduAutocomplete,
5193
5272
  st as BaiduCircle,
5194
5273
  Fe as BaiduControl,
5195
5274
  ht as BaiduInfoBoxOverlay,
5196
5275
  at as BaiduInfoWindow,
5197
5276
  Ye as BaiduMapTypeControl,
5198
- fe as BaiduMarker,
5199
- Ur as BaiduMarkerClusterer,
5277
+ ye as BaiduMarker,
5278
+ Kr as BaiduMarkerClusterer,
5200
5279
  Be as BaiduOverlay,
5201
- Kr as BaiduPlacesService,
5280
+ Qr as BaiduPlacesService,
5202
5281
  gt as BaiduPolygon,
5203
5282
  ft as BaiduPolyline,
5204
5283
  qe as BaiduScaleControl,
5284
+ ti as BaiduSearchBox,
5205
5285
  Xe as BaiduZoomControl,
5206
5286
  Ot as CachedValue,
5207
- k as ControlPosition,
5287
+ P as ControlPosition,
5208
5288
  B as ControlPositionConverter,
5209
5289
  Q as CoordType,
5210
- Rr as CustomControl,
5211
- Nr as FastFindValues,
5212
- Gr as GoogleAutocomplete,
5290
+ Zr as CustomControl,
5291
+ Gr as FastFindValues,
5292
+ Vr as GoogleAutocomplete,
5213
5293
  nt as GoogleCircle,
5214
5294
  Ue as GoogleControl,
5215
5295
  ct as GoogleInfoBoxOverlay,
5216
5296
  lt as GoogleInfoWindow,
5217
- Te as GoogleMapTypeControl,
5297
+ we as GoogleMapTypeControl,
5218
5298
  ut as GoogleMarker,
5219
- Yr as GoogleMarkerClusterer,
5299
+ Xr as GoogleMarkerClusterer,
5220
5300
  tt as GoogleOverlay,
5221
- qr as GooglePlacesService,
5301
+ Jr as GooglePlacesService,
5222
5302
  mt as GooglePolygon,
5223
5303
  yt as GooglePolyline,
5224
5304
  Ke as GoogleScaleControl,
5305
+ ei as GoogleSearchBox,
5225
5306
  Je as GoogleZoomControl,
5226
5307
  ae as Icon,
5227
5308
  ot as InfoWindow,
5228
- Tt as KeyValue,
5309
+ wt as KeyValue,
5229
5310
  y as LatLng,
5230
5311
  F as LatLngBounds,
5231
- _s as LifecycleLogPlugin,
5232
- ye as MIXIN_HOOK_CREATE,
5233
- ve as MIXIN_HOOK_DESTROY,
5312
+ Os as LifecycleLogPlugin,
5313
+ ve as MIXIN_HOOK_CREATE,
5314
+ _e as MIXIN_HOOK_DESTROY,
5234
5315
  vt as MIXIN_MAP_NAME,
5235
5316
  Ee as MVCArrays,
5236
5317
  L as MapMixin,
5237
- Dt as MapTypeControlType,
5238
- Xr as MapZoom,
5239
- Ut as MarkerClusterer,
5240
- me as Objects,
5241
- Kt as Overlay,
5242
- Yt as PlacesService,
5318
+ Zt as MapTypeControlType,
5319
+ ri as MapZoom,
5320
+ Kt as MarkerClusterer,
5321
+ fe as Objects,
5322
+ er as Overlay,
5323
+ Xt as PlacesService,
5243
5324
  U as Point,
5244
- Ms as SphericalUtils,
5245
- ke as Strings,
5246
- ps as TgCircle,
5247
- as as TgCustomControl,
5248
- us as TgElementOverlay,
5249
- gs as TgInfoBox,
5250
- ms as TgInfoWindow,
5251
- fs as TgLabel,
5252
- fi as TgMap,
5325
+ Jt as SearchBox,
5326
+ Cs as SphericalUtils,
5327
+ Pe as Strings,
5328
+ ys as TgCircle,
5329
+ ps as TgCustomControl,
5330
+ vs as TgElementOverlay,
5331
+ _s as TgInfoBox,
5332
+ Ms as TgInfoWindow,
5333
+ bs as TgLabel,
5334
+ bi as TgMap,
5253
5335
  Ve as TgMapFactory,
5254
5336
  $ as TgMapType,
5255
- ls as TgMapTypeControl,
5256
- os as TgMapWidget,
5337
+ us as TgMapTypeControl,
5338
+ ds as TgMapWidget,
5257
5339
  _t as TgMarker,
5258
- Ci as TgMarkerClusterer,
5259
- ys as TgPolygon,
5260
- vs as TgPolyline,
5261
- hs as TgScaleControl,
5262
- ds as TgTrafficLayer,
5263
- cs as TgZoomControl,
5264
- be as callHook,
5265
- ts as computedSaveOnThis,
5266
- Jt as createEmptyVNode,
5267
- pi as createPropertyObject,
5268
- rs as createPropertyObjectTyped,
5269
- Fi as debug,
5270
- bs as default,
5271
- ns as eventLogMethods,
5340
+ ki as TgMarkerClusterer,
5341
+ Ts as TgPolygon,
5342
+ ws as TgPolyline,
5343
+ gs as TgScaleControl,
5344
+ fs as TgTrafficLayer,
5345
+ ms as TgZoomControl,
5346
+ Te as callHook,
5347
+ os as computedSaveOnThis,
5348
+ rr as createEmptyVNode,
5349
+ yi as createPropertyObject,
5350
+ as as createPropertyObjectTyped,
5351
+ Xi as debug,
5352
+ xs as default,
5353
+ cs as eventLogMethods,
5272
5354
  R as eventProp,
5273
- ss as extractVNodeFromSlotsByComponent,
5274
- is as findByComponentType,
5275
- Gi as getDestination,
5276
- $t as getTgMapConfig,
5277
- Ui as isDef,
5278
- qi as isInstanceOf,
5279
- Yi as lateinit,
5280
- we as noop,
5355
+ hs as extractVNodeFromSlotsByComponent,
5356
+ ls as findByComponentType,
5357
+ Fi as getDestination,
5358
+ zt as getTgMapConfig,
5359
+ Ji as isDef,
5360
+ es as isInstanceOf,
5361
+ Qi as lateinit,
5362
+ ge as noop,
5281
5363
  f as optionalProp,
5282
- ci as path,
5364
+ mi as path,
5283
5365
  N as requiredProp,
5284
- Ki as safeAs,
5285
- _e as safeAsComponent,
5286
- Br as setTgMapConfig,
5287
- ui as splitAttrs,
5288
- Z as stringEnumProp,
5289
- di as stringUnionPropFromValues,
5290
- x as throwError,
5291
- It as throwUnsupported,
5292
- Hi as todo,
5293
- Ge as typed,
5294
- Xi as unwrapStringEnumValue,
5366
+ ts as safeAs,
5367
+ Me as safeAsComponent,
5368
+ zr as setTgMapConfig,
5369
+ vi as splitAttrs,
5370
+ G as stringEnumProp,
5371
+ fi as stringUnionPropFromValues,
5372
+ C as throwError,
5373
+ Bt as throwUnsupported,
5374
+ Ki as todo,
5375
+ Ze as typed,
5376
+ rs as unwrapStringEnumValue,
5295
5377
  q as useSplittedAttrs,
5296
- Ti as useTgMap
5378
+ Ei as useTgMap
5297
5379
  };
5298
5380
  //# sourceMappingURL=tg-map.js.map