tg-map-vue3 3.6.8 → 3.6.9
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/src/map/map/extra/map-urls.d.ts +19 -3
- package/dist/tg-map.js +351 -321
- package/dist/tg-map.js.map +1 -1
- package/dist/tg-map.umd.cjs +4 -4
- package/dist/tg-map.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/tg-map.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var Sr = Object.defineProperty;
|
|
3
3
|
var Ar = (i, t, e) => t in i ? Sr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
4
4
|
var c = (i, t, e) => (Ar(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
5
|
-
import { createCommentVNode as
|
|
5
|
+
import { createCommentVNode as rt, computed as Kt, defineComponent as w, markRaw as Rr, watch as Xt, openBlock as F, createElementBlock as U, mergeProps as pe, createElementVNode as $r, normalizeClass as He, renderSlot as W, normalizeStyle as zr, getCurrentInstance as Dr, inject as Nr, onMounted as Gr, onBeforeUnmount as Zr, toRaw as Ve, withDirectives as Wr, vShow as jr } from "vue";
|
|
6
6
|
function Y(i, t, e) {
|
|
7
7
|
Object.keys(i).forEach((r) => {
|
|
8
8
|
r.startsWith("update:") || e != null && e.includes(r) || t.addEventListener(r, i[r]);
|
|
@@ -12,11 +12,11 @@ let Hr = 1;
|
|
|
12
12
|
function Vr() {
|
|
13
13
|
return Hr++;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function Re(i, t) {
|
|
16
16
|
return t.__id__ || (t.__id__ = Vr()), `${i}::${t.__id__}`;
|
|
17
17
|
}
|
|
18
18
|
var Jt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
19
|
-
function
|
|
19
|
+
function ht(i) {
|
|
20
20
|
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
|
|
21
21
|
}
|
|
22
22
|
var Qt = { exports: {} };
|
|
@@ -58,12 +58,12 @@ var Qt = { exports: {} };
|
|
|
58
58
|
return !1;
|
|
59
59
|
}
|
|
60
60
|
function l(g, f) {
|
|
61
|
-
var v = g - 65e-4, O = f - 6e-3,
|
|
61
|
+
var v = g - 65e-4, O = f - 6e-3, x = Math.sqrt(v * v + O * O) - 2e-5 * Math.sin(O * t), E = Math.atan2(O, v) - 3e-6 * Math.cos(v * t), Q = x * Math.cos(E), ie = x * Math.sin(E);
|
|
62
62
|
return [Q, ie];
|
|
63
63
|
}
|
|
64
64
|
function d(g, f) {
|
|
65
|
-
var v = Math.sqrt(g * g + f * f) + 2e-5 * Math.sin(f * t), O = Math.atan2(f, g) + 3e-6 * Math.cos(g * t),
|
|
66
|
-
return [
|
|
65
|
+
var v = Math.sqrt(g * g + f * f) + 2e-5 * Math.sin(f * t), O = Math.atan2(f, g) + 3e-6 * Math.cos(g * t), x = v * Math.cos(O) + 65e-4, E = v * Math.sin(O) + 6e-3;
|
|
66
|
+
return [x, E];
|
|
67
67
|
}
|
|
68
68
|
function u(g, f) {
|
|
69
69
|
return o(g, f) ? b(g, f) : [g, f];
|
|
@@ -75,10 +75,10 @@ var Qt = { exports: {} };
|
|
|
75
75
|
return [g * 2 - v[0], f * 2 - v[1]];
|
|
76
76
|
}
|
|
77
77
|
function b(g, f) {
|
|
78
|
-
var v = _(g - 105, f - 35), O = T(g - 105, f - 35),
|
|
78
|
+
var v = _(g - 105, f - 35), O = T(g - 105, f - 35), x = f / 180 * e, E = Math.sin(x);
|
|
79
79
|
E = 1 - s * E * E;
|
|
80
80
|
var Q = Math.sqrt(E);
|
|
81
|
-
v = v * 180 / (r * (1 - s) / (E * Q) * e), O = O * 180 / (r / Q * Math.cos(
|
|
81
|
+
v = v * 180 / (r * (1 - s) / (E * Q) * e), O = O * 180 / (r / Q * Math.cos(x) * e);
|
|
82
82
|
var ie = f + v, Ke = g + O;
|
|
83
83
|
return [Ke, ie];
|
|
84
84
|
}
|
|
@@ -117,17 +117,17 @@ var Qt = { exports: {} };
|
|
|
117
117
|
});
|
|
118
118
|
})(Qt);
|
|
119
119
|
var Fr = Qt.exports;
|
|
120
|
-
const se = /* @__PURE__ */
|
|
120
|
+
const se = /* @__PURE__ */ ht(Fr);
|
|
121
121
|
function oe(i, t) {
|
|
122
122
|
if (!i)
|
|
123
123
|
throw new Error(`AssertionError: ${t}`);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function it(i) {
|
|
126
126
|
throw new Error(`Unexpected object: ${i}`);
|
|
127
127
|
}
|
|
128
128
|
function $s() {
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function st(i) {
|
|
131
131
|
return i;
|
|
132
132
|
}
|
|
133
133
|
function zs(i, t) {
|
|
@@ -137,18 +137,18 @@ function Ds(i, t) {
|
|
|
137
137
|
if (i instanceof t)
|
|
138
138
|
return i;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function nt(i, t) {
|
|
141
141
|
return (i == null ? void 0 : i.$options.name) === t.name;
|
|
142
142
|
}
|
|
143
143
|
function er(i, t) {
|
|
144
|
-
return
|
|
144
|
+
return nt(i, t) ? i : void 0;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function ct(i, t, e) {
|
|
147
147
|
let r = t;
|
|
148
148
|
for (; r; ) {
|
|
149
|
-
if (
|
|
149
|
+
if (nt(r, i))
|
|
150
150
|
return r;
|
|
151
|
-
if (e &&
|
|
151
|
+
if (e && nt(r, e))
|
|
152
152
|
return;
|
|
153
153
|
r = r.$parent;
|
|
154
154
|
}
|
|
@@ -159,7 +159,7 @@ function Ns(i) {
|
|
|
159
159
|
function C(i) {
|
|
160
160
|
throw new Error(i);
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function dt(i) {
|
|
163
163
|
throw new Error(`Unsupported: ${i}`);
|
|
164
164
|
}
|
|
165
165
|
function Gs(i) {
|
|
@@ -168,7 +168,7 @@ function Gs(i) {
|
|
|
168
168
|
function Zs(i) {
|
|
169
169
|
return i;
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function Te(...i) {
|
|
172
172
|
}
|
|
173
173
|
function Ws(i) {
|
|
174
174
|
return i != null;
|
|
@@ -176,8 +176,8 @@ function Ws(i) {
|
|
|
176
176
|
function Ur(i) {
|
|
177
177
|
return i[1] != null;
|
|
178
178
|
}
|
|
179
|
-
var
|
|
180
|
-
const Je = "wgs84",
|
|
179
|
+
var P = /* @__PURE__ */ ((i) => (i.wgs84 = "wgs84", i.gcj02 = "gcj02", i.bd09 = "bd09", i))(P || {});
|
|
180
|
+
const Je = "wgs84", B = class {
|
|
181
181
|
constructor(t, e, r) {
|
|
182
182
|
this.lat = t, this.lng = e, this.coord = r;
|
|
183
183
|
}
|
|
@@ -199,23 +199,23 @@ const Je = "wgs84", k = class {
|
|
|
199
199
|
}
|
|
200
200
|
/** @param coord Baidu Map的坐标一般都是bd09 */
|
|
201
201
|
static fromBaidu(t, e) {
|
|
202
|
-
return new
|
|
202
|
+
return new B(t.lat, t.lng, e);
|
|
203
203
|
}
|
|
204
204
|
/** @param coord Google Map的坐标依据地图类型不同是不一样的 */
|
|
205
205
|
static fromGoogle(t, e) {
|
|
206
|
-
return new
|
|
206
|
+
return new B(t.lat(), t.lng(), e);
|
|
207
207
|
}
|
|
208
208
|
static fromHere(t, e) {
|
|
209
|
-
return new
|
|
209
|
+
return new B(t.lat, t.lng, e);
|
|
210
210
|
}
|
|
211
211
|
static fromLiteral(t) {
|
|
212
|
-
return new
|
|
212
|
+
return new B(t.lat, t.lng, t.coord || Je);
|
|
213
213
|
}
|
|
214
214
|
static fromLngLat(t, e, r = Je) {
|
|
215
|
-
return new
|
|
215
|
+
return new B(e, t, r);
|
|
216
216
|
}
|
|
217
217
|
static create(t, e, r = Je) {
|
|
218
|
-
return new
|
|
218
|
+
return new B(t, e, r);
|
|
219
219
|
}
|
|
220
220
|
/** 转换坐标到指定坐标系 */
|
|
221
221
|
to(t) {
|
|
@@ -223,7 +223,7 @@ const Je = "wgs84", k = class {
|
|
|
223
223
|
if (this.coord === e)
|
|
224
224
|
return this;
|
|
225
225
|
const [r, s] = this._convert(e);
|
|
226
|
-
return new
|
|
226
|
+
return new B(s, r, e);
|
|
227
227
|
}
|
|
228
228
|
/**
|
|
229
229
|
* TODO: normalize要不要默认设为true, 和google的行为保持一致?
|
|
@@ -233,7 +233,7 @@ const Je = "wgs84", k = class {
|
|
|
233
233
|
*/
|
|
234
234
|
toBaidu(t, e = !1) {
|
|
235
235
|
let r = this.lat, s = this.lng;
|
|
236
|
-
return this.coord !== t && ([s, r] = this._convert(t)), e && ([s, r] =
|
|
236
|
+
return this.coord !== t && ([s, r] = this._convert(t)), e && ([s, r] = B._normalize(s, r)), new BMap.Point(s, r);
|
|
237
237
|
}
|
|
238
238
|
/**
|
|
239
239
|
* 转换成google的经纬度, 内部会自动进行标准化
|
|
@@ -272,8 +272,8 @@ const Je = "wgs84", k = class {
|
|
|
272
272
|
* @see _normalize {@macro latlng_normalize}
|
|
273
273
|
*/
|
|
274
274
|
normalize() {
|
|
275
|
-
const [t, e] =
|
|
276
|
-
return e === this.lat && t === this.lng ? this : new
|
|
275
|
+
const [t, e] = B._normalize(this.lng, this.lat);
|
|
276
|
+
return e === this.lat && t === this.lng ? this : new B(e, t, this.coord);
|
|
277
277
|
}
|
|
278
278
|
equals(t) {
|
|
279
279
|
return this === t ? !0 : this.lat === t.lat && this.lng === t.lng && this.coord === t.coord;
|
|
@@ -282,8 +282,8 @@ const Je = "wgs84", k = class {
|
|
|
282
282
|
return JSON.stringify(this);
|
|
283
283
|
}
|
|
284
284
|
};
|
|
285
|
-
let y =
|
|
286
|
-
c(y, "ZERO",
|
|
285
|
+
let y = B;
|
|
286
|
+
c(y, "ZERO", B.create(0, 0));
|
|
287
287
|
const te = class {
|
|
288
288
|
/**
|
|
289
289
|
* 不推荐直接创建LatLngBounds, sw和ne的大小关系可能没法保证, 推荐用LatLngBounds.Builder或者LatLngBounds.from等静态方法来创建
|
|
@@ -428,12 +428,12 @@ function Qr(i) {
|
|
|
428
428
|
function ei(i) {
|
|
429
429
|
return Array.isArray(i) ? [] : {};
|
|
430
430
|
}
|
|
431
|
-
function
|
|
431
|
+
function Me(i, t) {
|
|
432
432
|
return t.clone !== !1 && t.isMergeableObject(i) ? le(ei(i), i, t) : i;
|
|
433
433
|
}
|
|
434
434
|
function ti(i, t, e) {
|
|
435
435
|
return i.concat(t).map(function(r) {
|
|
436
|
-
return
|
|
436
|
+
return Me(r, e);
|
|
437
437
|
});
|
|
438
438
|
}
|
|
439
439
|
function ri(i, t) {
|
|
@@ -447,7 +447,7 @@ function ii(i) {
|
|
|
447
447
|
return Object.propertyIsEnumerable.call(i, t);
|
|
448
448
|
}) : [];
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function Zt(i) {
|
|
451
451
|
return Object.keys(i).concat(ii(i));
|
|
452
452
|
}
|
|
453
453
|
function tr(i, t) {
|
|
@@ -462,16 +462,16 @@ function si(i, t) {
|
|
|
462
462
|
}
|
|
463
463
|
function ni(i, t, e) {
|
|
464
464
|
var r = {};
|
|
465
|
-
return e.isMergeableObject(i) &&
|
|
466
|
-
r[s] =
|
|
467
|
-
}),
|
|
468
|
-
si(i, s) || (tr(i, s) && e.isMergeableObject(t[s]) ? r[s] = ri(s, e)(i[s], t[s], e) : r[s] =
|
|
465
|
+
return e.isMergeableObject(i) && Zt(i).forEach(function(s) {
|
|
466
|
+
r[s] = Me(i[s], e);
|
|
467
|
+
}), Zt(t).forEach(function(s) {
|
|
468
|
+
si(i, s) || (tr(i, s) && e.isMergeableObject(t[s]) ? r[s] = ri(s, e)(i[s], t[s], e) : r[s] = Me(t[s], e));
|
|
469
469
|
}), r;
|
|
470
470
|
}
|
|
471
471
|
function le(i, t, e) {
|
|
472
|
-
e = e || {}, e.arrayMerge = e.arrayMerge || ti, e.isMergeableObject = e.isMergeableObject || Yr, e.cloneUnlessOtherwiseSpecified =
|
|
472
|
+
e = e || {}, e.arrayMerge = e.arrayMerge || ti, e.isMergeableObject = e.isMergeableObject || Yr, e.cloneUnlessOtherwiseSpecified = Me;
|
|
473
473
|
var r = Array.isArray(t), s = Array.isArray(i), n = r === s;
|
|
474
|
-
return n ? r ? e.arrayMerge(i, t, e) : ni(i, t, e) :
|
|
474
|
+
return n ? r ? e.arrayMerge(i, t, e) : ni(i, t, e) : Me(t, e);
|
|
475
475
|
}
|
|
476
476
|
le.all = function(t, e) {
|
|
477
477
|
if (!Array.isArray(t))
|
|
@@ -481,7 +481,7 @@ le.all = function(t, e) {
|
|
|
481
481
|
}, {});
|
|
482
482
|
};
|
|
483
483
|
var oi = le, ai = oi;
|
|
484
|
-
const rr = /* @__PURE__ */
|
|
484
|
+
const rr = /* @__PURE__ */ ht(ai), $e = ["3.0"], li = {
|
|
485
485
|
baidu: {
|
|
486
486
|
version: "3.0",
|
|
487
487
|
// 在build时会被静态替换, 导致使用者不能无法设置它
|
|
@@ -496,7 +496,7 @@ const rr = /* @__PURE__ */ lt(ai), Ae = ["3.0"], li = {
|
|
|
496
496
|
libraries: ["places"]
|
|
497
497
|
},
|
|
498
498
|
here: {
|
|
499
|
-
version:
|
|
499
|
+
version: $e[0],
|
|
500
500
|
key: ""
|
|
501
501
|
}
|
|
502
502
|
};
|
|
@@ -507,13 +507,13 @@ function sr() {
|
|
|
507
507
|
function hi(i) {
|
|
508
508
|
i != null && (ir = rr(li, i));
|
|
509
509
|
}
|
|
510
|
-
var
|
|
510
|
+
var ot;
|
|
511
511
|
((i) => {
|
|
512
512
|
function t(e) {
|
|
513
513
|
return e.scrollWidth > e.clientWidth || e.scrollHeight > e.clientHeight;
|
|
514
514
|
}
|
|
515
515
|
i.isScrollable = t;
|
|
516
|
-
})(
|
|
516
|
+
})(ot || (ot = {}));
|
|
517
517
|
var he;
|
|
518
518
|
((i) => {
|
|
519
519
|
function t(h, o) {
|
|
@@ -582,7 +582,7 @@ function ci(i, t, e) {
|
|
|
582
582
|
function di(i, t, e, r) {
|
|
583
583
|
return i.addEventListener(t, e, r), () => i.removeEventListener(t, e, r);
|
|
584
584
|
}
|
|
585
|
-
function
|
|
585
|
+
function Wt(i, t, e) {
|
|
586
586
|
return i.addEventListener(t, e), () => i.removeEventListener(t, e);
|
|
587
587
|
}
|
|
588
588
|
class or {
|
|
@@ -624,14 +624,14 @@ class Fe {
|
|
|
624
624
|
this.delegate.removeEventListener(t, e);
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
|
-
const
|
|
627
|
+
const Gt = class extends or {
|
|
628
628
|
addEventListener(t, e) {
|
|
629
|
-
const r =
|
|
629
|
+
const r = Re(t, e);
|
|
630
630
|
if (this.eventMap.get(r)) {
|
|
631
631
|
console.warn("listener已经添加过了", r, e);
|
|
632
632
|
return;
|
|
633
633
|
}
|
|
634
|
-
const s = this.inner.addListener(
|
|
634
|
+
const s = this.inner.addListener(Gt.EVENT_TYPE_MAP[t] || t, (n) => {
|
|
635
635
|
const a = {
|
|
636
636
|
type: t,
|
|
637
637
|
target: this.target,
|
|
@@ -642,11 +642,11 @@ const Nt = class extends or {
|
|
|
642
642
|
this.eventMap.set(r, s);
|
|
643
643
|
}
|
|
644
644
|
removeEventListener(t, e) {
|
|
645
|
-
const r =
|
|
645
|
+
const r = Re(t, e), s = this.eventMap.get(r);
|
|
646
646
|
s ? (s.remove(), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, e);
|
|
647
647
|
}
|
|
648
648
|
};
|
|
649
|
-
let re =
|
|
649
|
+
let re = Gt;
|
|
650
650
|
// 事件类型映射: tg => google
|
|
651
651
|
c(re, "EVENT_TYPE_MAP", {
|
|
652
652
|
"center-changed": "center_changed",
|
|
@@ -664,9 +664,9 @@ c(re, "EVENT_TYPE_MAP", {
|
|
|
664
664
|
"map-mouseup": "mouseup",
|
|
665
665
|
"map-dblclick": "dblclick"
|
|
666
666
|
});
|
|
667
|
-
const
|
|
667
|
+
const Ze = class extends or {
|
|
668
668
|
addEventListener(t, e) {
|
|
669
|
-
const r =
|
|
669
|
+
const r = Re(t, e);
|
|
670
670
|
if (this.eventMap.get(r)) {
|
|
671
671
|
console.warn("listener已经添加过了", r, e);
|
|
672
672
|
return;
|
|
@@ -679,14 +679,14 @@ const Ge = class extends or {
|
|
|
679
679
|
};
|
|
680
680
|
n.point && (a.position = y.fromBaidu(n.point, this.coordTypeSupplier.coordType)), e.call(this.target, a);
|
|
681
681
|
};
|
|
682
|
-
this.inner.addEventListener(
|
|
682
|
+
this.inner.addEventListener(Ze.EVENT_TYPE_MAP[t] || t, s), this.eventMap.set(r, s);
|
|
683
683
|
}
|
|
684
684
|
removeEventListener(t, e) {
|
|
685
|
-
const r =
|
|
686
|
-
s ? (this.inner.removeEventListener(
|
|
685
|
+
const r = Re(t, e), s = this.eventMap.get(r);
|
|
686
|
+
s ? (this.inner.removeEventListener(Ze.EVENT_TYPE_MAP[t] || t, s), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, e);
|
|
687
687
|
}
|
|
688
688
|
};
|
|
689
|
-
let ae =
|
|
689
|
+
let ae = Ze;
|
|
690
690
|
// cSpell:words clickclose
|
|
691
691
|
// 事件类型映射, tg => baidu
|
|
692
692
|
c(ae, "EVENT_TYPE_MAP", {
|
|
@@ -718,7 +718,7 @@ class ar {
|
|
|
718
718
|
e && e.forEach((r) => r.call(t.target, t));
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
|
-
class
|
|
721
|
+
class jt {
|
|
722
722
|
/**
|
|
723
723
|
* `keys`和`values`数组中可以有相同的值, 若存在相同值, 则index越小的优先级越高
|
|
724
724
|
*/
|
|
@@ -793,7 +793,7 @@ var S = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
793
793
|
/* RIGHT_BOTTOM */
|
|
794
794
|
];
|
|
795
795
|
function s() {
|
|
796
|
-
return t || (t = new
|
|
796
|
+
return t || (t = new jt(r, [
|
|
797
797
|
/* | @tg/map |名字相同| baidu | */
|
|
798
798
|
/* TOP_LEFT = */
|
|
799
799
|
BMAP_ANCHOR_TOP_LEFT,
|
|
@@ -823,7 +823,7 @@ var S = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
823
823
|
}
|
|
824
824
|
i.getBaidu = s;
|
|
825
825
|
function n() {
|
|
826
|
-
return e || (e = new
|
|
826
|
+
return e || (e = new jt(r, [
|
|
827
827
|
google.maps.ControlPosition.TOP_LEFT,
|
|
828
828
|
google.maps.ControlPosition.TOP_CENTER,
|
|
829
829
|
google.maps.ControlPosition.TOP_RIGHT,
|
|
@@ -849,7 +849,7 @@ class pi {
|
|
|
849
849
|
}
|
|
850
850
|
class lr {
|
|
851
851
|
}
|
|
852
|
-
class
|
|
852
|
+
class ut extends lr {
|
|
853
853
|
constructor(t, e) {
|
|
854
854
|
super(), this.inner = t, this.position = e;
|
|
855
855
|
}
|
|
@@ -872,7 +872,7 @@ class dt extends lr {
|
|
|
872
872
|
t.innerMap.removeControl(this.inner);
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
|
-
class
|
|
875
|
+
class pt extends lr {
|
|
876
876
|
constructor(e, r) {
|
|
877
877
|
super();
|
|
878
878
|
c(this, "visible", !1);
|
|
@@ -918,7 +918,7 @@ class A {
|
|
|
918
918
|
return this.id;
|
|
919
919
|
}
|
|
920
920
|
getBaiduCoordType() {
|
|
921
|
-
return
|
|
921
|
+
return P.bd09;
|
|
922
922
|
}
|
|
923
923
|
asBaiduMapType() {
|
|
924
924
|
return this.baidu();
|
|
@@ -931,7 +931,7 @@ class A {
|
|
|
931
931
|
return this.google();
|
|
932
932
|
}
|
|
933
933
|
asGoogleMapType() {
|
|
934
|
-
|
|
934
|
+
dt("google的内置地图没有对应的实例");
|
|
935
935
|
}
|
|
936
936
|
}
|
|
937
937
|
class js {
|
|
@@ -983,7 +983,7 @@ class js {
|
|
|
983
983
|
return this.googleCached.get();
|
|
984
984
|
}
|
|
985
985
|
asGoogleLayer() {
|
|
986
|
-
|
|
986
|
+
dt("这个方法不会被调用");
|
|
987
987
|
}
|
|
988
988
|
}
|
|
989
989
|
class gi {
|
|
@@ -1000,17 +1000,17 @@ class gi {
|
|
|
1000
1000
|
}
|
|
1001
1001
|
var $;
|
|
1002
1002
|
((i) => {
|
|
1003
|
-
i.NORMAL = new A("normal", () => BMAP_NORMAL_MAP, () => google.maps.MapTypeId.ROADMAP,
|
|
1003
|
+
i.NORMAL = new A("normal", () => BMAP_NORMAL_MAP, () => google.maps.MapTypeId.ROADMAP, P.gcj02), i.SATELLITE = new A("satellite", () => BMAP_SATELLITE_MAP, () => google.maps.MapTypeId.SATELLITE, P.wgs84), i.HYBRID = new A("hybrid", () => BMAP_HYBRID_MAP, () => google.maps.MapTypeId.HYBRID, P.gcj02), i.TERRAIN = new A("terrain", () => (
|
|
1004
1004
|
/* 三维 */
|
|
1005
1005
|
BMAP_PERSPECTIVE_MAP
|
|
1006
1006
|
), () => (
|
|
1007
1007
|
/* 地形 */
|
|
1008
1008
|
google.maps.MapTypeId.TERRAIN
|
|
1009
|
-
),
|
|
1009
|
+
), P.wgs84), i.BUILD_IN_MAP_TYPES = new ui([i.NORMAL, i.SATELLITE, i.HYBRID, i.TERRAIN]);
|
|
1010
1010
|
})($ || ($ = {}));
|
|
1011
1011
|
var cr = /* @__PURE__ */ ((i) => (i.DEFAULT = "default", i.HORIZONTAL = "horizontal", i.DROPDOWN = "dropdown", i))(cr || {});
|
|
1012
1012
|
const dr = [$.NORMAL, $.SATELLITE, $.HYBRID];
|
|
1013
|
-
class
|
|
1013
|
+
class gt extends ut {
|
|
1014
1014
|
static create(t) {
|
|
1015
1015
|
const e = t.mapTypes ?? dr, r = {
|
|
1016
1016
|
default: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
@@ -1020,10 +1020,10 @@ class pt extends dt {
|
|
|
1020
1020
|
type: t.type && r[t.type],
|
|
1021
1021
|
mapTypes: e.map((n) => n.asBaiduMapType())
|
|
1022
1022
|
});
|
|
1023
|
-
return t.position && s.setAnchor(z.getBaidu().toValue(t.position)), new
|
|
1023
|
+
return t.position && s.setAnchor(z.getBaidu().toValue(t.position)), new gt(s, t.position);
|
|
1024
1024
|
}
|
|
1025
1025
|
}
|
|
1026
|
-
const ne = class extends
|
|
1026
|
+
const ne = class extends pt {
|
|
1027
1027
|
constructor(t = "default", e = S.TOP_LEFT, r = dr) {
|
|
1028
1028
|
super("mapType", e), this.type = t, this.mapTypes = r, ne.type2google || (ne.type2google = {
|
|
1029
1029
|
default: google.maps.MapTypeControlStyle.DEFAULT,
|
|
@@ -1044,37 +1044,37 @@ const ne = class extends ut {
|
|
|
1044
1044
|
});
|
|
1045
1045
|
}
|
|
1046
1046
|
};
|
|
1047
|
-
let
|
|
1048
|
-
c(
|
|
1049
|
-
class
|
|
1047
|
+
let Ie = ne;
|
|
1048
|
+
c(Ie, "type2google");
|
|
1049
|
+
class mt extends ut {
|
|
1050
1050
|
static create(t) {
|
|
1051
1051
|
const e = new BMap.ScaleControl({
|
|
1052
1052
|
anchor: t.position && z.getBaidu().toValue(t.position)
|
|
1053
1053
|
});
|
|
1054
|
-
return new
|
|
1054
|
+
return new mt(e, t.position);
|
|
1055
1055
|
}
|
|
1056
1056
|
}
|
|
1057
|
-
class
|
|
1057
|
+
class ft extends pt {
|
|
1058
1058
|
static create(t) {
|
|
1059
|
-
return new
|
|
1059
|
+
return new ft(t.position);
|
|
1060
1060
|
}
|
|
1061
1061
|
constructor(t = S.BOTTOM_RIGHT) {
|
|
1062
1062
|
super("scale", t);
|
|
1063
1063
|
}
|
|
1064
1064
|
}
|
|
1065
|
-
class
|
|
1065
|
+
class yt extends ut {
|
|
1066
1066
|
static create(t) {
|
|
1067
1067
|
const e = new BMap.NavigationControl({
|
|
1068
1068
|
type: BMAP_NAVIGATION_CONTROL_ZOOM,
|
|
1069
1069
|
// enableGeolocation: true,
|
|
1070
1070
|
anchor: t.position && z.getBaidu().toValue(t.position)
|
|
1071
1071
|
});
|
|
1072
|
-
return new
|
|
1072
|
+
return new yt(e, t.position);
|
|
1073
1073
|
}
|
|
1074
1074
|
}
|
|
1075
|
-
class
|
|
1075
|
+
class vt extends pt {
|
|
1076
1076
|
static create(t) {
|
|
1077
|
-
return new
|
|
1077
|
+
return new vt(t.position);
|
|
1078
1078
|
}
|
|
1079
1079
|
constructor(t = S.RIGHT_BOTTOM) {
|
|
1080
1080
|
super("zoom", t);
|
|
@@ -1185,7 +1185,7 @@ class _i extends gr {
|
|
|
1185
1185
|
const s = () => {
|
|
1186
1186
|
this.inner.setLocation(this.map.innerMap);
|
|
1187
1187
|
};
|
|
1188
|
-
this.removeableArray.push(
|
|
1188
|
+
this.removeableArray.push(Wt(this.map, "center-changed", s)), this.removeableArray.push(Wt(this.map, "zoom-changed", s));
|
|
1189
1189
|
}
|
|
1190
1190
|
}
|
|
1191
1191
|
setBounds(e) {
|
|
@@ -1221,71 +1221,101 @@ class mr {
|
|
|
1221
1221
|
this.options = t;
|
|
1222
1222
|
}
|
|
1223
1223
|
}
|
|
1224
|
-
function
|
|
1224
|
+
function ve(i, t, e) {
|
|
1225
1225
|
const r = new URL(t, i), s = new URLSearchParams(Object.entries(e).filter(Ur));
|
|
1226
1226
|
return r.search = "?" + s.toString(), r;
|
|
1227
1227
|
}
|
|
1228
|
-
function
|
|
1228
|
+
function Qe() {
|
|
1229
1229
|
const i = window.location.hostname.split(".").filter((t) => !de.isInt(t));
|
|
1230
1230
|
return i.length === 3 ? i.join(".") : [...i, "tg", "map", "urls"].slice(0, 3).join(".");
|
|
1231
1231
|
}
|
|
1232
|
-
const
|
|
1232
|
+
const We = class extends mr {
|
|
1233
1233
|
/** @see https://developers.google.com/maps/documentation/urls/get-started#directions-action */
|
|
1234
1234
|
directions(t, e, r) {
|
|
1235
|
-
return
|
|
1235
|
+
return ve(We.BASE_URL, "dir/", {
|
|
1236
1236
|
api: "1",
|
|
1237
1237
|
// {@template google_map_normal_gcj02}
|
|
1238
1238
|
// google地图的普通地图, 在国内其实上是gcj02坐标, 卫星地图是wgs84坐标, 因为这里打开的是基础地图, 故使用gcj02
|
|
1239
1239
|
// {@endtemplate}
|
|
1240
|
-
origin: V.toString(t,
|
|
1241
|
-
destination: V.toString(e,
|
|
1240
|
+
origin: V.toString(t, P.gcj02),
|
|
1241
|
+
destination: V.toString(e, P.gcj02),
|
|
1242
1242
|
travelmode: r
|
|
1243
1243
|
});
|
|
1244
1244
|
}
|
|
1245
1245
|
/** @see https://developers.google.com/maps/documentation/urls/get-started#search-action */
|
|
1246
1246
|
search(t) {
|
|
1247
|
-
return
|
|
1247
|
+
return ve(We.BASE_URL, "search/", {
|
|
1248
1248
|
api: "1",
|
|
1249
1249
|
// {@macro google_map_normal_gcj02}
|
|
1250
|
-
query: V.toString(t,
|
|
1250
|
+
query: V.toString(t, P.gcj02)
|
|
1251
1251
|
});
|
|
1252
1252
|
}
|
|
1253
1253
|
};
|
|
1254
|
-
let
|
|
1255
|
-
c(
|
|
1256
|
-
const
|
|
1257
|
-
/**
|
|
1254
|
+
let Se = We;
|
|
1255
|
+
c(Se, "BASE_URL", "https://www.google.com/maps/");
|
|
1256
|
+
const be = class extends mr {
|
|
1257
|
+
/**
|
|
1258
|
+
* 导航
|
|
1259
|
+
* @see https://lbsyun.baidu.com/faq/api?title=webapi/uri/web#:~:text=%E6%9C%8D%E5%8A%A1%E5%9C%B0%E5%9D%80-,http%3A//api.map.baidu.com/direction,-//PC%26Webapp%E6%9C%8D%E5%8A%A1
|
|
1260
|
+
* */
|
|
1258
1261
|
directions(t, e, r = "driving") {
|
|
1259
|
-
const s = V.getCoordType(e) ?? V.getCoordType(t) ??
|
|
1260
|
-
return
|
|
1262
|
+
const s = V.getCoordType(e) ?? V.getCoordType(t) ?? P.bd09, n = V.toString(e, s);
|
|
1263
|
+
return ve(be.BASE_URL, "direction", {
|
|
1261
1264
|
// baidu地图, 一定要有起点, 故这里用终点当起点, 防止导航失败
|
|
1262
1265
|
origin: V.toString(t, s) ?? (typeof e != "string" ? `name:请选择起点|latlng:${n}` : n),
|
|
1263
1266
|
destination: n,
|
|
1264
1267
|
// 默认就是bd09
|
|
1265
|
-
coord_type: s ===
|
|
1268
|
+
coord_type: s === P.bd09 ? void 0 : s,
|
|
1266
1269
|
mode: r,
|
|
1267
1270
|
output: "html",
|
|
1268
1271
|
region: "中国",
|
|
1269
|
-
src:
|
|
1272
|
+
src: Qe()
|
|
1270
1273
|
});
|
|
1271
1274
|
}
|
|
1272
|
-
/** @see https://lbsyun.baidu.com/faq/api?title=webapi/uri/web#%E5%9B%BE%E5%8C%BA%E5%8A%9F%E8%83%BD:~:text=%E4%B8%8D%E4%BF%9D%E8%AF%81%E6%9C%8D%E5%8A%A1%E3%80%82-,2.1.2%20%E5%9C%B0%E5%9D%80%E8%A7%A3%E6%9E%90,-%E8%B0%83%E7%94%A8%E8%AF%A5 */
|
|
1273
1275
|
search(t) {
|
|
1274
|
-
return
|
|
1276
|
+
return typeof t == "string" ? this.geocoderApi(t) : this.markerApi(t, "", "");
|
|
1277
|
+
}
|
|
1278
|
+
/**
|
|
1279
|
+
* 显示经纬度, {@link markerApi}中途跳转的url, 一定能够定位到
|
|
1280
|
+
* */
|
|
1281
|
+
latlngApi(t) {
|
|
1282
|
+
const e = t.to(P.bd09);
|
|
1283
|
+
return new URL(`https://map.baidu.com/?latlng=${e.lat},${e.lng}`);
|
|
1284
|
+
}
|
|
1285
|
+
/**
|
|
1286
|
+
* 显示marker点, 由于缓存等因素的存在, 不一定能够定位到点
|
|
1287
|
+
* @see https://lbsyun.baidu.com/faq/api?title=webapi/uri/web#%E5%9B%BE%E5%8C%BA%E5%8A%9F%E8%83%BD
|
|
1288
|
+
*/
|
|
1289
|
+
markerApi(t, e, r) {
|
|
1290
|
+
return ve(be.BASE_URL, "marker", {
|
|
1291
|
+
location: `${t.lat},${t.lng}`,
|
|
1292
|
+
coord_type: t.coord === P.bd09 ? void 0 : t.coord,
|
|
1293
|
+
title: e,
|
|
1294
|
+
content: r,
|
|
1295
|
+
output: "html",
|
|
1296
|
+
src: Qe()
|
|
1297
|
+
});
|
|
1298
|
+
}
|
|
1299
|
+
/**
|
|
1300
|
+
* 编码/反编码, 由于缓存等因素的存在, 不一定能够定位到点
|
|
1301
|
+
* @see https://lbsyun.baidu.com/faq/api?title=webapi/uri/web#%E5%9B%BE%E5%8C%BA%E5%8A%9F%E8%83%BD:~:text=%E4%B8%8D%E4%BF%9D%E8%AF%81%E6%9C%8D%E5%8A%A1%E3%80%82-,2.1.2%20%E5%9C%B0%E5%9D%80%E8%A7%A3%E6%9E%90,-%E8%B0%83%E7%94%A8%E8%AF%A5
|
|
1302
|
+
* */
|
|
1303
|
+
geocoderApi(t) {
|
|
1304
|
+
return ve(be.BASE_URL, "geocoder", {
|
|
1275
1305
|
...typeof t == "string" ? {
|
|
1276
1306
|
address: t
|
|
1277
1307
|
} : {
|
|
1278
1308
|
location: `${t.lat},${t.lng}`,
|
|
1279
1309
|
// 默认就是bd09
|
|
1280
|
-
coord_type: t.coord ===
|
|
1310
|
+
coord_type: t.coord === P.bd09 ? void 0 : t.coord
|
|
1281
1311
|
},
|
|
1282
1312
|
output: "html",
|
|
1283
|
-
src:
|
|
1313
|
+
src: Qe()
|
|
1284
1314
|
});
|
|
1285
1315
|
}
|
|
1286
1316
|
};
|
|
1287
|
-
let
|
|
1288
|
-
c(
|
|
1317
|
+
let Ae = be;
|
|
1318
|
+
c(Ae, "BASE_URL", "https://api.map.baidu.com/");
|
|
1289
1319
|
let bi = class fr {
|
|
1290
1320
|
constructor(t, e, r) {
|
|
1291
1321
|
this.extend(fr, google.maps.OverlayView), this.map_ = t, this.MARKER_CLUSTER_IMAGE_PATH_ = "../images/m", this.MARKER_CLUSTER_IMAGE_EXTENSION_ = "png", this.markers_ = [], this.clusters_ = [], this.sizes = [53, 56, 66, 78, 90], this.styles_ = [], this.ready_ = !1;
|
|
@@ -1726,7 +1756,7 @@ let bi = class fr {
|
|
|
1726
1756
|
}
|
|
1727
1757
|
}, Ti = class {
|
|
1728
1758
|
constructor(t) {
|
|
1729
|
-
this.markerClusterer_ = t, this.map_ = t.getMap(), this.gridSize_ = t.getGridSize(), this.minClusterSize_ = t.getMinClusterSize(), this.averageCenter_ = t.isAverageCenter(), this.center_ = null, this.markers_ = [], this.bounds_ = null, this.clusterIcon_ = new
|
|
1759
|
+
this.markerClusterer_ = t, this.map_ = t.getMap(), this.gridSize_ = t.getGridSize(), this.minClusterSize_ = t.getMinClusterSize(), this.averageCenter_ = t.isAverageCenter(), this.center_ = null, this.markers_ = [], this.bounds_ = null, this.clusterIcon_ = new _t(
|
|
1730
1760
|
this,
|
|
1731
1761
|
t.getStyles(),
|
|
1732
1762
|
t.getGridSize()
|
|
@@ -1860,9 +1890,9 @@ let bi = class fr {
|
|
|
1860
1890
|
this.clusterIcon_.setCenter(this.center_), this.clusterIcon_.setSums(a), this.clusterIcon_.show();
|
|
1861
1891
|
}
|
|
1862
1892
|
};
|
|
1863
|
-
class
|
|
1893
|
+
class _t {
|
|
1864
1894
|
constructor(t, e, r) {
|
|
1865
|
-
t.getMarkerClusterer().extend(
|
|
1895
|
+
t.getMarkerClusterer().extend(_t, google.maps.OverlayView), this.styles_ = e, this.padding_ = r || 0, this.cluster_ = t, this.center_ = null, this.map_ = t.getMap(), this.div_ = null, this.sums_ = null, this.visible_ = !1, this.setMap(this.map_);
|
|
1866
1896
|
}
|
|
1867
1897
|
/**
|
|
1868
1898
|
* Triggers the clusterclick event and zoom's if the option is set.
|
|
@@ -2188,7 +2218,7 @@ var yr = { exports: {} };
|
|
|
2188
2218
|
});
|
|
2189
2219
|
})(yr);
|
|
2190
2220
|
var Mi = yr.exports;
|
|
2191
|
-
const Ht = /* @__PURE__ */
|
|
2221
|
+
const Ht = /* @__PURE__ */ ht(Mi);
|
|
2192
2222
|
var vr = function(i, t, e) {
|
|
2193
2223
|
t = Oi(t);
|
|
2194
2224
|
var r = i.pointToPixel(t.getNorthEast()), s = i.pointToPixel(t.getSouthWest());
|
|
@@ -2196,9 +2226,9 @@ var vr = function(i, t, e) {
|
|
|
2196
2226
|
var n = i.pixelToPoint(r), a = i.pixelToPoint(s);
|
|
2197
2227
|
return new BMap.Bounds(a, n);
|
|
2198
2228
|
}, Oi = function(i) {
|
|
2199
|
-
var t =
|
|
2229
|
+
var t = ke(i.getNorthEast().lng, -180, 180), e = ke(i.getSouthWest().lng, -180, 180), r = ke(i.getNorthEast().lat, -74, 74), s = ke(i.getSouthWest().lat, -74, 74);
|
|
2200
2230
|
return new BMap.Bounds(new BMap.Point(e, s), new BMap.Point(t, r));
|
|
2201
|
-
},
|
|
2231
|
+
}, ke = function(i, t, e) {
|
|
2202
2232
|
return t && (i = Math.max(i, t)), e && (i = Math.min(i, e)), i;
|
|
2203
2233
|
}, _r = function(i) {
|
|
2204
2234
|
return Object.prototype.toString.call(i) === "[object Array]";
|
|
@@ -2446,7 +2476,7 @@ N.prototype.getBounds = function() {
|
|
|
2446
2476
|
N.prototype.getCenter = function() {
|
|
2447
2477
|
return this._center;
|
|
2448
2478
|
};
|
|
2449
|
-
var
|
|
2479
|
+
var ze;
|
|
2450
2480
|
((i) => {
|
|
2451
2481
|
function t(r) {
|
|
2452
2482
|
return {
|
|
@@ -2471,7 +2501,7 @@ var $e;
|
|
|
2471
2501
|
};
|
|
2472
2502
|
}
|
|
2473
2503
|
i.toGoogle = e;
|
|
2474
|
-
})(
|
|
2504
|
+
})(ze || (ze = {}));
|
|
2475
2505
|
class Tr {
|
|
2476
2506
|
constructor(t) {
|
|
2477
2507
|
this.map = t;
|
|
@@ -2509,7 +2539,7 @@ class Ci extends Tr {
|
|
|
2509
2539
|
maxZoom: r.maxZoom,
|
|
2510
2540
|
minClusterSize: r.minClusterSize,
|
|
2511
2541
|
isAverageCenter: r.averageCenter,
|
|
2512
|
-
styles: (n = r.styles) == null ? void 0 : n.map((a) =>
|
|
2542
|
+
styles: (n = r.styles) == null ? void 0 : n.map((a) => ze.toBaidu(a)),
|
|
2513
2543
|
zIndex: r.zIndex
|
|
2514
2544
|
});
|
|
2515
2545
|
const s = r.stylesIndexCalculator;
|
|
@@ -2533,7 +2563,7 @@ class wi extends Tr {
|
|
|
2533
2563
|
maxZoom: r.maxZoom,
|
|
2534
2564
|
minimumClusterSize: r.minClusterSize,
|
|
2535
2565
|
averageCenter: r.averageCenter,
|
|
2536
|
-
styles: (a = r.styles) == null ? void 0 : a.map((h) =>
|
|
2566
|
+
styles: (a = r.styles) == null ? void 0 : a.map((h) => ze.toGoogle(h)),
|
|
2537
2567
|
zIndex: r.zIndex
|
|
2538
2568
|
}
|
|
2539
2569
|
);
|
|
@@ -2630,7 +2660,7 @@ class Li extends Mr {
|
|
|
2630
2660
|
return new Promise((s, n) => {
|
|
2631
2661
|
const a = new BMap.LocalSearch(e ?? this.map.innerMap, {
|
|
2632
2662
|
onSearchComplete: (h) => {
|
|
2633
|
-
Array.isArray(h) &&
|
|
2663
|
+
Array.isArray(h) && dt("当前只支持一次搜索一条数据");
|
|
2634
2664
|
const o = a.getStatus();
|
|
2635
2665
|
switch (o) {
|
|
2636
2666
|
case BMAP_STATUS_SUCCESS: {
|
|
@@ -2676,7 +2706,7 @@ class Or {
|
|
|
2676
2706
|
* @mustCallSuper 子类必须调用一次`super.setSearchListener`, 用来保存{@link onData}和{@link onError}
|
|
2677
2707
|
* */
|
|
2678
2708
|
setSearchListener(t, e) {
|
|
2679
|
-
return this.onData && C("setSearchListener只能调用一次"), this.onData = t, this.onError = e,
|
|
2709
|
+
return this.onData && C("setSearchListener只能调用一次"), this.onData = t, this.onError = e, Te;
|
|
2680
2710
|
}
|
|
2681
2711
|
}
|
|
2682
2712
|
class Pi extends Or {
|
|
@@ -2715,7 +2745,7 @@ class xi extends Or {
|
|
|
2715
2745
|
}
|
|
2716
2746
|
}
|
|
2717
2747
|
var ki = /* @__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))(ki || {});
|
|
2718
|
-
class
|
|
2748
|
+
class bt {
|
|
2719
2749
|
constructor(t) {
|
|
2720
2750
|
c(this, "latestInfoWindow");
|
|
2721
2751
|
/** 使用{@link setEventTargetDelegate}初始化 */
|
|
@@ -2784,7 +2814,7 @@ function Cr(i) {
|
|
|
2784
2814
|
var t, e;
|
|
2785
2815
|
return !(Vt(i) === !1 || (t = i.constructor, typeof t != "function") || (e = t.prototype, Vt(e) === !1) || e.hasOwnProperty("isPrototypeOf") === !1);
|
|
2786
2816
|
}
|
|
2787
|
-
var
|
|
2817
|
+
var Oe;
|
|
2788
2818
|
((i) => {
|
|
2789
2819
|
function t(h, o) {
|
|
2790
2820
|
return h.reduce((l, d) => (l[o(d)] = d, l), {});
|
|
@@ -2818,7 +2848,7 @@ var Te;
|
|
|
2818
2848
|
return d;
|
|
2819
2849
|
}
|
|
2820
2850
|
i.pick = a;
|
|
2821
|
-
})(
|
|
2851
|
+
})(Oe || (Oe = {}));
|
|
2822
2852
|
function Ft(i) {
|
|
2823
2853
|
if (i.length <= 4)
|
|
2824
2854
|
return i.includes.bind(i);
|
|
@@ -2827,19 +2857,19 @@ function Ft(i) {
|
|
|
2827
2857
|
return t.has.bind(t);
|
|
2828
2858
|
}
|
|
2829
2859
|
}
|
|
2830
|
-
|
|
2860
|
+
Oe.toJsonSafely;
|
|
2831
2861
|
const Ii = ["single", "multi"];
|
|
2832
|
-
var j = /* @__PURE__ */ ((i) => (i.auto = "auto", i.none = "none", i.greedy = "greedy", i.cooperative = "cooperative", i))(j || {}),
|
|
2862
|
+
var j = /* @__PURE__ */ ((i) => (i.auto = "auto", i.none = "none", i.greedy = "greedy", i.cooperative = "cooperative", i))(j || {}), at;
|
|
2833
2863
|
((i) => {
|
|
2834
2864
|
function t(e) {
|
|
2835
|
-
|
|
2865
|
+
Oe.deleteUndefinedPropertyOnPlainObjectDeeply(e);
|
|
2836
2866
|
const r = { center: y.ZERO, zoom: 5 };
|
|
2837
2867
|
return rr(r, e || {}, {
|
|
2838
2868
|
isMergeableObject: Cr
|
|
2839
2869
|
});
|
|
2840
2870
|
}
|
|
2841
2871
|
i.create = t;
|
|
2842
|
-
})(
|
|
2872
|
+
})(at || (at = {}));
|
|
2843
2873
|
class wr {
|
|
2844
2874
|
constructor(t, e, r) {
|
|
2845
2875
|
c(this, "_delegate");
|
|
@@ -2858,7 +2888,7 @@ class wr {
|
|
|
2858
2888
|
this.map.removeOverlay(this);
|
|
2859
2889
|
}
|
|
2860
2890
|
}
|
|
2861
|
-
class
|
|
2891
|
+
class Tt extends wr {
|
|
2862
2892
|
constructor(t, e, r) {
|
|
2863
2893
|
super(t, e, r);
|
|
2864
2894
|
}
|
|
@@ -2928,7 +2958,7 @@ let I = je;
|
|
|
2928
2958
|
* 故统一加个0.001, 规避这些问题...
|
|
2929
2959
|
*/
|
|
2930
2960
|
c(I, "OPACITY_DELTA", 1e-3);
|
|
2931
|
-
class Ye extends
|
|
2961
|
+
class Ye extends Tt {
|
|
2932
2962
|
isEditable() {
|
|
2933
2963
|
return this.innerOverlay.getEditable();
|
|
2934
2964
|
}
|
|
@@ -2951,7 +2981,7 @@ class Ye extends bt {
|
|
|
2951
2981
|
this.innerOverlay.setOptions({ fillOpacity: t });
|
|
2952
2982
|
}
|
|
2953
2983
|
}
|
|
2954
|
-
class
|
|
2984
|
+
class Mt extends I {
|
|
2955
2985
|
constructor() {
|
|
2956
2986
|
super(...arguments);
|
|
2957
2987
|
c(this, "prevCenter");
|
|
@@ -2982,7 +3012,7 @@ class Tt extends I {
|
|
|
2982
3012
|
strokeWeight: e.strokeWeight,
|
|
2983
3013
|
fillColor: e.fillColor,
|
|
2984
3014
|
fillOpacity: e.fillOpacity != null ? e.fillOpacity + I.OPACITY_DELTA : void 0
|
|
2985
|
-
}), n = new
|
|
3015
|
+
}), n = new Mt(s, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
2986
3016
|
return n.state.editable && setTimeout(() => {
|
|
2987
3017
|
n.state.editable && s.enableEditing();
|
|
2988
3018
|
}, 0), n;
|
|
@@ -3013,7 +3043,7 @@ class Tt extends I {
|
|
|
3013
3043
|
return this.innerOverlay.getRadius();
|
|
3014
3044
|
}
|
|
3015
3045
|
}
|
|
3016
|
-
class
|
|
3046
|
+
class Ot extends Ye {
|
|
3017
3047
|
static create(t) {
|
|
3018
3048
|
const e = this.coordType, r = new google.maps.Circle({
|
|
3019
3049
|
center: t.center.toGoogle(e),
|
|
@@ -3027,7 +3057,7 @@ class Mt extends Ye {
|
|
|
3027
3057
|
fillOpacity: t.fillOpacity,
|
|
3028
3058
|
visible: t.visible
|
|
3029
3059
|
});
|
|
3030
|
-
return new
|
|
3060
|
+
return new Ot(r, e, this);
|
|
3031
3061
|
}
|
|
3032
3062
|
setCenter(t) {
|
|
3033
3063
|
this.coordType = this.map.coordType, this.innerOverlay.setCenter(t.toGoogle(this.coordType));
|
|
@@ -3055,9 +3085,9 @@ var X;
|
|
|
3055
3085
|
((i) => {
|
|
3056
3086
|
i.ZERO = { x: 0, y: 0 };
|
|
3057
3087
|
})(X || (X = {}));
|
|
3058
|
-
let
|
|
3088
|
+
let et;
|
|
3059
3089
|
function Si(i, t, e, r, s, n) {
|
|
3060
|
-
return
|
|
3090
|
+
return et || (et = Ai()), new et(i, t, e, r, s, n);
|
|
3061
3091
|
}
|
|
3062
3092
|
function Ai() {
|
|
3063
3093
|
Er();
|
|
@@ -3126,7 +3156,7 @@ function Ai() {
|
|
|
3126
3156
|
}
|
|
3127
3157
|
};
|
|
3128
3158
|
}
|
|
3129
|
-
class
|
|
3159
|
+
class Ct {
|
|
3130
3160
|
constructor(t) {
|
|
3131
3161
|
this.delegate = t, this.delegate.setTarget(this);
|
|
3132
3162
|
}
|
|
@@ -3137,7 +3167,7 @@ class Ot {
|
|
|
3137
3167
|
this.delegate.removeEventListener(t, e);
|
|
3138
3168
|
}
|
|
3139
3169
|
}
|
|
3140
|
-
class
|
|
3170
|
+
class wt extends Ct {
|
|
3141
3171
|
constructor(t, e, r) {
|
|
3142
3172
|
super(new ae(t, e)), this.inner = t, this.map = e, this.state = r;
|
|
3143
3173
|
}
|
|
@@ -3147,7 +3177,7 @@ class Ct extends Ot {
|
|
|
3147
3177
|
offset: t.offset && new BMap.Size(t.offset.x, t.offset.y),
|
|
3148
3178
|
enableAutoPan: !t.disableAutoPan
|
|
3149
3179
|
});
|
|
3150
|
-
return new
|
|
3180
|
+
return new wt(r, this, { position: e });
|
|
3151
3181
|
}
|
|
3152
3182
|
isOpen() {
|
|
3153
3183
|
return this.inner.isOpen();
|
|
@@ -3166,7 +3196,7 @@ class Ct extends Ot {
|
|
|
3166
3196
|
this.state.position = t, this.inner.isOpen() && this.open();
|
|
3167
3197
|
}
|
|
3168
3198
|
}
|
|
3169
|
-
class
|
|
3199
|
+
class Et extends Ct {
|
|
3170
3200
|
constructor(e, r) {
|
|
3171
3201
|
super(new re(e, r));
|
|
3172
3202
|
c(this, "eventHub", new ar());
|
|
@@ -3186,7 +3216,7 @@ class wt extends Ot {
|
|
|
3186
3216
|
position: r.toGoogle(this.coordType),
|
|
3187
3217
|
disableAutoPan: e.disableAutoPan
|
|
3188
3218
|
});
|
|
3189
|
-
return new
|
|
3219
|
+
return new Et(s, this);
|
|
3190
3220
|
}
|
|
3191
3221
|
isOpen() {
|
|
3192
3222
|
return this.isOpened;
|
|
@@ -3224,7 +3254,7 @@ class wt extends Ot {
|
|
|
3224
3254
|
this.inner.setPosition(e.toGoogle(this.map.coordType));
|
|
3225
3255
|
}
|
|
3226
3256
|
}
|
|
3227
|
-
class
|
|
3257
|
+
class Lt extends Ue {
|
|
3228
3258
|
constructor(t, e, r) {
|
|
3229
3259
|
super(t, e, r), this.baiduMap = r;
|
|
3230
3260
|
}
|
|
@@ -3238,7 +3268,7 @@ class Et extends Ue {
|
|
|
3238
3268
|
t.maxWidth,
|
|
3239
3269
|
t.borderClass
|
|
3240
3270
|
);
|
|
3241
|
-
return new
|
|
3271
|
+
return new Lt(r, e, this);
|
|
3242
3272
|
}
|
|
3243
3273
|
open(t) {
|
|
3244
3274
|
this.innerOverlay.open(this.baiduMap.innerMap, t == null ? void 0 : t.innerOverlay);
|
|
@@ -3259,7 +3289,7 @@ class Et extends Ue {
|
|
|
3259
3289
|
this.innerOverlay.setZIndex(t);
|
|
3260
3290
|
}
|
|
3261
3291
|
}
|
|
3262
|
-
class
|
|
3292
|
+
class Pt extends Ct {
|
|
3263
3293
|
constructor(t, e, r) {
|
|
3264
3294
|
super(new re(t, r)), this.inner = t, this.coordType = e, this.map = r;
|
|
3265
3295
|
}
|
|
@@ -3276,7 +3306,7 @@ class Lt extends Ot {
|
|
|
3276
3306
|
var h;
|
|
3277
3307
|
const a = (h = t.content.parentElement) == null ? void 0 : h.parentElement;
|
|
3278
3308
|
a && a.className.includes("gm-style-iw-c") && !a.className.includes(s) && (a.className += ` ${s}`);
|
|
3279
|
-
}), new
|
|
3309
|
+
}), new Pt(r, e, this);
|
|
3280
3310
|
}
|
|
3281
3311
|
open(t) {
|
|
3282
3312
|
this.inner.open(this.map.innerMap, t == null ? void 0 : t.innerOverlay);
|
|
@@ -3333,7 +3363,7 @@ const Ri = {
|
|
|
3333
3363
|
return t && s.endsWith(t) ? s.slice(0, -t.length) : s;
|
|
3334
3364
|
}
|
|
3335
3365
|
};
|
|
3336
|
-
var
|
|
3366
|
+
var Ce = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overlayMouseTarget = "overlayMouseTarget", i.float = "float", i))(Ce || {}), we;
|
|
3337
3367
|
((i) => {
|
|
3338
3368
|
function t(r, s) {
|
|
3339
3369
|
switch (r) {
|
|
@@ -3346,7 +3376,7 @@ var Me = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overla
|
|
|
3346
3376
|
case "map":
|
|
3347
3377
|
return s.mapPane;
|
|
3348
3378
|
default:
|
|
3349
|
-
|
|
3379
|
+
it(r);
|
|
3350
3380
|
}
|
|
3351
3381
|
}
|
|
3352
3382
|
i.toGoogle = t;
|
|
@@ -3361,11 +3391,11 @@ var Me = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overla
|
|
|
3361
3391
|
case "map":
|
|
3362
3392
|
return s.mapPane;
|
|
3363
3393
|
default:
|
|
3364
|
-
|
|
3394
|
+
it(r);
|
|
3365
3395
|
}
|
|
3366
3396
|
}
|
|
3367
3397
|
i.toBaidu = e;
|
|
3368
|
-
})(
|
|
3398
|
+
})(we || (we = {}));
|
|
3369
3399
|
class $i {
|
|
3370
3400
|
constructor(t, e) {
|
|
3371
3401
|
c(this, "baidu");
|
|
@@ -3392,7 +3422,7 @@ class $i {
|
|
|
3392
3422
|
initialize(n) {
|
|
3393
3423
|
var o;
|
|
3394
3424
|
const a = t.create(), h = n.getPanes();
|
|
3395
|
-
return (o =
|
|
3425
|
+
return (o = we.toBaidu(t.mapPane, h)) == null || o.appendChild(a), a;
|
|
3396
3426
|
}
|
|
3397
3427
|
draw() {
|
|
3398
3428
|
t.draw();
|
|
@@ -3417,7 +3447,7 @@ class $i {
|
|
|
3417
3447
|
class e extends google.maps.OverlayView {
|
|
3418
3448
|
onAdd() {
|
|
3419
3449
|
const s = t.create(), n = this.getPanes() ?? C("onAdd回调中一定会有panes");
|
|
3420
|
-
|
|
3450
|
+
we.toGoogle(t.mapPane, n).appendChild(s);
|
|
3421
3451
|
}
|
|
3422
3452
|
draw() {
|
|
3423
3453
|
t.draw();
|
|
@@ -3439,13 +3469,13 @@ class $i {
|
|
|
3439
3469
|
return this.google;
|
|
3440
3470
|
}
|
|
3441
3471
|
}
|
|
3442
|
-
let
|
|
3472
|
+
let tt;
|
|
3443
3473
|
function zi(i, t, e, r, s) {
|
|
3444
|
-
return
|
|
3474
|
+
return tt || (tt = Di()), new tt(i, t, e, r, s);
|
|
3445
3475
|
}
|
|
3446
3476
|
function Di() {
|
|
3447
3477
|
return class extends google.maps.OverlayView {
|
|
3448
|
-
constructor(e, r, s, n =
|
|
3478
|
+
constructor(e, r, s, n = Ce.overlayMouseTarget, a) {
|
|
3449
3479
|
super();
|
|
3450
3480
|
c(this, "container");
|
|
3451
3481
|
this.position = r, this.offset = s, this._mapPane = n, this.container = document.createElement("div"), this.container.className = "label-container", this.container.style.position = "absolute", a && this.setZIndex(a), this.container.addEventListener("click", () => {
|
|
@@ -3461,7 +3491,7 @@ function Di() {
|
|
|
3461
3491
|
}
|
|
3462
3492
|
onAdd() {
|
|
3463
3493
|
const e = this.getPanes() ?? C("onAdd回调中一定能够获取panes");
|
|
3464
|
-
|
|
3494
|
+
we.toGoogle(this._mapPane, e).appendChild(this.container);
|
|
3465
3495
|
}
|
|
3466
3496
|
draw() {
|
|
3467
3497
|
var e, r;
|
|
@@ -3512,7 +3542,7 @@ var ue;
|
|
|
3512
3542
|
}
|
|
3513
3543
|
i.toElement = e;
|
|
3514
3544
|
})(ue || (ue = {}));
|
|
3515
|
-
class
|
|
3545
|
+
class xt extends Ue {
|
|
3516
3546
|
constructor(e, r, s, n) {
|
|
3517
3547
|
super(e, r, s);
|
|
3518
3548
|
c(this, "icon");
|
|
@@ -3532,7 +3562,7 @@ class Pt extends Ue {
|
|
|
3532
3562
|
padding: "0px",
|
|
3533
3563
|
backgroundColor: "unset"
|
|
3534
3564
|
});
|
|
3535
|
-
const n = new
|
|
3565
|
+
const n = new xt(s, r, this, e.content);
|
|
3536
3566
|
return s.__label__ = n, n;
|
|
3537
3567
|
}
|
|
3538
3568
|
setContentInternal(e, r = !1) {
|
|
@@ -3612,7 +3642,7 @@ class Pt extends Ue {
|
|
|
3612
3642
|
this.iconAnchor && (n -= this.iconAnchor.width, a -= this.iconAnchor.height), r && (n += r.width, a += r.height), this.innerOverlay.setOffset(new BMap.Size(n, a)), this.icon = e, this.iconAnchor = r;
|
|
3613
3643
|
}
|
|
3614
3644
|
}
|
|
3615
|
-
class
|
|
3645
|
+
class kt extends Tt {
|
|
3616
3646
|
static create(t) {
|
|
3617
3647
|
var s;
|
|
3618
3648
|
const e = this.coordType, r = zi(
|
|
@@ -3622,7 +3652,7 @@ class xt extends bt {
|
|
|
3622
3652
|
t.mapPane,
|
|
3623
3653
|
t.zIndex
|
|
3624
3654
|
);
|
|
3625
|
-
return new
|
|
3655
|
+
return new kt(r, e, this);
|
|
3626
3656
|
}
|
|
3627
3657
|
setZIndex(t) {
|
|
3628
3658
|
this.innerOverlay.setZIndex(t);
|
|
@@ -3644,11 +3674,11 @@ class xt extends bt {
|
|
|
3644
3674
|
this.innerOverlay.setOffset(t);
|
|
3645
3675
|
}
|
|
3646
3676
|
}
|
|
3647
|
-
const
|
|
3648
|
-
toGoogle: (i) => "url" in i ?
|
|
3649
|
-
toBaidu: (i) => "url" in i ?
|
|
3677
|
+
const De = {
|
|
3678
|
+
toGoogle: (i) => "url" in i ? Ne.toGoogle(i) : Ge.toGoogle(i),
|
|
3679
|
+
toBaidu: (i) => "url" in i ? Ne.toBaidu(i) : Ge.toBaidu(i)
|
|
3650
3680
|
};
|
|
3651
|
-
var
|
|
3681
|
+
var Ne;
|
|
3652
3682
|
((i) => {
|
|
3653
3683
|
function t(r) {
|
|
3654
3684
|
return {
|
|
@@ -3672,8 +3702,8 @@ var De;
|
|
|
3672
3702
|
});
|
|
3673
3703
|
}
|
|
3674
3704
|
i.toBaidu = e;
|
|
3675
|
-
})(
|
|
3676
|
-
var
|
|
3705
|
+
})(Ne || (Ne = {}));
|
|
3706
|
+
var Ge;
|
|
3677
3707
|
((i) => {
|
|
3678
3708
|
function t(r) {
|
|
3679
3709
|
return {
|
|
@@ -3704,7 +3734,7 @@ var Ne;
|
|
|
3704
3734
|
return s.__icon__ = r, s;
|
|
3705
3735
|
}
|
|
3706
3736
|
i.toBaidu = e;
|
|
3707
|
-
})(
|
|
3737
|
+
})(Ge || (Ge = {}));
|
|
3708
3738
|
const Us = {
|
|
3709
3739
|
CIRCLE: { baidu: () => BMap_Symbol_SHAPE_CIRCLE, google: () => google.maps.SymbolPath.CIRCLE },
|
|
3710
3740
|
BACKWARD_CLOSED_ARROW: { baidu: () => BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW, google: () => google.maps.SymbolPath.BACKWARD_CLOSED_ARROW },
|
|
@@ -3712,14 +3742,14 @@ const Us = {
|
|
|
3712
3742
|
FORWARD_CLOSED_ARROW: { baidu: () => BMap_Symbol_SHAPE_FORWARD_CLOSED_ARROW, google: () => google.maps.SymbolPath.FORWARD_CLOSED_ARROW },
|
|
3713
3743
|
FORWARD_OPEN_ARROW: { baidu: () => BMap_Symbol_SHAPE_FORWARD_OPEN_ARROW, google: () => google.maps.SymbolPath.FORWARD_OPEN_ARROW }
|
|
3714
3744
|
};
|
|
3715
|
-
class
|
|
3745
|
+
class Ee extends Ue {
|
|
3716
3746
|
constructor(t, e, r, s) {
|
|
3717
3747
|
super(t, e, r), this.state = s;
|
|
3718
3748
|
}
|
|
3719
3749
|
static create(t) {
|
|
3720
3750
|
const e = this.coordType, r = t.icon, s = {
|
|
3721
3751
|
title: t.title,
|
|
3722
|
-
icon: r &&
|
|
3752
|
+
icon: r && De.toBaidu(r),
|
|
3723
3753
|
enableClicking: t.clickable,
|
|
3724
3754
|
enableDragging: t.draggable,
|
|
3725
3755
|
// baidu的raiseOnDrag属性, 默认为false, 而我们的options.crossOnDrag默认为true, 故这里需要转换下
|
|
@@ -3728,7 +3758,7 @@ class Ce extends Ue {
|
|
|
3728
3758
|
}, n = new BMap.Marker(t.position.toBaidu(e, t.normalizePositionForBaidu), s);
|
|
3729
3759
|
t.zIndex !== void 0 && n.setZIndex(t.zIndex);
|
|
3730
3760
|
const a = t.clickable === void 0 ? !0 : t.clickable, h = !!t.draggable;
|
|
3731
|
-
return new
|
|
3761
|
+
return new Ee(n, e, this, { clickable: a, draggable: h, zIndex: t.zIndex, normalize: t.normalizePositionForBaidu }).visibleOptionInternal(t.visible);
|
|
3732
3762
|
}
|
|
3733
3763
|
getPosition() {
|
|
3734
3764
|
return y.fromBaidu(this.innerOverlay.getPosition(), this.coordType);
|
|
@@ -3744,7 +3774,7 @@ class Ce extends Ue {
|
|
|
3744
3774
|
return this.innerOverlay.getTitle();
|
|
3745
3775
|
}
|
|
3746
3776
|
setIcon(t) {
|
|
3747
|
-
const e =
|
|
3777
|
+
const e = De.toBaidu(t);
|
|
3748
3778
|
this.innerOverlay.setIcon(e);
|
|
3749
3779
|
const r = this.getLabel();
|
|
3750
3780
|
r && r.attachIcon(e);
|
|
@@ -3779,7 +3809,7 @@ class Ce extends Ue {
|
|
|
3779
3809
|
return (t = this.innerOverlay.getLabel()) == null ? void 0 : t.__label__;
|
|
3780
3810
|
}
|
|
3781
3811
|
}
|
|
3782
|
-
class
|
|
3812
|
+
class Bt extends Tt {
|
|
3783
3813
|
constructor() {
|
|
3784
3814
|
super(...arguments);
|
|
3785
3815
|
c(this, "label");
|
|
@@ -3793,7 +3823,7 @@ class kt extends bt {
|
|
|
3793
3823
|
title: e.title,
|
|
3794
3824
|
zIndex: e.zIndex,
|
|
3795
3825
|
visible: e.visible,
|
|
3796
|
-
icon: s &&
|
|
3826
|
+
icon: s && De.toGoogle(s),
|
|
3797
3827
|
clickable: e.clickable,
|
|
3798
3828
|
draggable: e.draggable,
|
|
3799
3829
|
// google的crossOnDrag和我们的crossOnDrag是匹配的, 不需要转换
|
|
@@ -3802,7 +3832,7 @@ class kt extends bt {
|
|
|
3802
3832
|
// InfoWindow相对marker的position的偏移量, 若不指定, 则偏移到marker的icon的上部中央
|
|
3803
3833
|
anchorPoint: new google.maps.Point(0, 0)
|
|
3804
3834
|
};
|
|
3805
|
-
return new
|
|
3835
|
+
return new Bt(new google.maps.Marker(n), r, this);
|
|
3806
3836
|
}
|
|
3807
3837
|
getPosition() {
|
|
3808
3838
|
return y.fromGoogle(this.innerOverlay.getPosition(), this.coordType);
|
|
@@ -3817,7 +3847,7 @@ class kt extends bt {
|
|
|
3817
3847
|
return this.innerOverlay.getTitle() || "";
|
|
3818
3848
|
}
|
|
3819
3849
|
setIcon(e) {
|
|
3820
|
-
this.innerOverlay.setIcon(
|
|
3850
|
+
this.innerOverlay.setIcon(De.toGoogle(e));
|
|
3821
3851
|
}
|
|
3822
3852
|
getIcon() {
|
|
3823
3853
|
return this.innerOverlay.getIcon();
|
|
@@ -3855,7 +3885,7 @@ class kt extends bt {
|
|
|
3855
3885
|
this.label = void 0, this.labelPositionListener = void 0, this.labelVisibleListener = void 0, this.labelMapChangedListener = void 0;
|
|
3856
3886
|
}
|
|
3857
3887
|
}
|
|
3858
|
-
class
|
|
3888
|
+
class It extends I {
|
|
3859
3889
|
constructor() {
|
|
3860
3890
|
super(...arguments);
|
|
3861
3891
|
c(this, "eventHubDelegate");
|
|
@@ -3891,7 +3921,7 @@ class Bt extends I {
|
|
|
3891
3921
|
});
|
|
3892
3922
|
}
|
|
3893
3923
|
}
|
|
3894
|
-
class
|
|
3924
|
+
class St extends It {
|
|
3895
3925
|
constructor() {
|
|
3896
3926
|
super(...arguments);
|
|
3897
3927
|
c(this, "pathEditedEventType", "path-edited");
|
|
@@ -3904,7 +3934,7 @@ class It extends Bt {
|
|
|
3904
3934
|
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity + I.OPACITY_DELTA : void 0,
|
|
3905
3935
|
strokeWeight: e.strokeWeight
|
|
3906
3936
|
});
|
|
3907
|
-
return new
|
|
3937
|
+
return new St(s, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
3908
3938
|
}
|
|
3909
3939
|
getPath() {
|
|
3910
3940
|
return this.innerOverlay.getPath().map((e) => y.fromBaidu(e, this.coordType));
|
|
@@ -3913,7 +3943,7 @@ class It extends Bt {
|
|
|
3913
3943
|
this.coordType = this.map.coordType, this.setPathInternal(e.map((r) => r.toBaidu(this.coordType)));
|
|
3914
3944
|
}
|
|
3915
3945
|
}
|
|
3916
|
-
class
|
|
3946
|
+
class At extends Ye {
|
|
3917
3947
|
constructor() {
|
|
3918
3948
|
super(...arguments);
|
|
3919
3949
|
c(this, "pathChangedListeners");
|
|
@@ -3929,7 +3959,7 @@ class St extends Ye {
|
|
|
3929
3959
|
strokeWeight: e.strokeWeight,
|
|
3930
3960
|
visible: e.visible
|
|
3931
3961
|
});
|
|
3932
|
-
return new
|
|
3962
|
+
return new At(s, r, this);
|
|
3933
3963
|
}
|
|
3934
3964
|
setupPathChangedListeners() {
|
|
3935
3965
|
const e = () => {
|
|
@@ -3960,7 +3990,7 @@ class St extends Ye {
|
|
|
3960
3990
|
this.coordType = this.map.coordType, this.innerOverlay.setPath(e.map((s) => s.toGoogle(this.coordType))), (r = this.eventHubDelegate) != null && r.hasListener("path-edited") && this.setupPathChangedListeners();
|
|
3961
3991
|
}
|
|
3962
3992
|
}
|
|
3963
|
-
class
|
|
3993
|
+
class Rt extends It {
|
|
3964
3994
|
constructor() {
|
|
3965
3995
|
super(...arguments);
|
|
3966
3996
|
c(this, "pathEditedEventType", "paths-edited");
|
|
@@ -3977,7 +4007,7 @@ class At extends Bt {
|
|
|
3977
4007
|
fillColor: e.fillColor,
|
|
3978
4008
|
fillOpacity: e.fillOpacity != null ? e.fillOpacity + I.OPACITY_DELTA : void 0
|
|
3979
4009
|
});
|
|
3980
|
-
return new
|
|
4010
|
+
return new Rt(n, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
3981
4011
|
}
|
|
3982
4012
|
getPaths() {
|
|
3983
4013
|
return [this.innerOverlay.getPath().map((e) => y.fromBaidu(e, this.coordType))];
|
|
@@ -3986,7 +4016,7 @@ class At extends Bt {
|
|
|
3986
4016
|
e.length > 1 && console.warn("baidu不支持多path, 只会显示paths[0]"), this.coordType = this.map.coordType, this.setPathInternal((e[0] || []).map((r) => r.toBaidu(this.coordType)));
|
|
3987
4017
|
}
|
|
3988
4018
|
}
|
|
3989
|
-
class
|
|
4019
|
+
class $t extends Ye {
|
|
3990
4020
|
constructor() {
|
|
3991
4021
|
super(...arguments);
|
|
3992
4022
|
c(this, "pathChangedListeners");
|
|
@@ -4004,7 +4034,7 @@ class Rt extends Ye {
|
|
|
4004
4034
|
fillOpacity: e.fillOpacity,
|
|
4005
4035
|
visible: e.visible
|
|
4006
4036
|
});
|
|
4007
|
-
return new
|
|
4037
|
+
return new $t(s, r, this);
|
|
4008
4038
|
}
|
|
4009
4039
|
setupPathChangedListeners() {
|
|
4010
4040
|
const e = () => {
|
|
@@ -4040,7 +4070,7 @@ class Rt extends Ye {
|
|
|
4040
4070
|
this.coordType = this.map.coordType, this.innerOverlay.setPaths(e.map((s) => s.map((n) => n.toGoogle(this.coordType)))), (r = this.eventHubDelegate) != null && r.hasListener("paths-edited") && this.setupPathChangedListeners();
|
|
4041
4071
|
}
|
|
4042
4072
|
}
|
|
4043
|
-
class
|
|
4073
|
+
class zt extends It {
|
|
4044
4074
|
constructor(e, r, s, n) {
|
|
4045
4075
|
super(e, r, s, n);
|
|
4046
4076
|
c(this, "pathEditedEventType", "bounds-changed");
|
|
@@ -4088,7 +4118,7 @@ class $t extends Bt {
|
|
|
4088
4118
|
fillColor: e.fillColor,
|
|
4089
4119
|
fillOpacity: e.fillOpacity != null ? e.fillOpacity + I.OPACITY_DELTA : void 0
|
|
4090
4120
|
});
|
|
4091
|
-
return new
|
|
4121
|
+
return new zt(s, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
4092
4122
|
}
|
|
4093
4123
|
getBounds() {
|
|
4094
4124
|
return R.fromBaidu(this.innerOverlay.getBounds(), this.coordType);
|
|
@@ -4100,7 +4130,7 @@ class $t extends Bt {
|
|
|
4100
4130
|
}) : this.setPathInternal(r.map((s) => s.toBaidu(this.coordType)));
|
|
4101
4131
|
}
|
|
4102
4132
|
}
|
|
4103
|
-
class
|
|
4133
|
+
class Dt extends Ye {
|
|
4104
4134
|
static create(t) {
|
|
4105
4135
|
const e = this.coordType, r = new google.maps.Rectangle({
|
|
4106
4136
|
bounds: t.bounds.toGoogle(e),
|
|
@@ -4113,7 +4143,7 @@ class zt extends Ye {
|
|
|
4113
4143
|
fillOpacity: t.fillOpacity,
|
|
4114
4144
|
visible: t.visible
|
|
4115
4145
|
});
|
|
4116
|
-
return new
|
|
4146
|
+
return new Dt(r, e, this);
|
|
4117
4147
|
}
|
|
4118
4148
|
getBounds() {
|
|
4119
4149
|
return R.fromGoogle(this.innerOverlay.getBounds() ?? J.BOUNDS_ZERO, this.coordType);
|
|
@@ -4124,24 +4154,24 @@ class zt extends Ye {
|
|
|
4124
4154
|
}
|
|
4125
4155
|
}
|
|
4126
4156
|
const ee = 1;
|
|
4127
|
-
class Ni extends
|
|
4157
|
+
class Ni extends bt {
|
|
4128
4158
|
constructor(e, r) {
|
|
4129
4159
|
var s;
|
|
4130
4160
|
super(e);
|
|
4131
4161
|
c(this, "buildInMapTypeId2BIMT");
|
|
4132
4162
|
c(this, "baiduMapType2BIMT");
|
|
4133
4163
|
c(this, "map");
|
|
4134
|
-
c(this, "createLabel",
|
|
4135
|
-
c(this, "createCircle",
|
|
4136
|
-
c(this, "createPolygon",
|
|
4137
|
-
c(this, "createPolyline",
|
|
4138
|
-
c(this, "createRectangle",
|
|
4139
|
-
c(this, "createInfoWindow",
|
|
4140
|
-
c(this, "createInfoBox",
|
|
4141
|
-
c(this, "createMarker",
|
|
4142
|
-
c(this, "createMapTypeControl",
|
|
4143
|
-
c(this, "createZoomControl",
|
|
4144
|
-
c(this, "createScaleControl",
|
|
4164
|
+
c(this, "createLabel", xt.create);
|
|
4165
|
+
c(this, "createCircle", Mt.create);
|
|
4166
|
+
c(this, "createPolygon", Rt.create);
|
|
4167
|
+
c(this, "createPolyline", St.create);
|
|
4168
|
+
c(this, "createRectangle", zt.create);
|
|
4169
|
+
c(this, "createInfoWindow", wt.create);
|
|
4170
|
+
c(this, "createInfoBox", Lt.create);
|
|
4171
|
+
c(this, "createMarker", Ee.create);
|
|
4172
|
+
c(this, "createMapTypeControl", gt.create);
|
|
4173
|
+
c(this, "createZoomControl", yt.create);
|
|
4174
|
+
c(this, "createScaleControl", mt.create);
|
|
4145
4175
|
this.buildInMapTypeId2BIMT = $.BUILD_IN_MAP_TYPES.getValueMap(A.prototype.getId), this.baiduMapType2BIMT = $.BUILD_IN_MAP_TYPES.getValueMap(A.prototype.asBaiduMapType), this.map = new BMap.Map(e, {
|
|
4146
4176
|
minZoom: r.minZoom && r.minZoom + ee,
|
|
4147
4177
|
maxZoom: r.maxZoom && r.maxZoom + ee,
|
|
@@ -4157,7 +4187,7 @@ class Ni extends _t {
|
|
|
4157
4187
|
});
|
|
4158
4188
|
}
|
|
4159
4189
|
setGestureHandling(e = j.auto) {
|
|
4160
|
-
switch (e === j.auto && (e = this.element.parentElement &&
|
|
4190
|
+
switch (e === j.auto && (e = this.element.parentElement && ot.isScrollable(this.element.parentElement) ? j.cooperative : j.greedy), e) {
|
|
4161
4191
|
case j.cooperative:
|
|
4162
4192
|
this.map.disableScrollWheelZoom(), this.map.enableDragging(), this.map.enableDoubleClickZoom();
|
|
4163
4193
|
break;
|
|
@@ -4302,27 +4332,27 @@ class Ni extends _t {
|
|
|
4302
4332
|
return new Li(this, e);
|
|
4303
4333
|
}
|
|
4304
4334
|
createMapUrls(e) {
|
|
4305
|
-
return new
|
|
4335
|
+
return new Ae(e);
|
|
4306
4336
|
}
|
|
4307
4337
|
}
|
|
4308
|
-
class Gi extends
|
|
4338
|
+
class Gi extends bt {
|
|
4309
4339
|
constructor(e, r) {
|
|
4310
4340
|
var n;
|
|
4311
4341
|
super(e);
|
|
4312
4342
|
c(this, "buildInMapTypeId2BIMT");
|
|
4313
4343
|
c(this, "googleMapTypeId2BIMT");
|
|
4314
4344
|
c(this, "map");
|
|
4315
|
-
c(this, "createLabel",
|
|
4316
|
-
c(this, "createCircle",
|
|
4317
|
-
c(this, "createPolygon",
|
|
4318
|
-
c(this, "createPolyline",
|
|
4319
|
-
c(this, "createRectangle",
|
|
4320
|
-
c(this, "createInfoWindow",
|
|
4321
|
-
c(this, "createInfoBox",
|
|
4322
|
-
c(this, "createMarker",
|
|
4323
|
-
c(this, "createMapTypeControl",
|
|
4324
|
-
c(this, "createZoomControl",
|
|
4325
|
-
c(this, "createScaleControl",
|
|
4345
|
+
c(this, "createLabel", kt.create);
|
|
4346
|
+
c(this, "createCircle", Ot.create);
|
|
4347
|
+
c(this, "createPolygon", $t.create);
|
|
4348
|
+
c(this, "createPolyline", At.create);
|
|
4349
|
+
c(this, "createRectangle", Dt.create);
|
|
4350
|
+
c(this, "createInfoWindow", Et.create);
|
|
4351
|
+
c(this, "createInfoBox", Pt.create);
|
|
4352
|
+
c(this, "createMarker", Bt.create);
|
|
4353
|
+
c(this, "createMapTypeControl", Ie.create);
|
|
4354
|
+
c(this, "createZoomControl", vt.create);
|
|
4355
|
+
c(this, "createScaleControl", ft.create);
|
|
4326
4356
|
this.mapOptions = r, this.buildInMapTypeId2BIMT = $.BUILD_IN_MAP_TYPES.getValueMap(A.prototype.getId), this.googleMapTypeId2BIMT = $.BUILD_IN_MAP_TYPES.getValueMap(A.prototype.getGoogleMapTypeId);
|
|
4327
4357
|
const s = r.buildInMapTypeId && this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId);
|
|
4328
4358
|
this.map = new google.maps.Map(e, {
|
|
@@ -4463,10 +4493,10 @@ class Gi extends _t {
|
|
|
4463
4493
|
return new Ei(this, e);
|
|
4464
4494
|
}
|
|
4465
4495
|
createMapUrls(e) {
|
|
4466
|
-
return new
|
|
4496
|
+
return new Se(e);
|
|
4467
4497
|
}
|
|
4468
4498
|
}
|
|
4469
|
-
class Zi extends
|
|
4499
|
+
class Zi extends bt {
|
|
4470
4500
|
constructor(e, r) {
|
|
4471
4501
|
var a;
|
|
4472
4502
|
super(e);
|
|
@@ -4474,7 +4504,7 @@ class Zi extends _t {
|
|
|
4474
4504
|
c(this, "defaultLayers");
|
|
4475
4505
|
this.mapOptions = r;
|
|
4476
4506
|
const s = sr().here;
|
|
4477
|
-
|
|
4507
|
+
$e.includes(s.version) || C(`不支持${s.version}, HereMap当前只支持如下版本: ${$e}`);
|
|
4478
4508
|
const n = new H.service.Platform({
|
|
4479
4509
|
app_id: s.key.split(",")[0],
|
|
4480
4510
|
app_code: s.key.split(",")[1]
|
|
@@ -4488,7 +4518,7 @@ class Zi extends _t {
|
|
|
4488
4518
|
return this.map;
|
|
4489
4519
|
}
|
|
4490
4520
|
get coordType() {
|
|
4491
|
-
return
|
|
4521
|
+
return P.wgs84;
|
|
4492
4522
|
}
|
|
4493
4523
|
getCenter() {
|
|
4494
4524
|
return y.fromHere(this.map.getCenter(), this.coordType);
|
|
@@ -4618,10 +4648,10 @@ class Zi extends _t {
|
|
|
4618
4648
|
throw new Error("Method not implemented.");
|
|
4619
4649
|
}
|
|
4620
4650
|
}
|
|
4621
|
-
var G = /* @__PURE__ */ ((i) => (i.google = "google", i.baidu = "baidu", i.here = "here", i))(G || {}),
|
|
4651
|
+
var G = /* @__PURE__ */ ((i) => (i.google = "google", i.baidu = "baidu", i.here = "here", i))(G || {}), lt;
|
|
4622
4652
|
((i) => {
|
|
4623
4653
|
function t(e, r, s) {
|
|
4624
|
-
const n =
|
|
4654
|
+
const n = at.create(s);
|
|
4625
4655
|
switch (e) {
|
|
4626
4656
|
case "google":
|
|
4627
4657
|
return new Gi(r, n);
|
|
@@ -4632,7 +4662,7 @@ var G = /* @__PURE__ */ ((i) => (i.google = "google", i.baidu = "baidu", i.here
|
|
|
4632
4662
|
}
|
|
4633
4663
|
}
|
|
4634
4664
|
i.createMap = t;
|
|
4635
|
-
})(
|
|
4665
|
+
})(lt || (lt = {}));
|
|
4636
4666
|
function Wi({ type: i, config: t }) {
|
|
4637
4667
|
const e = window, r = ji(i);
|
|
4638
4668
|
if (e[r])
|
|
@@ -4655,10 +4685,10 @@ function Wi({ type: i, config: t }) {
|
|
|
4655
4685
|
me(ge("ui", t.version))
|
|
4656
4686
|
])).catch((s) => (delete e[r], Promise.reject(s)));
|
|
4657
4687
|
default:
|
|
4658
|
-
|
|
4688
|
+
it(i);
|
|
4659
4689
|
}
|
|
4660
4690
|
}
|
|
4661
|
-
function ge(i, t =
|
|
4691
|
+
function ge(i, t = $e[0]) {
|
|
4662
4692
|
return `https://js.api.here.com/v3/${t}/mapsjs-${i}.js`;
|
|
4663
4693
|
}
|
|
4664
4694
|
function ji(i) {
|
|
@@ -4732,23 +4762,23 @@ function Ys(i) {
|
|
|
4732
4762
|
const fe = {
|
|
4733
4763
|
enumerable: !0,
|
|
4734
4764
|
configurable: !0,
|
|
4735
|
-
get:
|
|
4736
|
-
set:
|
|
4765
|
+
get: Te,
|
|
4766
|
+
set: Te
|
|
4737
4767
|
};
|
|
4738
4768
|
function Fi(i) {
|
|
4739
4769
|
return Object.keys(i).forEach((t) => {
|
|
4740
4770
|
const e = i[t];
|
|
4741
4771
|
let r = !1;
|
|
4742
|
-
typeof e == "function" ? (fe.get = e, fe.set =
|
|
4772
|
+
typeof e == "function" ? (fe.get = e, fe.set = Te, r = !0) : typeof e == "object" && typeof e.get == "function" && (fe.get = e.get, fe.set = e.set, r = !0), r && (i[t] = Object.defineProperty(i, t, fe));
|
|
4743
4773
|
}), i;
|
|
4744
4774
|
}
|
|
4745
4775
|
function qs(i) {
|
|
4746
4776
|
return Fi(i);
|
|
4747
4777
|
}
|
|
4748
4778
|
function Lr() {
|
|
4749
|
-
return
|
|
4779
|
+
return rt();
|
|
4750
4780
|
}
|
|
4751
|
-
function
|
|
4781
|
+
function Be(i, t) {
|
|
4752
4782
|
const e = i.$options[t];
|
|
4753
4783
|
if (e)
|
|
4754
4784
|
for (const r of e)
|
|
@@ -4797,17 +4827,17 @@ const Js = () => {
|
|
|
4797
4827
|
((s && s.type) !== i || Date.now() - (t ?? 0) > 1e3) && e(s);
|
|
4798
4828
|
}
|
|
4799
4829
|
return { eventLog: e, eventLogLess: r };
|
|
4800
|
-
},
|
|
4801
|
-
inject: [
|
|
4830
|
+
}, Nt = "$map", Le = "onCreate", Pe = "onDestroy", k = w({
|
|
4831
|
+
inject: [Nt],
|
|
4802
4832
|
mounted() {
|
|
4803
|
-
|
|
4833
|
+
Be(this, Le);
|
|
4804
4834
|
},
|
|
4805
4835
|
beforeUnmount() {
|
|
4806
|
-
|
|
4836
|
+
Be(this, Pe);
|
|
4807
4837
|
},
|
|
4808
4838
|
methods: {
|
|
4809
4839
|
recreate() {
|
|
4810
|
-
|
|
4840
|
+
Be(this, Pe), Be(this, Le);
|
|
4811
4841
|
}
|
|
4812
4842
|
},
|
|
4813
4843
|
render() {
|
|
@@ -4817,7 +4847,7 @@ const Js = () => {
|
|
|
4817
4847
|
name: "tg-map",
|
|
4818
4848
|
provide() {
|
|
4819
4849
|
return {
|
|
4820
|
-
[
|
|
4850
|
+
[Nt]: Kt(() => this.map)
|
|
4821
4851
|
};
|
|
4822
4852
|
},
|
|
4823
4853
|
inheritAttrs: !1,
|
|
@@ -4882,13 +4912,13 @@ const Js = () => {
|
|
|
4882
4912
|
},
|
|
4883
4913
|
data() {
|
|
4884
4914
|
return {
|
|
4885
|
-
map:
|
|
4915
|
+
map: st(),
|
|
4886
4916
|
isDestroyed: !1
|
|
4887
4917
|
};
|
|
4888
4918
|
},
|
|
4889
4919
|
computed: {
|
|
4890
4920
|
propsJson() {
|
|
4891
|
-
return
|
|
4921
|
+
return Oe.toJsonSafely(this.$props);
|
|
4892
4922
|
}
|
|
4893
4923
|
},
|
|
4894
4924
|
watch: {
|
|
@@ -4929,7 +4959,7 @@ const Js = () => {
|
|
|
4929
4959
|
console.warn(`tg-map(type=${i})已销毁, 不需要继续执行`);
|
|
4930
4960
|
return;
|
|
4931
4961
|
}
|
|
4932
|
-
const t =
|
|
4962
|
+
const t = lt.createMap(
|
|
4933
4963
|
i,
|
|
4934
4964
|
this.$refs.map,
|
|
4935
4965
|
/* options: */
|
|
@@ -4992,12 +5022,12 @@ function qi(i, t, e, r, s, n) {
|
|
|
4992
5022
|
[`tg-map__map--hide-logo-${i.type}`]: i.hideLogo
|
|
4993
5023
|
})
|
|
4994
5024
|
}, null, 2),
|
|
4995
|
-
|
|
4996
|
-
i.map ? W(i.$slots, "default", { key: 1 }) :
|
|
5025
|
+
rt("", !0),
|
|
5026
|
+
i.map ? W(i.$slots, "default", { key: 1 }) : rt("", !0),
|
|
4997
5027
|
W(i.$slots, "overlay")
|
|
4998
5028
|
], 16);
|
|
4999
5029
|
}
|
|
5000
|
-
const
|
|
5030
|
+
const xe = /* @__PURE__ */ K(Yi, [["render", qi]]);
|
|
5001
5031
|
function Ki(i) {
|
|
5002
5032
|
if (i == null)
|
|
5003
5033
|
return;
|
|
@@ -5048,7 +5078,7 @@ function Ji(i, t, e, r, s, n) {
|
|
|
5048
5078
|
}
|
|
5049
5079
|
const Qi = /* @__PURE__ */ K(Xi, [["render", Ji]]), es = w({
|
|
5050
5080
|
name: "tg-custom-control",
|
|
5051
|
-
mixins: [
|
|
5081
|
+
mixins: [k],
|
|
5052
5082
|
props: {
|
|
5053
5083
|
position: Z(S, S.RIGHT_BOTTOM)
|
|
5054
5084
|
},
|
|
@@ -5063,7 +5093,7 @@ const Qi = /* @__PURE__ */ K(Xi, [["render", Ji]]), es = w({
|
|
|
5063
5093
|
}
|
|
5064
5094
|
},
|
|
5065
5095
|
onCreate() {
|
|
5066
|
-
er(this.$parent,
|
|
5096
|
+
er(this.$parent, xe) || console.warn("请将tg-custom-control放到tg-map中");
|
|
5067
5097
|
const { $el: i } = this, t = class extends pi {
|
|
5068
5098
|
onCreateElement() {
|
|
5069
5099
|
return i;
|
|
@@ -5084,7 +5114,7 @@ function ts(i, t, e, r, s, n) {
|
|
|
5084
5114
|
}
|
|
5085
5115
|
const rs = /* @__PURE__ */ K(es, [["render", ts]]), is = w({
|
|
5086
5116
|
name: "tg-map-type-control",
|
|
5087
|
-
mixins: [
|
|
5117
|
+
mixins: [k],
|
|
5088
5118
|
props: {
|
|
5089
5119
|
position: Z(S, S.TOP_LEFT),
|
|
5090
5120
|
type: Z(cr),
|
|
@@ -5117,7 +5147,7 @@ const rs = /* @__PURE__ */ K(es, [["render", ts]]), is = w({
|
|
|
5117
5147
|
}
|
|
5118
5148
|
}), ss = w({
|
|
5119
5149
|
name: "tg-scale-control",
|
|
5120
|
-
mixins: [
|
|
5150
|
+
mixins: [k],
|
|
5121
5151
|
props: {
|
|
5122
5152
|
position: Z(S, S.BOTTOM_RIGHT)
|
|
5123
5153
|
},
|
|
@@ -5149,7 +5179,7 @@ function Pr() {
|
|
|
5149
5179
|
return t;
|
|
5150
5180
|
}
|
|
5151
5181
|
function ns() {
|
|
5152
|
-
const i = Nr(
|
|
5182
|
+
const i = Nr(Nt);
|
|
5153
5183
|
let t, e;
|
|
5154
5184
|
return i == null && C(`<${Pr() || "unknown"}>必须作为<tg-map>的子代组件`), {
|
|
5155
5185
|
mapRef: i,
|
|
@@ -5158,12 +5188,12 @@ function ns() {
|
|
|
5158
5188
|
return i.value ?? C("map尚未初始化");
|
|
5159
5189
|
},
|
|
5160
5190
|
/** 地图元素创建回调 */
|
|
5161
|
-
[
|
|
5162
|
-
Gr(r), t && C(`${
|
|
5191
|
+
[Le](r) {
|
|
5192
|
+
Gr(r), t && C(`${Le}只能调用一次`), t = r;
|
|
5163
5193
|
},
|
|
5164
5194
|
/** 地图元素销毁回调 */
|
|
5165
|
-
[
|
|
5166
|
-
Zr(r), e && C(`${
|
|
5195
|
+
[Pe](r) {
|
|
5196
|
+
Zr(r), e && C(`${Pe}只能调用一次`), e = r;
|
|
5167
5197
|
},
|
|
5168
5198
|
/** 重新创建地图元素 */
|
|
5169
5199
|
recreate() {
|
|
@@ -5189,7 +5219,7 @@ const os = w({
|
|
|
5189
5219
|
}
|
|
5190
5220
|
}), as = w({
|
|
5191
5221
|
name: "tg-marker-clusterer",
|
|
5192
|
-
mixins: [
|
|
5222
|
+
mixins: [k],
|
|
5193
5223
|
// markers从this.$children中读取, 故需要省略(Omit)
|
|
5194
5224
|
props: {
|
|
5195
5225
|
gridSize: m(Number),
|
|
@@ -5260,7 +5290,7 @@ function ls(i, t, e, r, s, n) {
|
|
|
5260
5290
|
}
|
|
5261
5291
|
const xr = /* @__PURE__ */ K(as, [["render", ls]]), hs = w({
|
|
5262
5292
|
name: "tg-traffic-layer",
|
|
5263
|
-
mixins: [
|
|
5293
|
+
mixins: [k],
|
|
5264
5294
|
// 请直接使用v-if来控制它的显隐
|
|
5265
5295
|
// 没有属性时, 写`{}`类型推断会有问题, 故注释掉
|
|
5266
5296
|
// props: {} satisfies Props<{}>,
|
|
@@ -5278,7 +5308,7 @@ const xr = /* @__PURE__ */ K(as, [["render", ls]]), hs = w({
|
|
|
5278
5308
|
}
|
|
5279
5309
|
}), cs = w({
|
|
5280
5310
|
name: "tg-circle",
|
|
5281
|
-
mixins: [
|
|
5311
|
+
mixins: [k],
|
|
5282
5312
|
inheritAttrs: !1,
|
|
5283
5313
|
props: {
|
|
5284
5314
|
center: D(y),
|
|
@@ -5373,9 +5403,9 @@ class ds extends $i {
|
|
|
5373
5403
|
}
|
|
5374
5404
|
const us = w({
|
|
5375
5405
|
name: "tg-element-overlay",
|
|
5376
|
-
mixins: [
|
|
5406
|
+
mixins: [k],
|
|
5377
5407
|
props: {
|
|
5378
|
-
mapPane: Z(
|
|
5408
|
+
mapPane: Z(Ce, Ce.overlayMouseTarget),
|
|
5379
5409
|
position: D(y)
|
|
5380
5410
|
},
|
|
5381
5411
|
setup() {
|
|
@@ -5412,7 +5442,7 @@ function ps(i, t, e, r, s, n) {
|
|
|
5412
5442
|
}
|
|
5413
5443
|
const gs = /* @__PURE__ */ K(us, [["render", ps]]), ms = w({
|
|
5414
5444
|
name: "tg-marker",
|
|
5415
|
-
mixins: [
|
|
5445
|
+
mixins: [k],
|
|
5416
5446
|
inheritAttrs: !1,
|
|
5417
5447
|
props: {
|
|
5418
5448
|
position: D(y),
|
|
@@ -5432,8 +5462,8 @@ const gs = /* @__PURE__ */ K(us, [["render", ps]]), ms = w({
|
|
|
5432
5462
|
return {
|
|
5433
5463
|
attrs: q(t, i),
|
|
5434
5464
|
marker: void 0,
|
|
5435
|
-
label:
|
|
5436
|
-
info:
|
|
5465
|
+
label: st(),
|
|
5466
|
+
info: st(),
|
|
5437
5467
|
emittedPosition: void 0
|
|
5438
5468
|
};
|
|
5439
5469
|
},
|
|
@@ -5453,7 +5483,7 @@ const gs = /* @__PURE__ */ K(us, [["render", ps]]), ms = w({
|
|
|
5453
5483
|
i ? this.marker.setIcon(i) : this.recreate();
|
|
5454
5484
|
},
|
|
5455
5485
|
clickable(i) {
|
|
5456
|
-
this.marker instanceof
|
|
5486
|
+
this.marker instanceof Ee ? this.recreate() : this.marker.setClickable(i);
|
|
5457
5487
|
},
|
|
5458
5488
|
draggable(i) {
|
|
5459
5489
|
this.marker.setDraggable(i);
|
|
@@ -5465,7 +5495,7 @@ const gs = /* @__PURE__ */ K(us, [["render", ps]]), ms = w({
|
|
|
5465
5495
|
this.recreate();
|
|
5466
5496
|
},
|
|
5467
5497
|
zIndex(i) {
|
|
5468
|
-
this.marker instanceof
|
|
5498
|
+
this.marker instanceof Ee ? this.recreate() : this.marker.setZIndex(i);
|
|
5469
5499
|
},
|
|
5470
5500
|
visible(i) {
|
|
5471
5501
|
this.marker.setVisible(i);
|
|
@@ -5512,7 +5542,7 @@ function fs(i, t, e, r, s, n) {
|
|
|
5512
5542
|
}
|
|
5513
5543
|
const qe = /* @__PURE__ */ K(ms, [["render", fs]]), ys = w({
|
|
5514
5544
|
name: "tg-info-box",
|
|
5515
|
-
mixins: [
|
|
5545
|
+
mixins: [k],
|
|
5516
5546
|
inheritAttrs: !1,
|
|
5517
5547
|
props: {
|
|
5518
5548
|
show: D(Boolean),
|
|
@@ -5573,7 +5603,7 @@ const qe = /* @__PURE__ */ K(ms, [["render", fs]]), ys = w({
|
|
|
5573
5603
|
return this.$el;
|
|
5574
5604
|
},
|
|
5575
5605
|
$marker() {
|
|
5576
|
-
return
|
|
5606
|
+
return ct(qe, this.$parent, xe);
|
|
5577
5607
|
},
|
|
5578
5608
|
open(i) {
|
|
5579
5609
|
this.overlay.open(i);
|
|
@@ -5592,7 +5622,7 @@ function vs(i, t, e, r, s, n) {
|
|
|
5592
5622
|
}
|
|
5593
5623
|
const _s = /* @__PURE__ */ K(ys, [["render", vs]]), bs = w({
|
|
5594
5624
|
name: "tg-info-window",
|
|
5595
|
-
mixins: [
|
|
5625
|
+
mixins: [k],
|
|
5596
5626
|
inheritAttrs: !1,
|
|
5597
5627
|
props: {
|
|
5598
5628
|
show: D(Boolean),
|
|
@@ -5631,7 +5661,7 @@ const _s = /* @__PURE__ */ K(ys, [["render", vs]]), bs = w({
|
|
|
5631
5661
|
return this.$el;
|
|
5632
5662
|
},
|
|
5633
5663
|
$marker() {
|
|
5634
|
-
return
|
|
5664
|
+
return ct(qe, this.$parent, xe);
|
|
5635
5665
|
},
|
|
5636
5666
|
getOptions() {
|
|
5637
5667
|
return {
|
|
@@ -5665,13 +5695,13 @@ function Ts(i, t, e, r, s, n) {
|
|
|
5665
5695
|
}
|
|
5666
5696
|
const Ms = /* @__PURE__ */ K(bs, [["render", Ts]]), Os = w({
|
|
5667
5697
|
name: "tg-label",
|
|
5668
|
-
mixins: [
|
|
5698
|
+
mixins: [k],
|
|
5669
5699
|
inheritAttrs: !1,
|
|
5670
5700
|
props: {
|
|
5671
5701
|
position: m(y),
|
|
5672
5702
|
offset: m(Object),
|
|
5673
5703
|
zIndex: m(Number),
|
|
5674
|
-
mapPane: Z(
|
|
5704
|
+
mapPane: Z(Ce)
|
|
5675
5705
|
},
|
|
5676
5706
|
emits: void 0,
|
|
5677
5707
|
setup(i, { attrs: t }) {
|
|
@@ -5706,7 +5736,7 @@ const Ms = /* @__PURE__ */ K(bs, [["render", Ts]]), Os = w({
|
|
|
5706
5736
|
return (i = this.$marker()) == null ? void 0 : i.marker;
|
|
5707
5737
|
},
|
|
5708
5738
|
$marker() {
|
|
5709
|
-
return
|
|
5739
|
+
return ct(qe, this.$parent, xe);
|
|
5710
5740
|
},
|
|
5711
5741
|
getOptions() {
|
|
5712
5742
|
return {
|
|
@@ -5734,7 +5764,7 @@ function Cs(i, t, e, r, s, n) {
|
|
|
5734
5764
|
}
|
|
5735
5765
|
const ws = /* @__PURE__ */ K(Os, [["render", Cs]]), Es = w({
|
|
5736
5766
|
name: "tg-polygon",
|
|
5737
|
-
mixins: [
|
|
5767
|
+
mixins: [k],
|
|
5738
5768
|
inheritAttrs: !1,
|
|
5739
5769
|
props: {
|
|
5740
5770
|
paths: D(Array),
|
|
@@ -5803,7 +5833,7 @@ const ws = /* @__PURE__ */ K(Os, [["render", Cs]]), Es = w({
|
|
|
5803
5833
|
}
|
|
5804
5834
|
}), Ls = w({
|
|
5805
5835
|
name: "tg-polyline",
|
|
5806
|
-
mixins: [
|
|
5836
|
+
mixins: [k],
|
|
5807
5837
|
inheritAttrs: !1,
|
|
5808
5838
|
props: {
|
|
5809
5839
|
path: D(Array),
|
|
@@ -5864,7 +5894,7 @@ const ws = /* @__PURE__ */ K(Os, [["render", Cs]]), Es = w({
|
|
|
5864
5894
|
}
|
|
5865
5895
|
}), Ps = w({
|
|
5866
5896
|
name: "tg-rectangle",
|
|
5867
|
-
mixins: [
|
|
5897
|
+
mixins: [k],
|
|
5868
5898
|
inheritAttrs: !1,
|
|
5869
5899
|
props: {
|
|
5870
5900
|
bounds: D(Object),
|
|
@@ -5935,7 +5965,7 @@ const ws = /* @__PURE__ */ K(Os, [["render", Cs]]), Es = w({
|
|
|
5935
5965
|
beforeCreate() {
|
|
5936
5966
|
const r = Pr() ?? "", n = (t.nameRegex || /^[A-Z]/).test(r) ? (a) => {
|
|
5937
5967
|
t.hookNames ? t.hookNames.includes(a) && console.debug("[lifecycle]", r, a) : xs.includes(a) || console.debug("[lifecycle]", r, a);
|
|
5938
|
-
} :
|
|
5968
|
+
} : Te;
|
|
5939
5969
|
n("beforeCreate"), this.__life_impl = n;
|
|
5940
5970
|
},
|
|
5941
5971
|
created() {
|
|
@@ -5975,7 +6005,7 @@ const ws = /* @__PURE__ */ K(Os, [["render", Cs]]), Es = w({
|
|
|
5975
6005
|
}
|
|
5976
6006
|
}
|
|
5977
6007
|
}, ks = 6378137;
|
|
5978
|
-
function
|
|
6008
|
+
function _e(i) {
|
|
5979
6009
|
return i * Math.PI / 180;
|
|
5980
6010
|
}
|
|
5981
6011
|
function qt(i) {
|
|
@@ -5984,7 +6014,7 @@ function qt(i) {
|
|
|
5984
6014
|
function Bs(i, t) {
|
|
5985
6015
|
if (i.lat === t.lat && i.lng === t.lng)
|
|
5986
6016
|
return 0;
|
|
5987
|
-
const e =
|
|
6017
|
+
const e = _e((i.lat + t.lat) / 2), r = _e((i.lat - t.lat) / 2), s = _e((i.lng - t.lng) / 2);
|
|
5988
6018
|
let n = Math.sin(r), a = Math.sin(s), h = Math.sin(e);
|
|
5989
6019
|
const o = ks, l = 1 / 298.257;
|
|
5990
6020
|
n = n * n, a = a * a, h = h * h;
|
|
@@ -5992,17 +6022,17 @@ function Bs(i, t) {
|
|
|
5992
6022
|
return _ * (1 + l * (T * h * (1 - n) - g * (1 - h) * n));
|
|
5993
6023
|
}
|
|
5994
6024
|
function Is(i, t, e) {
|
|
5995
|
-
const s = 63567523142e-4, n = 1 / 298.257223563, a =
|
|
5996
|
-
let v = 0, O = 0,
|
|
6025
|
+
const s = 63567523142e-4, n = 1 / 298.257223563, a = _e(t), h = Math.sin(a), o = Math.cos(a), l = (1 - n) * Math.tan(_e(i.lat)), d = 1 / Math.sqrt(1 + l * l), u = l * d, p = Math.atan2(l, o), b = d * h, _ = 1 - b * b, T = _ * (6378137 * 6378137 - s * s) / (s * s), g = 1 + T / 16384 * (4096 + T * (-768 + T * (320 - 175 * T))), f = T / 1024 * (256 + T * (-128 + T * (74 - 47 * T)));
|
|
6026
|
+
let v = 0, O = 0, x = 0, E = e / (s * g), Q = 2 * Math.PI;
|
|
5997
6027
|
for (; Math.abs(E - Q) > 1e-12; ) {
|
|
5998
|
-
v = Math.cos(2 * p + E), O = Math.sin(E),
|
|
5999
|
-
const Ir = f * O * (v + f / 4 * (
|
|
6028
|
+
v = Math.cos(2 * p + E), O = Math.sin(E), x = Math.cos(E);
|
|
6029
|
+
const Ir = f * O * (v + f / 4 * (x * (-1 + 2 * v * v) - f / 6 * v * (-3 + 4 * O * O) * (-3 + 4 * v * v)));
|
|
6000
6030
|
Q = E, E = e / (s * g) + Ir;
|
|
6001
6031
|
}
|
|
6002
|
-
const ie = u * O - d *
|
|
6003
|
-
u *
|
|
6032
|
+
const ie = u * O - d * x * o, Ke = Math.atan2(
|
|
6033
|
+
u * x + d * O * o,
|
|
6004
6034
|
(1 - n) * Math.sqrt(b * b + ie * ie)
|
|
6005
|
-
), kr = Math.atan2(O * h, d *
|
|
6035
|
+
), kr = Math.atan2(O * h, d * x - u * O * o), Xe = n / 16 * _ * (4 + n * (4 - 3 * _)), Br = kr - (1 - Xe) * n * b * (E + Xe * O * (v + Xe * x * (-1 + 2 * v * v)));
|
|
6006
6036
|
return { lng: i.lng + qt(Br), lat: qt(Ke) };
|
|
6007
6037
|
}
|
|
6008
6038
|
const en = {
|
|
@@ -6011,90 +6041,90 @@ const en = {
|
|
|
6011
6041
|
}, tn = {
|
|
6012
6042
|
install(i, t) {
|
|
6013
6043
|
if (hi(t), {}.VITE_FALSE) {
|
|
6014
|
-
const r = /* @__PURE__ */ Object.assign({ "./TgMap.vue":
|
|
6044
|
+
const r = /* @__PURE__ */ Object.assign({ "./TgMap.vue": xe, "./TgMapWidget.vue": Qi, "./controls/TgCustomControl.vue": rs, "./controls/TgMapTypeControl.vue": is, "./controls/TgScaleControl.vue": ss, "./controls/TgZoomControl.vue": os, "./extra/TgMarkerClusterer.vue": xr, "./layers/TgTrafficLayer.vue": hs, "./overlays/TgCircle.vue": cs, "./overlays/TgElementOverlay.vue": gs, "./overlays/TgInfoBox.vue": _s, "./overlays/TgInfoWindow.vue": Ms, "./overlays/TgLabel.vue": ws, "./overlays/TgMarker.vue": qe, "./overlays/TgPolygon.vue": Es, "./overlays/TgPolyline.vue": Ls, "./overlays/TgRectangle.vue": Ps });
|
|
6015
6045
|
Object.keys(r).forEach((s) => {
|
|
6016
6046
|
const n = r[s];
|
|
6017
6047
|
i.component(n.name ?? C(`Tg开头的组件必须设置name: ${s}`), n);
|
|
6018
6048
|
});
|
|
6019
6049
|
}
|
|
6020
6050
|
const e = i.config.optionMergeStrategies;
|
|
6021
|
-
e[
|
|
6051
|
+
e[Le] = e[Pe] = (r, s) => r ? [...new Set([].concat(r, s))] : Array.isArray(s) ? s : [s];
|
|
6022
6052
|
}
|
|
6023
6053
|
};
|
|
6024
6054
|
export {
|
|
6025
6055
|
lr as AbstractControl,
|
|
6026
|
-
|
|
6056
|
+
bt as AbstractMap,
|
|
6027
6057
|
he as Arrays,
|
|
6028
6058
|
gr as Autocomplete,
|
|
6029
6059
|
_i as BaiduAutocomplete,
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6060
|
+
Mt as BaiduCircle,
|
|
6061
|
+
ut as BaiduControl,
|
|
6062
|
+
Lt as BaiduInfoBoxOverlay,
|
|
6063
|
+
wt as BaiduInfoWindow,
|
|
6064
|
+
gt as BaiduMapTypeControl,
|
|
6065
|
+
Ae as BaiduMapUrls,
|
|
6066
|
+
Ee as BaiduMarker,
|
|
6037
6067
|
Ci as BaiduMarkerClusterer,
|
|
6038
6068
|
Ue as BaiduOverlay,
|
|
6039
6069
|
Li as BaiduPlacesService,
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6070
|
+
It as BaiduPolyShape,
|
|
6071
|
+
Rt as BaiduPolygon,
|
|
6072
|
+
St as BaiduPolyline,
|
|
6073
|
+
zt as BaiduRectangle,
|
|
6074
|
+
mt as BaiduScaleControl,
|
|
6045
6075
|
xi as BaiduSearchBox,
|
|
6046
|
-
|
|
6076
|
+
yt as BaiduZoomControl,
|
|
6047
6077
|
A as BuildInMapType,
|
|
6048
6078
|
hr as BuildInMapTypeId,
|
|
6049
6079
|
ye as CachedValue,
|
|
6050
6080
|
S as ControlPosition,
|
|
6051
6081
|
z as ControlPositionConverter,
|
|
6052
|
-
|
|
6082
|
+
P as CoordType,
|
|
6053
6083
|
pi as CustomControl,
|
|
6054
6084
|
ui as FastFindValues,
|
|
6055
6085
|
vi as GoogleAutocomplete,
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6086
|
+
Ot as GoogleCircle,
|
|
6087
|
+
pt as GoogleControl,
|
|
6088
|
+
Pt as GoogleInfoBoxOverlay,
|
|
6089
|
+
Et as GoogleInfoWindow,
|
|
6090
|
+
Ie as GoogleMapTypeControl,
|
|
6091
|
+
Se as GoogleMapUrls,
|
|
6092
|
+
Bt as GoogleMarker,
|
|
6063
6093
|
wi as GoogleMarkerClusterer,
|
|
6064
|
-
|
|
6094
|
+
Tt as GoogleOverlay,
|
|
6065
6095
|
Ei as GooglePlacesService,
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6096
|
+
$t as GooglePolygon,
|
|
6097
|
+
At as GooglePolyline,
|
|
6098
|
+
Dt as GoogleRectangle,
|
|
6099
|
+
ft as GoogleScaleControl,
|
|
6070
6100
|
Pi as GoogleSearchBox,
|
|
6071
|
-
|
|
6072
|
-
|
|
6101
|
+
vt as GoogleZoomControl,
|
|
6102
|
+
Ne as Icon,
|
|
6073
6103
|
js as ImageMapType,
|
|
6074
|
-
|
|
6075
|
-
|
|
6104
|
+
Ct as InfoWindow,
|
|
6105
|
+
jt as KeyValue,
|
|
6076
6106
|
y as LatLng,
|
|
6077
6107
|
R as LatLngBounds,
|
|
6078
6108
|
Qs as LifecycleLogPlugin,
|
|
6079
6109
|
V as Location,
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6110
|
+
Le as MIXIN_HOOK_CREATE,
|
|
6111
|
+
Pe as MIXIN_HOOK_DESTROY,
|
|
6112
|
+
Nt as MIXIN_MAP_NAME,
|
|
6083
6113
|
ce as MVCArrays,
|
|
6084
|
-
|
|
6114
|
+
k as MapMixin,
|
|
6085
6115
|
$ as MapType,
|
|
6086
6116
|
cr as MapTypeControlType,
|
|
6087
6117
|
mr as MapUrls,
|
|
6088
6118
|
ki as MapZoom,
|
|
6089
6119
|
Tr as MarkerClusterer,
|
|
6090
|
-
|
|
6120
|
+
Oe as Objects,
|
|
6091
6121
|
wr as Overlay,
|
|
6092
6122
|
Mr as PlacesService,
|
|
6093
6123
|
X as Point,
|
|
6094
6124
|
Or as SearchBox,
|
|
6095
6125
|
en as SphericalUtils,
|
|
6096
6126
|
de as Strings,
|
|
6097
|
-
|
|
6127
|
+
Ge as SymbolIcon,
|
|
6098
6128
|
Us as SymbolPath,
|
|
6099
6129
|
cs as TgCircle,
|
|
6100
6130
|
rs as TgCustomControl,
|
|
@@ -6102,8 +6132,8 @@ export {
|
|
|
6102
6132
|
_s as TgInfoBox,
|
|
6103
6133
|
Ms as TgInfoWindow,
|
|
6104
6134
|
ws as TgLabel,
|
|
6105
|
-
|
|
6106
|
-
|
|
6135
|
+
xe as TgMap,
|
|
6136
|
+
lt as TgMapFactory,
|
|
6107
6137
|
G as TgMapType,
|
|
6108
6138
|
is as TgMapTypeControl,
|
|
6109
6139
|
Qi as TgMapWidget,
|
|
@@ -6116,10 +6146,10 @@ export {
|
|
|
6116
6146
|
hs as TgTrafficLayer,
|
|
6117
6147
|
os as TgZoomControl,
|
|
6118
6148
|
gi as TrafficLayer,
|
|
6119
|
-
|
|
6149
|
+
De as UnionIcon,
|
|
6120
6150
|
oe as assert,
|
|
6121
|
-
|
|
6122
|
-
|
|
6151
|
+
it as assertNever,
|
|
6152
|
+
Be as callHook,
|
|
6123
6153
|
Ys as computedSaveOnThis,
|
|
6124
6154
|
Lr as createEmptyVNode,
|
|
6125
6155
|
Fi as createPropertyObject,
|
|
@@ -6128,16 +6158,16 @@ export {
|
|
|
6128
6158
|
tn as default,
|
|
6129
6159
|
L as eventProp,
|
|
6130
6160
|
Xs as extractVNodeFromSlotsByComponent,
|
|
6131
|
-
|
|
6161
|
+
ct as findAncestorComponentByType,
|
|
6132
6162
|
Ks as findByComponentType,
|
|
6133
6163
|
Is as getDestination,
|
|
6134
6164
|
sr as getTgMapConfig,
|
|
6135
|
-
|
|
6165
|
+
nt as isComponentByType,
|
|
6136
6166
|
Ws as isDef,
|
|
6137
6167
|
Ur as isEntryValueDef,
|
|
6138
6168
|
zs as isInstanceOf,
|
|
6139
6169
|
$s as lateinit,
|
|
6140
|
-
|
|
6170
|
+
Te as noop,
|
|
6141
6171
|
m as optionalProp,
|
|
6142
6172
|
Ri as path,
|
|
6143
6173
|
D as requiredProp,
|
|
@@ -6148,9 +6178,9 @@ export {
|
|
|
6148
6178
|
Z as stringEnumProp,
|
|
6149
6179
|
Vi as stringUnionPropFromValues,
|
|
6150
6180
|
C as throwError,
|
|
6151
|
-
|
|
6181
|
+
dt as throwUnsupported,
|
|
6152
6182
|
Gs as todo,
|
|
6153
|
-
|
|
6183
|
+
st as typed,
|
|
6154
6184
|
Ns as unwrapStringEnumValue,
|
|
6155
6185
|
Js as useEventLogMethods,
|
|
6156
6186
|
q as useSplittedAttrs,
|