tg-map-vue3 3.6.3 → 3.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/src/components/overlays/TgInfoBox.vue.d.ts +5 -5
- package/dist/src/components/overlays/TgInfoWindow.vue.d.ts +5 -5
- package/dist/src/components/overlays/TgLabel.vue.d.ts +3 -3
- package/dist/src/utils/arrays.d.ts +0 -2
- package/dist/src/utils/mapped-types.d.ts +10 -0
- package/dist/tg-map.js +764 -754
- package/dist/tg-map.js.map +1 -1
- package/dist/tg-map.umd.cjs +6 -6
- package/dist/tg-map.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/tg-map.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
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)}.element-overlay{position:absolute}.tg-map{height:100%;position:relative}.tg-map__map{width:100%;height:100%}.tg-map__map--hide-logo-google .gm-style a[target=_blank]:has(> div > img){display:none!important}.tg-map__map--hide-logo-google .gm-style>div:last-child>div:last-child>div{display:none}.tg-map__map--hide-logo-baidu div.anchorBL>a[target=_blank]>img{display:none}.tg-map__map--hide-logo-baidu div.BMap_cpyCtrl{display:none}.tg-map-widget{position:absolute}.tg-map>.tg-custom-control{display:none}.tg-map .tg-element-overlay{display:none}.tg-map__map .tg-element-overlay{display:block}.tg-map .tg-info-box{display:none}.tg-map__map .tg-info-box{display:block}.tg-map .tg-label{display:none}.tg-map__map .tg-label{display:block}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
import { createCommentVNode as Je, computed as
|
|
2
|
+
var Ir = Object.defineProperty;
|
|
3
|
+
var Sr = (i, t, e) => t in i ? Ir(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
4
|
+
var c = (i, t, e) => (Sr(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
5
|
+
import { createCommentVNode as Je, computed as Yt, defineComponent as w, markRaw as Ar, watch as qt, openBlock as V, createElementBlock as F, mergeProps as ue, createElementVNode as Rr, normalizeClass as Ze, renderSlot as W, normalizeStyle as $r, getCurrentInstance as Dr, inject as zr, onMounted as Nr, onBeforeUnmount as Gr, toRaw as We, withDirectives as Zr, vShow as Wr } from "vue";
|
|
6
6
|
function U(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]);
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
-
let
|
|
12
|
-
function
|
|
13
|
-
return
|
|
11
|
+
let Hr = 1;
|
|
12
|
+
function jr() {
|
|
13
|
+
return Hr++;
|
|
14
14
|
}
|
|
15
15
|
function Se(i, t) {
|
|
16
|
-
return t.__id__ || (t.__id__ =
|
|
16
|
+
return t.__id__ || (t.__id__ = jr()), `${i}::${t.__id__}`;
|
|
17
17
|
}
|
|
18
|
-
var
|
|
19
|
-
function
|
|
18
|
+
var Kt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
19
|
+
function nt(i) {
|
|
20
20
|
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
|
|
21
21
|
}
|
|
22
|
-
var
|
|
22
|
+
var Xt = { exports: {} };
|
|
23
23
|
(function(i) {
|
|
24
24
|
(function(t, e) {
|
|
25
25
|
i.exports ? i.exports = e() : t.coordtransform = e();
|
|
26
|
-
})(
|
|
26
|
+
})(Kt, function() {
|
|
27
27
|
var t = 52.35987755982988, e = 3.141592653589793, r = 6378245, s = 0.006693421622965943;
|
|
28
28
|
function n(g, f, v, O) {
|
|
29
29
|
this.west = Math.min(g, v), this.north = Math.max(f, O), this.east = Math.max(g, v), this.south = Math.min(f, O);
|
|
@@ -38,7 +38,7 @@ var qt = { exports: {} };
|
|
|
38
38
|
new n(82.9684, 29.5297, 97.0352, 26.7186),
|
|
39
39
|
new n(97.0253, 29.5297, 124.367395, 20.414096),
|
|
40
40
|
new n(107.975793, 20.414096, 111.744104, 17.871542)
|
|
41
|
-
],
|
|
41
|
+
], h = [
|
|
42
42
|
new n(119.921265, 25.398623, 122.497559, 21.785006),
|
|
43
43
|
new n(101.8652, 22.284, 106.665, 20.0988),
|
|
44
44
|
new n(106.4525, 21.5422, 108.051, 20.4878),
|
|
@@ -50,8 +50,8 @@ var qt = { exports: {} };
|
|
|
50
50
|
function o(g, f) {
|
|
51
51
|
for (var v = 0; v < a.length; v++)
|
|
52
52
|
if (a[v].contain(g, f)) {
|
|
53
|
-
for (var O = 0; O <
|
|
54
|
-
if (
|
|
53
|
+
for (var O = 0; O < h.length; O++)
|
|
54
|
+
if (h[O].contain(g, f))
|
|
55
55
|
return !1;
|
|
56
56
|
return !0;
|
|
57
57
|
}
|
|
@@ -61,7 +61,7 @@ var qt = { exports: {} };
|
|
|
61
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
|
-
function
|
|
64
|
+
function d(g, f) {
|
|
65
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
66
|
return [x, E];
|
|
67
67
|
}
|
|
@@ -93,12 +93,12 @@ var qt = { exports: {} };
|
|
|
93
93
|
return {
|
|
94
94
|
// 向前兼容
|
|
95
95
|
bd09togcj02: l,
|
|
96
|
-
gcj02tobd09:
|
|
96
|
+
gcj02tobd09: d,
|
|
97
97
|
wgs84togcj02: u,
|
|
98
98
|
gcj02towgs84: p,
|
|
99
99
|
// 小驼峰命名风格
|
|
100
100
|
bd09ToGcj02: l,
|
|
101
|
-
gcj02ToBd09:
|
|
101
|
+
gcj02ToBd09: d,
|
|
102
102
|
wgs84ToGcj02: u,
|
|
103
103
|
gcj02ToWgs84: p,
|
|
104
104
|
bd09ToWgs84: function(g, f) {
|
|
@@ -111,13 +111,13 @@ var qt = { exports: {} };
|
|
|
111
111
|
if (!o(g, f))
|
|
112
112
|
return [g, f];
|
|
113
113
|
var v = u(g, f);
|
|
114
|
-
return
|
|
114
|
+
return d(v[0], v[1]);
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
117
|
});
|
|
118
|
-
})(
|
|
119
|
-
var
|
|
120
|
-
const se = /* @__PURE__ */
|
|
118
|
+
})(Xt);
|
|
119
|
+
var Vr = Xt.exports;
|
|
120
|
+
const se = /* @__PURE__ */ nt(Vr);
|
|
121
121
|
function oe(i, t) {
|
|
122
122
|
if (!i)
|
|
123
123
|
throw new Error(`AssertionError: ${t}`);
|
|
@@ -125,46 +125,58 @@ function oe(i, t) {
|
|
|
125
125
|
function Qe(i) {
|
|
126
126
|
throw new Error(`Unexpected object: ${i}`);
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function As() {
|
|
129
129
|
}
|
|
130
130
|
function et(i) {
|
|
131
131
|
return i;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Rs(i, t) {
|
|
134
134
|
return i instanceof t;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function $s(i, t) {
|
|
137
137
|
if (i instanceof t)
|
|
138
138
|
return i;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
function tt(i, t) {
|
|
141
|
+
return (i == null ? void 0 : i.$options.name) === t.name;
|
|
142
|
+
}
|
|
143
|
+
function Jt(i, t) {
|
|
144
|
+
return tt(i, t) ? i : void 0;
|
|
145
|
+
}
|
|
146
|
+
function ot(i, t, e) {
|
|
147
|
+
let r = t;
|
|
148
|
+
for (; r; ) {
|
|
149
|
+
if (tt(r, i))
|
|
150
|
+
return r;
|
|
151
|
+
if (e && tt(r, e))
|
|
152
|
+
return;
|
|
153
|
+
r = r.$parent;
|
|
154
|
+
}
|
|
143
155
|
}
|
|
144
|
-
function
|
|
156
|
+
function Ds(i) {
|
|
145
157
|
return i;
|
|
146
158
|
}
|
|
147
159
|
function C(i) {
|
|
148
160
|
throw new Error(i);
|
|
149
161
|
}
|
|
150
|
-
function
|
|
162
|
+
function at(i) {
|
|
151
163
|
throw new Error(`Unsupported: ${i}`);
|
|
152
164
|
}
|
|
153
|
-
function
|
|
165
|
+
function zs(i) {
|
|
154
166
|
throw new Error(`todo: ${i}`);
|
|
155
167
|
}
|
|
156
|
-
function
|
|
168
|
+
function Ns(i) {
|
|
157
169
|
return i;
|
|
158
170
|
}
|
|
159
171
|
function ve(...i) {
|
|
160
172
|
}
|
|
161
|
-
function
|
|
173
|
+
function Gs(i) {
|
|
162
174
|
return i != null;
|
|
163
175
|
}
|
|
164
|
-
function
|
|
176
|
+
function Qt(i) {
|
|
165
177
|
return i[1] != null;
|
|
166
178
|
}
|
|
167
|
-
var
|
|
179
|
+
var I = /* @__PURE__ */ ((i) => (i.wgs84 = "wgs84", i.gcj02 = "gcj02", i.bd09 = "bd09", i))(I || {});
|
|
168
180
|
const qe = "wgs84", N = class {
|
|
169
181
|
constructor(t, e, r) {
|
|
170
182
|
this.lat = t, this.lng = e, this.coord = r;
|
|
@@ -237,7 +249,7 @@ const qe = "wgs84", N = class {
|
|
|
237
249
|
}
|
|
238
250
|
};
|
|
239
251
|
let y = N;
|
|
240
|
-
|
|
252
|
+
c(y, "ZERO", N.create(0, 0));
|
|
241
253
|
const te = class {
|
|
242
254
|
/**
|
|
243
255
|
* 不推荐直接创建LatLngBounds, sw和ne的大小关系可能没法保证, 推荐用LatLngBounds.Builder或者LatLngBounds.from等静态方法来创建
|
|
@@ -245,7 +257,7 @@ const te = class {
|
|
|
245
257
|
* @param ne 东北, lat/lng更大
|
|
246
258
|
*/
|
|
247
259
|
constructor(t, e) {
|
|
248
|
-
|
|
260
|
+
c(this, "coord");
|
|
249
261
|
this.sw = t, this.ne = e, oe(t.coord === e.coord, "sw和ne的coord应该相同"), oe(Number.isFinite(t.lat) && Number.isFinite(t.lng) && Number.isFinite(e.lat) && Number.isFinite(e.lng), `sw(${t})和ne(${e})不能包含NaN或Infinite`), oe(t.lat <= e.lat, `sw.lat(${t.lat})应该比ne.lat(${e.lat})小`), this.coord = t.coord;
|
|
250
262
|
}
|
|
251
263
|
static isBetweenLng(t, e, r) {
|
|
@@ -320,15 +332,15 @@ const te = class {
|
|
|
320
332
|
}
|
|
321
333
|
};
|
|
322
334
|
let A = te;
|
|
323
|
-
|
|
335
|
+
c(A, "EMPTY", new te(y.ZERO, y.ZERO));
|
|
324
336
|
((i) => {
|
|
325
337
|
class t {
|
|
326
338
|
constructor(r) {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
339
|
+
c(this, "coord");
|
|
340
|
+
c(this, "minLat");
|
|
341
|
+
c(this, "minLng");
|
|
342
|
+
c(this, "maxLat");
|
|
343
|
+
c(this, "maxLng");
|
|
332
344
|
this.coord = r.coord, this.minLat = this.maxLat = r.lat, this.minLng = this.maxLng = r.lng;
|
|
333
345
|
}
|
|
334
346
|
build() {
|
|
@@ -365,67 +377,67 @@ var K;
|
|
|
365
377
|
}
|
|
366
378
|
i.getCoordType = e;
|
|
367
379
|
})(K || (K = {}));
|
|
368
|
-
var
|
|
369
|
-
return
|
|
380
|
+
var Fr = function(t) {
|
|
381
|
+
return Ur(t) && !Yr(t);
|
|
370
382
|
};
|
|
371
|
-
function
|
|
383
|
+
function Ur(i) {
|
|
372
384
|
return !!i && typeof i == "object";
|
|
373
385
|
}
|
|
374
|
-
function
|
|
386
|
+
function Yr(i) {
|
|
375
387
|
var t = Object.prototype.toString.call(i);
|
|
376
|
-
return t === "[object RegExp]" || t === "[object Date]" ||
|
|
388
|
+
return t === "[object RegExp]" || t === "[object Date]" || Xr(i);
|
|
377
389
|
}
|
|
378
|
-
var
|
|
379
|
-
function
|
|
380
|
-
return i.$$typeof ===
|
|
390
|
+
var qr = typeof Symbol == "function" && Symbol.for, Kr = qr ? Symbol.for("react.element") : 60103;
|
|
391
|
+
function Xr(i) {
|
|
392
|
+
return i.$$typeof === Kr;
|
|
381
393
|
}
|
|
382
|
-
function
|
|
394
|
+
function Jr(i) {
|
|
383
395
|
return Array.isArray(i) ? [] : {};
|
|
384
396
|
}
|
|
385
397
|
function _e(i, t) {
|
|
386
|
-
return t.clone !== !1 && t.isMergeableObject(i) ? le(
|
|
398
|
+
return t.clone !== !1 && t.isMergeableObject(i) ? le(Jr(i), i, t) : i;
|
|
387
399
|
}
|
|
388
|
-
function
|
|
400
|
+
function Qr(i, t, e) {
|
|
389
401
|
return i.concat(t).map(function(r) {
|
|
390
402
|
return _e(r, e);
|
|
391
403
|
});
|
|
392
404
|
}
|
|
393
|
-
function
|
|
405
|
+
function ei(i, t) {
|
|
394
406
|
if (!t.customMerge)
|
|
395
407
|
return le;
|
|
396
408
|
var e = t.customMerge(i);
|
|
397
409
|
return typeof e == "function" ? e : le;
|
|
398
410
|
}
|
|
399
|
-
function
|
|
411
|
+
function ti(i) {
|
|
400
412
|
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(i).filter(function(t) {
|
|
401
413
|
return Object.propertyIsEnumerable.call(i, t);
|
|
402
414
|
}) : [];
|
|
403
415
|
}
|
|
404
|
-
function
|
|
405
|
-
return Object.keys(i).concat(
|
|
416
|
+
function Nt(i) {
|
|
417
|
+
return Object.keys(i).concat(ti(i));
|
|
406
418
|
}
|
|
407
|
-
function
|
|
419
|
+
function er(i, t) {
|
|
408
420
|
try {
|
|
409
421
|
return t in i;
|
|
410
422
|
} catch {
|
|
411
423
|
return !1;
|
|
412
424
|
}
|
|
413
425
|
}
|
|
414
|
-
function
|
|
415
|
-
return
|
|
426
|
+
function ri(i, t) {
|
|
427
|
+
return er(i, t) && !(Object.hasOwnProperty.call(i, t) && Object.propertyIsEnumerable.call(i, t));
|
|
416
428
|
}
|
|
417
|
-
function
|
|
429
|
+
function ii(i, t, e) {
|
|
418
430
|
var r = {};
|
|
419
|
-
return e.isMergeableObject(i) &&
|
|
431
|
+
return e.isMergeableObject(i) && Nt(i).forEach(function(s) {
|
|
420
432
|
r[s] = _e(i[s], e);
|
|
421
|
-
}),
|
|
422
|
-
|
|
433
|
+
}), Nt(t).forEach(function(s) {
|
|
434
|
+
ri(i, s) || (er(i, s) && e.isMergeableObject(t[s]) ? r[s] = ei(s, e)(i[s], t[s], e) : r[s] = _e(t[s], e));
|
|
423
435
|
}), r;
|
|
424
436
|
}
|
|
425
437
|
function le(i, t, e) {
|
|
426
|
-
e = e || {}, e.arrayMerge = e.arrayMerge ||
|
|
438
|
+
e = e || {}, e.arrayMerge = e.arrayMerge || Qr, e.isMergeableObject = e.isMergeableObject || Fr, e.cloneUnlessOtherwiseSpecified = _e;
|
|
427
439
|
var r = Array.isArray(t), s = Array.isArray(i), n = r === s;
|
|
428
|
-
return n ? r ? e.arrayMerge(i, t, e) :
|
|
440
|
+
return n ? r ? e.arrayMerge(i, t, e) : ii(i, t, e) : _e(t, e);
|
|
429
441
|
}
|
|
430
442
|
le.all = function(t, e) {
|
|
431
443
|
if (!Array.isArray(t))
|
|
@@ -434,8 +446,8 @@ le.all = function(t, e) {
|
|
|
434
446
|
return le(r, s, e);
|
|
435
447
|
}, {});
|
|
436
448
|
};
|
|
437
|
-
var
|
|
438
|
-
const
|
|
449
|
+
var si = le, ni = si;
|
|
450
|
+
const tr = /* @__PURE__ */ nt(ni), Ae = ["3.0"], oi = {
|
|
439
451
|
baidu: {
|
|
440
452
|
version: "3.0",
|
|
441
453
|
// 在build时会被静态替换, 导致使用者不能无法设置它
|
|
@@ -454,65 +466,61 @@ const Jt = /* @__PURE__ */ st(ii), Ae = ["3.0"], si = {
|
|
|
454
466
|
key: ""
|
|
455
467
|
}
|
|
456
468
|
};
|
|
457
|
-
let
|
|
458
|
-
function
|
|
459
|
-
return
|
|
469
|
+
let rr;
|
|
470
|
+
function ir() {
|
|
471
|
+
return rr || C("请先安装: Vue<PartialTgMapConfig>.use(TgMap, {})");
|
|
460
472
|
}
|
|
461
|
-
function
|
|
462
|
-
i != null && (
|
|
473
|
+
function ai(i) {
|
|
474
|
+
i != null && (rr = tr(oi, i));
|
|
463
475
|
}
|
|
464
|
-
var
|
|
476
|
+
var rt;
|
|
465
477
|
((i) => {
|
|
466
478
|
function t(e) {
|
|
467
479
|
return e.scrollWidth > e.clientWidth || e.scrollHeight > e.clientHeight;
|
|
468
480
|
}
|
|
469
481
|
i.isScrollable = t;
|
|
470
|
-
})(
|
|
482
|
+
})(rt || (rt = {}));
|
|
471
483
|
var he;
|
|
472
484
|
((i) => {
|
|
473
|
-
function t(
|
|
474
|
-
return
|
|
485
|
+
function t(h, o) {
|
|
486
|
+
return h.length === o.length && h.every((l, d) => l === o[d]);
|
|
475
487
|
}
|
|
476
488
|
i.equals = t;
|
|
477
|
-
function e(
|
|
478
|
-
const
|
|
479
|
-
if (
|
|
480
|
-
return
|
|
489
|
+
function e(h, o) {
|
|
490
|
+
const l = h.indexOf(o);
|
|
491
|
+
if (l !== -1)
|
|
492
|
+
return h.splice(l, 1)[0];
|
|
481
493
|
}
|
|
482
494
|
i.remove = e;
|
|
483
|
-
function r(
|
|
484
|
-
for (const
|
|
485
|
-
if (
|
|
486
|
-
return
|
|
495
|
+
function r(h, o) {
|
|
496
|
+
for (const l of h)
|
|
497
|
+
if (l instanceof o)
|
|
498
|
+
return l;
|
|
487
499
|
}
|
|
488
500
|
i.findByType = r;
|
|
489
|
-
function s(
|
|
490
|
-
return
|
|
501
|
+
function s(h, o) {
|
|
502
|
+
return h.includes(o);
|
|
491
503
|
}
|
|
492
504
|
i.includesTyped = s;
|
|
493
|
-
function n(o, l
|
|
494
|
-
const
|
|
495
|
-
if (
|
|
496
|
-
return
|
|
497
|
-
|
|
505
|
+
function n(h, o, l) {
|
|
506
|
+
const d = o >= 0 ? o : h.length + o;
|
|
507
|
+
if (l === void 0)
|
|
508
|
+
return h[d];
|
|
509
|
+
h[d] = l;
|
|
498
510
|
}
|
|
499
511
|
i.at = n;
|
|
500
|
-
function a(
|
|
501
|
-
return
|
|
512
|
+
function a(h) {
|
|
513
|
+
return h.length > 0;
|
|
502
514
|
}
|
|
503
515
|
i.isNotEmpty = a;
|
|
504
|
-
function d(o) {
|
|
505
|
-
return !(o != null && o.length);
|
|
506
|
-
}
|
|
507
|
-
i.isNullOrEmpty = d;
|
|
508
516
|
})(he || (he = {}));
|
|
509
517
|
var ce;
|
|
510
518
|
((i) => {
|
|
511
519
|
function t(s, n) {
|
|
512
520
|
const a = s.getLength();
|
|
513
|
-
for (let
|
|
514
|
-
if (s.getAt(
|
|
515
|
-
return
|
|
521
|
+
for (let h = 0; h < a; h++)
|
|
522
|
+
if (s.getAt(h) === n)
|
|
523
|
+
return h;
|
|
516
524
|
return -1;
|
|
517
525
|
}
|
|
518
526
|
i.indexOf = t;
|
|
@@ -531,22 +539,22 @@ var ce;
|
|
|
531
539
|
}
|
|
532
540
|
i.listenChanged = r;
|
|
533
541
|
})(ce || (ce = {}));
|
|
534
|
-
function
|
|
542
|
+
function sr(i, t, e) {
|
|
535
543
|
return i.addListener(t, e).remove;
|
|
536
544
|
}
|
|
537
|
-
function
|
|
545
|
+
function li(i, t, e) {
|
|
538
546
|
return i.addEventListener(t, e), () => i.removeEventListener(t, e);
|
|
539
547
|
}
|
|
540
|
-
function
|
|
548
|
+
function hi(i, t, e, r) {
|
|
541
549
|
return i.addEventListener(t, e, r), () => i.removeEventListener(t, e, r);
|
|
542
550
|
}
|
|
543
|
-
function
|
|
551
|
+
function Gt(i, t, e) {
|
|
544
552
|
return i.addEventListener(t, e), () => i.removeEventListener(t, e);
|
|
545
553
|
}
|
|
546
|
-
class
|
|
554
|
+
class nr {
|
|
547
555
|
constructor(t, e) {
|
|
548
|
-
|
|
549
|
-
|
|
556
|
+
c(this, "eventMap", /* @__PURE__ */ new Map());
|
|
557
|
+
c(this, "target", void 0);
|
|
550
558
|
this.inner = t, this.coordTypeSupplier = e, this.addEventListener = this.addEventListener.bind(this), this.removeEventListener = this.removeEventListener.bind(this);
|
|
551
559
|
}
|
|
552
560
|
setTarget(t) {
|
|
@@ -555,7 +563,7 @@ class rr {
|
|
|
555
563
|
}
|
|
556
564
|
class He {
|
|
557
565
|
constructor(t, e) {
|
|
558
|
-
|
|
566
|
+
c(this, "eventHub", new or());
|
|
559
567
|
this.delegate = t, this.options = e;
|
|
560
568
|
}
|
|
561
569
|
notify(t) {
|
|
@@ -582,14 +590,14 @@ class He {
|
|
|
582
590
|
this.delegate.removeEventListener(t, e);
|
|
583
591
|
}
|
|
584
592
|
}
|
|
585
|
-
const
|
|
593
|
+
const $t = class extends nr {
|
|
586
594
|
addEventListener(t, e) {
|
|
587
595
|
const r = Se(t, e);
|
|
588
596
|
if (this.eventMap.get(r)) {
|
|
589
597
|
console.warn("listener已经添加过了", r, e);
|
|
590
598
|
return;
|
|
591
599
|
}
|
|
592
|
-
const s = this.inner.addListener(
|
|
600
|
+
const s = this.inner.addListener($t.EVENT_TYPE_MAP[t] || t, (n) => {
|
|
593
601
|
const a = {
|
|
594
602
|
type: t,
|
|
595
603
|
target: this.target,
|
|
@@ -604,9 +612,9 @@ const At = class extends rr {
|
|
|
604
612
|
s ? (s.remove(), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, e);
|
|
605
613
|
}
|
|
606
614
|
};
|
|
607
|
-
let re =
|
|
615
|
+
let re = $t;
|
|
608
616
|
// 事件类型映射: tg => google
|
|
609
|
-
|
|
617
|
+
c(re, "EVENT_TYPE_MAP", {
|
|
610
618
|
"center-changed": "center_changed",
|
|
611
619
|
"zoom-changed": "zoom_changed",
|
|
612
620
|
"radius-changed": "radius_changed",
|
|
@@ -622,7 +630,7 @@ h(re, "EVENT_TYPE_MAP", {
|
|
|
622
630
|
"map-mouseup": "mouseup",
|
|
623
631
|
"map-dblclick": "dblclick"
|
|
624
632
|
});
|
|
625
|
-
const Ne = class extends
|
|
633
|
+
const Ne = class extends nr {
|
|
626
634
|
addEventListener(t, e) {
|
|
627
635
|
const r = Se(t, e);
|
|
628
636
|
if (this.eventMap.get(r)) {
|
|
@@ -647,7 +655,7 @@ const Ne = class extends rr {
|
|
|
647
655
|
let ae = Ne;
|
|
648
656
|
// cSpell:words clickclose
|
|
649
657
|
// 事件类型映射, tg => baidu
|
|
650
|
-
|
|
658
|
+
c(ae, "EVENT_TYPE_MAP", {
|
|
651
659
|
drag: "dragging",
|
|
652
660
|
closeclick: "clickclose",
|
|
653
661
|
// baidu不支持contextmenu事件, 将其映射为rightclick
|
|
@@ -655,9 +663,9 @@ h(ae, "EVENT_TYPE_MAP", {
|
|
|
655
663
|
"zoom-changed": "zoomend",
|
|
656
664
|
"map-type-changed": "maptypechange"
|
|
657
665
|
});
|
|
658
|
-
class
|
|
666
|
+
class or {
|
|
659
667
|
constructor() {
|
|
660
|
-
|
|
668
|
+
c(this, "typeMap", /* @__PURE__ */ new Map());
|
|
661
669
|
}
|
|
662
670
|
addEventListener(t, e) {
|
|
663
671
|
let r = this.typeMap.get(t);
|
|
@@ -676,13 +684,13 @@ class ir {
|
|
|
676
684
|
e && e.forEach((r) => r.call(t.target, t));
|
|
677
685
|
}
|
|
678
686
|
}
|
|
679
|
-
class
|
|
687
|
+
class Zt {
|
|
680
688
|
/**
|
|
681
689
|
* `keys`和`values`数组中可以有相同的值, 若存在相同值, 则index越小的优先级越高
|
|
682
690
|
*/
|
|
683
691
|
constructor(t, e) {
|
|
684
|
-
|
|
685
|
-
|
|
692
|
+
c(this, "keyToValue", /* @__PURE__ */ new Map());
|
|
693
|
+
c(this, "valueToKey", /* @__PURE__ */ new Map());
|
|
686
694
|
oe(t.length === e.length);
|
|
687
695
|
for (let r = t.length - 1; r >= 0; r--)
|
|
688
696
|
this.keyToValue.set(t[r], e[r]), this.valueToKey.set(e[r], t[r]);
|
|
@@ -694,9 +702,9 @@ class Nt {
|
|
|
694
702
|
return this.keyToValue.get(t) ?? C();
|
|
695
703
|
}
|
|
696
704
|
}
|
|
697
|
-
class
|
|
705
|
+
class ci {
|
|
698
706
|
constructor(t, e = 10) {
|
|
699
|
-
|
|
707
|
+
c(this, "map", /* @__PURE__ */ new Map());
|
|
700
708
|
this.values = t, this.maxSize4Debug = e;
|
|
701
709
|
}
|
|
702
710
|
/** 获取保存key-value映射的Map */
|
|
@@ -725,14 +733,14 @@ class li {
|
|
|
725
733
|
}
|
|
726
734
|
class fe {
|
|
727
735
|
constructor(t) {
|
|
728
|
-
|
|
736
|
+
c(this, "value");
|
|
729
737
|
this.creator = t;
|
|
730
738
|
}
|
|
731
739
|
get() {
|
|
732
740
|
return this.value === void 0 && (this.value = this.creator()), this.value;
|
|
733
741
|
}
|
|
734
742
|
}
|
|
735
|
-
var
|
|
743
|
+
var B = /* @__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))(B || {}), $;
|
|
736
744
|
((i) => {
|
|
737
745
|
let t, e;
|
|
738
746
|
const r = [
|
|
@@ -751,7 +759,7 @@ var I = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
751
759
|
/* RIGHT_BOTTOM */
|
|
752
760
|
];
|
|
753
761
|
function s() {
|
|
754
|
-
return t || (t = new
|
|
762
|
+
return t || (t = new Zt(r, [
|
|
755
763
|
/* | @tg/map |名字相同| baidu | */
|
|
756
764
|
/* TOP_LEFT = */
|
|
757
765
|
BMAP_ANCHOR_TOP_LEFT,
|
|
@@ -781,7 +789,7 @@ var I = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
781
789
|
}
|
|
782
790
|
i.getBaidu = s;
|
|
783
791
|
function n() {
|
|
784
|
-
return e || (e = new
|
|
792
|
+
return e || (e = new Zt(r, [
|
|
785
793
|
google.maps.ControlPosition.TOP_LEFT,
|
|
786
794
|
google.maps.ControlPosition.TOP_CENTER,
|
|
787
795
|
google.maps.ControlPosition.TOP_RIGHT,
|
|
@@ -798,16 +806,16 @@ var I = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
798
806
|
}
|
|
799
807
|
i.getGoogle = n;
|
|
800
808
|
})($ || ($ = {}));
|
|
801
|
-
class
|
|
809
|
+
class di {
|
|
802
810
|
constructor(t) {
|
|
803
811
|
/** 实际添加到地图中的control对象 */
|
|
804
|
-
|
|
812
|
+
c(this, "inner");
|
|
805
813
|
this.position = t;
|
|
806
814
|
}
|
|
807
815
|
}
|
|
808
|
-
class
|
|
816
|
+
class ar {
|
|
809
817
|
}
|
|
810
|
-
class
|
|
818
|
+
class lt extends ar {
|
|
811
819
|
constructor(t, e) {
|
|
812
820
|
super(), this.inner = t, this.position = e;
|
|
813
821
|
}
|
|
@@ -830,11 +838,11 @@ class ot extends sr {
|
|
|
830
838
|
t.innerMap.removeControl(this.inner);
|
|
831
839
|
}
|
|
832
840
|
}
|
|
833
|
-
class
|
|
841
|
+
class ht extends ar {
|
|
834
842
|
constructor(e, r) {
|
|
835
843
|
super();
|
|
836
|
-
|
|
837
|
-
|
|
844
|
+
c(this, "visible", !1);
|
|
845
|
+
c(this, "map");
|
|
838
846
|
this._type = e, this.position = r;
|
|
839
847
|
}
|
|
840
848
|
isVisible() {
|
|
@@ -867,7 +875,7 @@ class at extends sr {
|
|
|
867
875
|
});
|
|
868
876
|
}
|
|
869
877
|
}
|
|
870
|
-
var
|
|
878
|
+
var lr = /* @__PURE__ */ ((i) => (i.normal = "normal", i.satellite = "satellite", i.hybrid = "hybrid", i))(lr || {});
|
|
871
879
|
class S {
|
|
872
880
|
constructor(t, e, r, s) {
|
|
873
881
|
this.id = t, this.baidu = e, this.google = r, this.googleCoordType = s;
|
|
@@ -876,7 +884,7 @@ class S {
|
|
|
876
884
|
return this.id;
|
|
877
885
|
}
|
|
878
886
|
getBaiduCoordType() {
|
|
879
|
-
return
|
|
887
|
+
return I.bd09;
|
|
880
888
|
}
|
|
881
889
|
asBaiduMapType() {
|
|
882
890
|
return this.baidu();
|
|
@@ -889,19 +897,19 @@ class S {
|
|
|
889
897
|
return this.google();
|
|
890
898
|
}
|
|
891
899
|
asGoogleMapType() {
|
|
892
|
-
|
|
900
|
+
at("google的内置地图没有对应的实例");
|
|
893
901
|
}
|
|
894
902
|
}
|
|
895
|
-
class
|
|
903
|
+
class Zs {
|
|
896
904
|
constructor(t, e) {
|
|
897
|
-
|
|
905
|
+
c(this, "baiduLayerCached", new fe(() => {
|
|
898
906
|
const t = new BMap.TileLayer({});
|
|
899
907
|
return t.getTilesUrl = (e, r) => {
|
|
900
908
|
const s = Math.pow(2, r - 1), n = e.x + s, a = s - 1 - e.y;
|
|
901
909
|
return this.options.getTileUrl({ x: n, y: a }, r);
|
|
902
910
|
}, t;
|
|
903
911
|
}));
|
|
904
|
-
|
|
912
|
+
c(this, "baiduMapTypeCached", new fe(() => {
|
|
905
913
|
const t = new BMap.MapType(this.options.name, this.baiduLayerCached.get(), {
|
|
906
914
|
maxZoom: this.options.maxZoom,
|
|
907
915
|
minZoom: this.options.minZoom,
|
|
@@ -909,7 +917,7 @@ class Ns {
|
|
|
909
917
|
});
|
|
910
918
|
return t.__baidu_map_type__ = this, t;
|
|
911
919
|
}));
|
|
912
|
-
|
|
920
|
+
c(this, "googleCached", new fe(() => {
|
|
913
921
|
const t = new google.maps.ImageMapType({
|
|
914
922
|
getTileUrl: (e, r) => this.options.getTileUrl(e, r),
|
|
915
923
|
tileSize: new google.maps.Size(256, 256),
|
|
@@ -941,13 +949,13 @@ class Ns {
|
|
|
941
949
|
return this.googleCached.get();
|
|
942
950
|
}
|
|
943
951
|
asGoogleLayer() {
|
|
944
|
-
|
|
952
|
+
at("这个方法不会被调用");
|
|
945
953
|
}
|
|
946
954
|
}
|
|
947
|
-
class
|
|
955
|
+
class ui {
|
|
948
956
|
constructor() {
|
|
949
|
-
|
|
950
|
-
|
|
957
|
+
c(this, "baiduCache", new fe(() => new BMap.TrafficLayer()));
|
|
958
|
+
c(this, "googleCache", new fe(() => new google.maps.TrafficLayer()));
|
|
951
959
|
}
|
|
952
960
|
asBaiduLayer() {
|
|
953
961
|
return this.baiduCache.get();
|
|
@@ -958,19 +966,19 @@ class ci {
|
|
|
958
966
|
}
|
|
959
967
|
var R;
|
|
960
968
|
((i) => {
|
|
961
|
-
i.NORMAL = new S("normal", () => BMAP_NORMAL_MAP, () => google.maps.MapTypeId.ROADMAP,
|
|
969
|
+
i.NORMAL = new S("normal", () => BMAP_NORMAL_MAP, () => google.maps.MapTypeId.ROADMAP, I.gcj02), i.SATELLITE = new S("satellite", () => BMAP_SATELLITE_MAP, () => google.maps.MapTypeId.SATELLITE, I.wgs84), i.HYBRID = new S("hybrid", () => BMAP_HYBRID_MAP, () => google.maps.MapTypeId.HYBRID, I.gcj02), i.TERRAIN = new S("terrain", () => (
|
|
962
970
|
/* 三维 */
|
|
963
971
|
BMAP_PERSPECTIVE_MAP
|
|
964
972
|
), () => (
|
|
965
973
|
/* 地形 */
|
|
966
974
|
google.maps.MapTypeId.TERRAIN
|
|
967
|
-
),
|
|
975
|
+
), I.wgs84), i.BUILD_IN_MAP_TYPES = new ci([i.NORMAL, i.SATELLITE, i.HYBRID, i.TERRAIN]);
|
|
968
976
|
})(R || (R = {}));
|
|
969
|
-
var
|
|
970
|
-
const
|
|
971
|
-
class
|
|
977
|
+
var hr = /* @__PURE__ */ ((i) => (i.DEFAULT = "default", i.HORIZONTAL = "horizontal", i.DROPDOWN = "dropdown", i))(hr || {});
|
|
978
|
+
const cr = [R.NORMAL, R.SATELLITE, R.HYBRID];
|
|
979
|
+
class ct extends lt {
|
|
972
980
|
static create(t) {
|
|
973
|
-
const e = t.mapTypes ??
|
|
981
|
+
const e = t.mapTypes ?? cr, r = {
|
|
974
982
|
default: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
975
983
|
horizontal: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
976
984
|
dropdown: BMAP_MAPTYPE_CONTROL_DROPDOWN
|
|
@@ -978,11 +986,11 @@ class lt extends ot {
|
|
|
978
986
|
type: t.type && r[t.type],
|
|
979
987
|
mapTypes: e.map((n) => n.asBaiduMapType())
|
|
980
988
|
});
|
|
981
|
-
return t.position && s.setAnchor($.getBaidu().toValue(t.position)), new
|
|
989
|
+
return t.position && s.setAnchor($.getBaidu().toValue(t.position)), new ct(s, t.position);
|
|
982
990
|
}
|
|
983
991
|
}
|
|
984
|
-
const ne = class extends
|
|
985
|
-
constructor(t = "default", e =
|
|
992
|
+
const ne = class extends ht {
|
|
993
|
+
constructor(t = "default", e = B.TOP_LEFT, r = cr) {
|
|
986
994
|
super("mapType", e), this.type = t, this.mapTypes = r, ne.type2google || (ne.type2google = {
|
|
987
995
|
default: google.maps.MapTypeControlStyle.DEFAULT,
|
|
988
996
|
horizontal: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
|
|
@@ -1003,63 +1011,63 @@ const ne = class extends at {
|
|
|
1003
1011
|
}
|
|
1004
1012
|
};
|
|
1005
1013
|
let ke = ne;
|
|
1006
|
-
|
|
1007
|
-
class
|
|
1014
|
+
c(ke, "type2google");
|
|
1015
|
+
class dt extends lt {
|
|
1008
1016
|
static create(t) {
|
|
1009
1017
|
const e = new BMap.ScaleControl({
|
|
1010
1018
|
anchor: t.position && $.getBaidu().toValue(t.position)
|
|
1011
1019
|
});
|
|
1012
|
-
return new
|
|
1020
|
+
return new dt(e, t.position);
|
|
1013
1021
|
}
|
|
1014
1022
|
}
|
|
1015
|
-
class
|
|
1023
|
+
class ut extends ht {
|
|
1016
1024
|
static create(t) {
|
|
1017
|
-
return new
|
|
1025
|
+
return new ut(t.position);
|
|
1018
1026
|
}
|
|
1019
|
-
constructor(t =
|
|
1027
|
+
constructor(t = B.BOTTOM_RIGHT) {
|
|
1020
1028
|
super("scale", t);
|
|
1021
1029
|
}
|
|
1022
1030
|
}
|
|
1023
|
-
class
|
|
1031
|
+
class pt extends lt {
|
|
1024
1032
|
static create(t) {
|
|
1025
1033
|
const e = new BMap.NavigationControl({
|
|
1026
1034
|
type: BMAP_NAVIGATION_CONTROL_ZOOM,
|
|
1027
1035
|
// enableGeolocation: true,
|
|
1028
1036
|
anchor: t.position && $.getBaidu().toValue(t.position)
|
|
1029
1037
|
});
|
|
1030
|
-
return new
|
|
1038
|
+
return new pt(e, t.position);
|
|
1031
1039
|
}
|
|
1032
1040
|
}
|
|
1033
|
-
class
|
|
1041
|
+
class gt extends ht {
|
|
1034
1042
|
static create(t) {
|
|
1035
|
-
return new
|
|
1043
|
+
return new gt(t.position);
|
|
1036
1044
|
}
|
|
1037
|
-
constructor(t =
|
|
1045
|
+
constructor(t = B.RIGHT_BOTTOM) {
|
|
1038
1046
|
super("zoom", t);
|
|
1039
1047
|
}
|
|
1040
1048
|
}
|
|
1041
|
-
function
|
|
1049
|
+
function pi(i) {
|
|
1042
1050
|
let t, e, r;
|
|
1043
|
-
const s = "The Google Maps JavaScript API", n = "google", a = "importLibrary",
|
|
1051
|
+
const s = "The Google Maps JavaScript API", n = "google", a = "importLibrary", h = "__ib__", o = document, l = window, d = l[n] || (l[n] = {}), u = d.maps || (d.maps = {}), p = /* @__PURE__ */ new Set(), b = new URLSearchParams(), _ = () => t || (t = new Promise(async (T, g) => {
|
|
1044
1052
|
var f;
|
|
1045
1053
|
await (e = o.createElement("script")), b.set("libraries", [...p] + "");
|
|
1046
1054
|
for (r in i)
|
|
1047
1055
|
b.set(r.replace(/[A-Z]/g, (v) => "_" + v[0].toLowerCase()), i[r]);
|
|
1048
|
-
b.set("callback", n + ".maps." +
|
|
1056
|
+
b.set("callback", n + ".maps." + h), e.src = `https://maps.${n}apis.com/maps/api/js?` + b, u[h] = T, e.onerror = () => t = g(Error(s + " could not load.")), e.nonce = ((f = o.querySelector("script[nonce]")) == null ? void 0 : f.nonce) || "", o.head.append(e);
|
|
1049
1057
|
}));
|
|
1050
1058
|
u[a] ? console.warn(s + " only loads once. Ignoring:", i) : u[a] = (T, ...g) => p.add(T) && _().then(() => u[a](T, ...g));
|
|
1051
1059
|
}
|
|
1052
|
-
let
|
|
1060
|
+
let gi, mi;
|
|
1053
1061
|
const J = {
|
|
1054
1062
|
/** Google的坐标0点 */
|
|
1055
1063
|
get LATLNG_ZERO() {
|
|
1056
|
-
return
|
|
1064
|
+
return gi ?? (gi = new google.maps.LatLng({ lat: 0, lng: 0 }));
|
|
1057
1065
|
},
|
|
1058
1066
|
get BOUNDS_ZERO() {
|
|
1059
|
-
return
|
|
1067
|
+
return mi ?? (mi = new google.maps.LatLngBounds(this.LATLNG_ZERO, this.LATLNG_ZERO));
|
|
1060
1068
|
}
|
|
1061
1069
|
};
|
|
1062
|
-
function
|
|
1070
|
+
function dr(i, t = { country: "", province: "", city: "", district: "", street: "", streetNumber: "" }) {
|
|
1063
1071
|
for (const e of i)
|
|
1064
1072
|
for (const r of e.types)
|
|
1065
1073
|
switch (r) {
|
|
@@ -1084,9 +1092,9 @@ function lr(i, t = { country: "", province: "", city: "", district: "", street:
|
|
|
1084
1092
|
}
|
|
1085
1093
|
return t;
|
|
1086
1094
|
}
|
|
1087
|
-
function
|
|
1095
|
+
function ur(i, t) {
|
|
1088
1096
|
var r;
|
|
1089
|
-
const e = i.address_components &&
|
|
1097
|
+
const e = i.address_components && dr(i.address_components);
|
|
1090
1098
|
return {
|
|
1091
1099
|
country: (e == null ? void 0 : e.country) ?? "",
|
|
1092
1100
|
province: (e == null ? void 0 : e.province) ?? "",
|
|
@@ -1097,12 +1105,12 @@ function hr(i, t) {
|
|
|
1097
1105
|
title: i.name ?? ""
|
|
1098
1106
|
};
|
|
1099
1107
|
}
|
|
1100
|
-
class
|
|
1108
|
+
class pr {
|
|
1101
1109
|
}
|
|
1102
|
-
class
|
|
1110
|
+
class fi extends pr {
|
|
1103
1111
|
constructor(e, r) {
|
|
1104
1112
|
super();
|
|
1105
|
-
|
|
1113
|
+
c(this, "inner");
|
|
1106
1114
|
this.map = e, this.inner = new google.maps.places.Autocomplete(r.input, {
|
|
1107
1115
|
fields: [
|
|
1108
1116
|
"address_components",
|
|
@@ -1115,7 +1123,7 @@ class gi extends cr {
|
|
|
1115
1123
|
this.inner.setBounds(e.toGoogle(this.map.coordType));
|
|
1116
1124
|
}
|
|
1117
1125
|
addResultListener(e) {
|
|
1118
|
-
return
|
|
1126
|
+
return sr(this.inner, "place_changed", () => {
|
|
1119
1127
|
const r = this.inner.getPlace(), s = {
|
|
1120
1128
|
title: r.name ?? "",
|
|
1121
1129
|
province: "",
|
|
@@ -1125,17 +1133,17 @@ class gi extends cr {
|
|
|
1125
1133
|
streetNumber: "",
|
|
1126
1134
|
country: ""
|
|
1127
1135
|
};
|
|
1128
|
-
r.address_components &&
|
|
1136
|
+
r.address_components && dr(r.address_components, s), e(s);
|
|
1129
1137
|
});
|
|
1130
1138
|
}
|
|
1131
1139
|
}
|
|
1132
|
-
class
|
|
1140
|
+
class yi extends pr {
|
|
1133
1141
|
constructor(e, r) {
|
|
1134
1142
|
super();
|
|
1135
|
-
|
|
1136
|
-
|
|
1143
|
+
c(this, "inner");
|
|
1144
|
+
c(this, "input");
|
|
1137
1145
|
// TODO: 要不要添加个移除监听的方法?
|
|
1138
|
-
|
|
1146
|
+
c(this, "removeableArray", []);
|
|
1139
1147
|
if (this.map = e, this.input = r.input, this.inner = new BMap.Autocomplete({
|
|
1140
1148
|
input: r.input,
|
|
1141
1149
|
location: r.bindToMap ? e.innerMap : void 0
|
|
@@ -1143,7 +1151,7 @@ class mi extends cr {
|
|
|
1143
1151
|
const s = () => {
|
|
1144
1152
|
this.inner.setLocation(this.map.innerMap);
|
|
1145
1153
|
};
|
|
1146
|
-
this.removeableArray.push(
|
|
1154
|
+
this.removeableArray.push(Gt(this.map, "center-changed", s)), this.removeableArray.push(Gt(this.map, "zoom-changed", s));
|
|
1147
1155
|
}
|
|
1148
1156
|
}
|
|
1149
1157
|
setBounds(e) {
|
|
@@ -1151,14 +1159,14 @@ class mi extends cr {
|
|
|
1151
1159
|
}
|
|
1152
1160
|
addResultListener(e) {
|
|
1153
1161
|
let r = 0;
|
|
1154
|
-
const s =
|
|
1155
|
-
const
|
|
1162
|
+
const s = li(this.inner, "confirm", (a) => {
|
|
1163
|
+
const h = a.item.value;
|
|
1156
1164
|
r = Date.now(), e(Object.assign({
|
|
1157
|
-
title:
|
|
1165
|
+
title: h.business,
|
|
1158
1166
|
country: ""
|
|
1159
1167
|
// Baidu的自动完成只支持中国
|
|
1160
|
-
},
|
|
1161
|
-
}), n =
|
|
1168
|
+
}, h));
|
|
1169
|
+
}), n = hi(this.input, "keyup", (a) => {
|
|
1162
1170
|
a.key === "Enter" && Date.now() - r > 100 && e({
|
|
1163
1171
|
title: this.input.value,
|
|
1164
1172
|
country: "",
|
|
@@ -1174,56 +1182,56 @@ class mi extends cr {
|
|
|
1174
1182
|
};
|
|
1175
1183
|
}
|
|
1176
1184
|
}
|
|
1177
|
-
class
|
|
1185
|
+
class gr {
|
|
1178
1186
|
constructor(t) {
|
|
1179
1187
|
this.options = t;
|
|
1180
1188
|
}
|
|
1181
1189
|
}
|
|
1182
|
-
const
|
|
1190
|
+
const Dt = class extends gr {
|
|
1183
1191
|
/** @see https://developers.google.com/maps/documentation/urls/get-started#directions-action */
|
|
1184
1192
|
directions(t, e, r) {
|
|
1185
|
-
const s = new URL("dir/",
|
|
1193
|
+
const s = new URL("dir/", Dt.BASE_URL), n = new URLSearchParams(Object.entries({
|
|
1186
1194
|
api: "1",
|
|
1187
|
-
origin: K.toString(t,
|
|
1188
|
-
destination: K.toString(e,
|
|
1195
|
+
origin: K.toString(t, I.wgs84),
|
|
1196
|
+
destination: K.toString(e, I.wgs84),
|
|
1189
1197
|
travelmode: r
|
|
1190
|
-
}).filter(
|
|
1198
|
+
}).filter(Qt));
|
|
1191
1199
|
return s.search = "?" + n.toString(), s;
|
|
1192
1200
|
}
|
|
1193
1201
|
};
|
|
1194
|
-
let
|
|
1195
|
-
|
|
1196
|
-
const
|
|
1202
|
+
let Be = Dt;
|
|
1203
|
+
c(Be, "BASE_URL", "https://www.google.com/maps/");
|
|
1204
|
+
const zt = class extends gr {
|
|
1197
1205
|
/** @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 */
|
|
1198
1206
|
directions(t, e, r = "driving") {
|
|
1199
|
-
const s = new URL("direction",
|
|
1207
|
+
const s = new URL("direction", zt.BASE_URL), n = K.getCoordType(e) ?? K.getCoordType(t) ?? I.bd09, a = K.toString(e, n), h = new URLSearchParams(Object.entries({
|
|
1200
1208
|
// baidu地图, 一定要有起点, 故这里用终点当起点, 防止导航失败
|
|
1201
1209
|
origin: K.toString(t, n) ?? (typeof e != "string" ? `name:请选择起点|latlng:${a}` : a),
|
|
1202
1210
|
destination: a,
|
|
1203
1211
|
// 默认就是bd09
|
|
1204
|
-
coord_type: n ===
|
|
1212
|
+
coord_type: n === I.bd09 ? void 0 : n,
|
|
1205
1213
|
mode: r,
|
|
1206
1214
|
output: "html",
|
|
1207
1215
|
region: "中国",
|
|
1208
1216
|
src: window.location.hostname
|
|
1209
|
-
}).filter(
|
|
1210
|
-
return s.search = "?" +
|
|
1217
|
+
}).filter(Qt));
|
|
1218
|
+
return s.search = "?" + h.toString(), s;
|
|
1211
1219
|
}
|
|
1212
1220
|
};
|
|
1213
|
-
let
|
|
1214
|
-
|
|
1215
|
-
let
|
|
1221
|
+
let Ie = zt;
|
|
1222
|
+
c(Ie, "BASE_URL", "https://api.map.baidu.com/");
|
|
1223
|
+
let vi = class mr {
|
|
1216
1224
|
constructor(t, e, r) {
|
|
1217
|
-
this.extend(
|
|
1225
|
+
this.extend(mr, 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;
|
|
1218
1226
|
var s = r || {};
|
|
1219
1227
|
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(t), this.prevZoom_ = this.map_.getZoom();
|
|
1220
1228
|
var n = this;
|
|
1221
1229
|
google.maps.event.addListener(this.map_, "zoom_changed", function() {
|
|
1222
|
-
var a = n.map_.getZoom(),
|
|
1230
|
+
var a = n.map_.getZoom(), h = n.map_.minZoom || 0, o = Math.min(
|
|
1223
1231
|
n.map_.maxZoom || 100,
|
|
1224
1232
|
n.map_.mapTypes[n.map_.getMapTypeId()].maxZoom
|
|
1225
1233
|
);
|
|
1226
|
-
a = Math.min(Math.max(a,
|
|
1234
|
+
a = Math.min(Math.max(a, h), o), n.prevZoom_ != a && (n.prevZoom_ = a, n.resetViewport());
|
|
1227
1235
|
}), google.maps.event.addListener(this.map_, "idle", function() {
|
|
1228
1236
|
n.redraw();
|
|
1229
1237
|
}), e && (e.length || Object.keys(e).length) && this.addMarkers(e, !1);
|
|
@@ -1466,8 +1474,8 @@ let fi = class ur {
|
|
|
1466
1474
|
*/
|
|
1467
1475
|
removeMarkers(t, e) {
|
|
1468
1476
|
for (var r = t === this.getMarkers() ? t.slice() : t, s = !1, n = 0, a; a = r[n]; n++) {
|
|
1469
|
-
var
|
|
1470
|
-
s = s ||
|
|
1477
|
+
var h = this.removeMarker_(a);
|
|
1478
|
+
s = s || h;
|
|
1471
1479
|
}
|
|
1472
1480
|
if (!e && s)
|
|
1473
1481
|
return this.resetViewport(), this.redraw(), !0;
|
|
@@ -1554,8 +1562,8 @@ let fi = class ur {
|
|
|
1554
1562
|
n.x += this.gridSize_, n.y -= this.gridSize_;
|
|
1555
1563
|
var a = e.fromLatLngToDivPixel(s);
|
|
1556
1564
|
a.x -= this.gridSize_, a.y += this.gridSize_;
|
|
1557
|
-
var
|
|
1558
|
-
return t.extend(
|
|
1565
|
+
var h = e.fromDivPixelToLatLng(n), o = e.fromDivPixelToLatLng(a);
|
|
1566
|
+
return t.extend(h), t.extend(o), t;
|
|
1559
1567
|
}
|
|
1560
1568
|
/**
|
|
1561
1569
|
* Determins if a marker is contained in a bounds.
|
|
@@ -1613,7 +1621,7 @@ let fi = class ur {
|
|
|
1613
1621
|
distanceBetweenPoints_(t, e) {
|
|
1614
1622
|
if (!t || !e)
|
|
1615
1623
|
return 0;
|
|
1616
|
-
var r = 6371, s = (e.lat() - t.lat()) * Math.PI / 180, n = (e.lng() - t.lng()) * Math.PI / 180, a = Math.sin(s / 2) * Math.sin(s / 2) + Math.cos(t.lat() * Math.PI / 180) * Math.cos(e.lat() * Math.PI / 180) * Math.sin(n / 2) * Math.sin(n / 2),
|
|
1624
|
+
var r = 6371, s = (e.lat() - t.lat()) * Math.PI / 180, n = (e.lng() - t.lng()) * Math.PI / 180, a = Math.sin(s / 2) * Math.sin(s / 2) + Math.cos(t.lat() * Math.PI / 180) * Math.cos(e.lat() * Math.PI / 180) * Math.sin(n / 2) * Math.sin(n / 2), h = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)), o = r * h;
|
|
1617
1625
|
return o;
|
|
1618
1626
|
}
|
|
1619
1627
|
/**
|
|
@@ -1626,14 +1634,14 @@ let fi = class ur {
|
|
|
1626
1634
|
for (var e = 4e4, r = null, s = 0, n; n = this.clusters_[s]; s++) {
|
|
1627
1635
|
var a = n.getCenter();
|
|
1628
1636
|
if (a) {
|
|
1629
|
-
var
|
|
1630
|
-
|
|
1637
|
+
var h = this.distanceBetweenPoints_(a, t.getPosition());
|
|
1638
|
+
h < e && (e = h, r = n);
|
|
1631
1639
|
}
|
|
1632
1640
|
}
|
|
1633
1641
|
if (r && r.isMarkerInClusterBounds(t))
|
|
1634
1642
|
r.addMarker(t);
|
|
1635
1643
|
else {
|
|
1636
|
-
var o = new
|
|
1644
|
+
var o = new _i(this);
|
|
1637
1645
|
o.addMarker(t), this.clusters_.push(o);
|
|
1638
1646
|
}
|
|
1639
1647
|
}
|
|
@@ -1650,9 +1658,9 @@ let fi = class ur {
|
|
|
1650
1658
|
), e = this.getExtendedBounds(t), r = 0, s; s = this.markers_[r]; r++)
|
|
1651
1659
|
!s.isAdded && this.isMarkerInBounds_(s, e) && this.addToClosestCluster_(s);
|
|
1652
1660
|
}
|
|
1653
|
-
},
|
|
1661
|
+
}, _i = class {
|
|
1654
1662
|
constructor(t) {
|
|
1655
|
-
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
|
|
1663
|
+
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 mt(
|
|
1656
1664
|
this,
|
|
1657
1665
|
t.getStyles(),
|
|
1658
1666
|
t.getGridSize()
|
|
@@ -1786,9 +1794,9 @@ let fi = class ur {
|
|
|
1786
1794
|
this.clusterIcon_.setCenter(this.center_), this.clusterIcon_.setSums(a), this.clusterIcon_.show();
|
|
1787
1795
|
}
|
|
1788
1796
|
};
|
|
1789
|
-
class
|
|
1797
|
+
class mt {
|
|
1790
1798
|
constructor(t, e, r) {
|
|
1791
|
-
t.getMarkerClusterer().extend(
|
|
1799
|
+
t.getMarkerClusterer().extend(mt, 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_);
|
|
1792
1800
|
}
|
|
1793
1801
|
/**
|
|
1794
1802
|
* Triggers the clusterclick event and zoom's if the option is set.
|
|
@@ -1919,11 +1927,11 @@ class pt {
|
|
|
1919
1927
|
), e.join("");
|
|
1920
1928
|
}
|
|
1921
1929
|
}
|
|
1922
|
-
var
|
|
1930
|
+
var fr = { exports: {} };
|
|
1923
1931
|
(function(i, t) {
|
|
1924
1932
|
(function(e, r) {
|
|
1925
1933
|
i.exports = r();
|
|
1926
|
-
})(
|
|
1934
|
+
})(Kt, function() {
|
|
1927
1935
|
var e, r = e = r || { version: "1.3.8" }, s = {};
|
|
1928
1936
|
r.guid = "$BAIDU$", s[r.guid] = s[r.guid] || {}, r.dom = r.dom || {}, r.dom.g = function(o) {
|
|
1929
1937
|
return typeof o == "string" || o instanceof String ? document.getElementById(o) : o && o.nodeName && (o.nodeType == 1 || o.nodeType == 9) ? o : null;
|
|
@@ -1935,55 +1943,55 @@ var pr = { exports: {} };
|
|
|
1935
1943
|
return r.lang.isString(o) ? document.getElementById(o) : o;
|
|
1936
1944
|
}, 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) {
|
|
1937
1945
|
o = r.dom._g(o);
|
|
1938
|
-
var
|
|
1939
|
-
return
|
|
1940
|
-
}, r.dom._styleFixer = r.dom._styleFixer || {}, r.dom._styleFilter = r.dom._styleFilter || [], r.dom._styleFilter.filter = function(o, l,
|
|
1946
|
+
var d = r.dom.getDocument(o), u;
|
|
1947
|
+
return d.defaultView && d.defaultView.getComputedStyle && (u = d.defaultView.getComputedStyle(o, null), u) ? u[l] || u.getPropertyValue(l) : "";
|
|
1948
|
+
}, r.dom._styleFixer = r.dom._styleFixer || {}, r.dom._styleFilter = r.dom._styleFilter || [], r.dom._styleFilter.filter = function(o, l, d) {
|
|
1941
1949
|
for (var u = 0, p = r.dom._styleFilter, b; b = p[u]; u++)
|
|
1942
|
-
(b = b[
|
|
1950
|
+
(b = b[d]) && (l = b(o, l));
|
|
1943
1951
|
return l;
|
|
1944
1952
|
}, r.string = r.string || {}, r.string.toCamelCase = function(o) {
|
|
1945
1953
|
return o.indexOf("-") < 0 && o.indexOf("_") < 0 ? o : o.replace(/[-_][^-_]/g, function(l) {
|
|
1946
1954
|
return l.charAt(1).toUpperCase();
|
|
1947
1955
|
});
|
|
1948
1956
|
}, r.dom.getStyle = function(o, l) {
|
|
1949
|
-
var
|
|
1950
|
-
o =
|
|
1951
|
-
var u = o.style[l] || (o.currentStyle ? o.currentStyle[l] : "") ||
|
|
1957
|
+
var d = r.dom;
|
|
1958
|
+
o = d.g(o), l = r.string.toCamelCase(l);
|
|
1959
|
+
var u = o.style[l] || (o.currentStyle ? o.currentStyle[l] : "") || d.getComputedStyle(o, l);
|
|
1952
1960
|
if (!u) {
|
|
1953
|
-
var p =
|
|
1961
|
+
var p = d._styleFixer[l];
|
|
1954
1962
|
p && (u = p.get ? p.get(o) : r.dom.getStyle(o, p));
|
|
1955
1963
|
}
|
|
1956
|
-
return (p =
|
|
1964
|
+
return (p = d._styleFilter) && (u = p.filter(l, u, "get")), u;
|
|
1957
1965
|
}, 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) {
|
|
1958
1966
|
o = r.dom.g(o);
|
|
1959
|
-
var l = r.dom.getDocument(o),
|
|
1960
|
-
|
|
1961
|
-
var p = { left: 0, top: 0 }, b =
|
|
1967
|
+
var l = r.dom.getDocument(o), d = r.browser, u = r.dom.getStyle;
|
|
1968
|
+
d.isGecko > 0 && l.getBoxObjectFor && u(o, "position") == "absolute" && (o.style.top === "" || o.style.left);
|
|
1969
|
+
var p = { left: 0, top: 0 }, b = d.ie && !d.isStrict ? l.body : l.documentElement, _, T;
|
|
1962
1970
|
if (o == b)
|
|
1963
1971
|
return p;
|
|
1964
1972
|
if (o.getBoundingClientRect) {
|
|
1965
1973
|
T = o.getBoundingClientRect(), p.left = Math.floor(T.left) + Math.max(l.documentElement.scrollLeft, l.body.scrollLeft), p.top = Math.floor(T.top) + Math.max(l.documentElement.scrollTop, l.body.scrollTop), p.left -= l.documentElement.clientLeft, p.top -= l.documentElement.clientTop;
|
|
1966
1974
|
var g = l.body, f = parseInt(u(g, "borderLeftWidth")), v = parseInt(u(g, "borderTopWidth"));
|
|
1967
|
-
|
|
1975
|
+
d.ie && !d.isStrict && (p.left -= isNaN(f) ? 2 : f, p.top -= isNaN(v) ? 2 : v);
|
|
1968
1976
|
} else {
|
|
1969
1977
|
_ = o;
|
|
1970
1978
|
do {
|
|
1971
|
-
if (p.left += _.offsetLeft, p.top += _.offsetTop,
|
|
1979
|
+
if (p.left += _.offsetLeft, p.top += _.offsetTop, d.isWebkit > 0 && u(_, "position") == "fixed") {
|
|
1972
1980
|
p.left += l.body.scrollLeft, p.top += l.body.scrollTop;
|
|
1973
1981
|
break;
|
|
1974
1982
|
}
|
|
1975
1983
|
_ = _.offsetParent;
|
|
1976
1984
|
} while (_ && _ != o);
|
|
1977
|
-
for ((
|
|
1978
|
-
p.left -= _.scrollLeft, (!
|
|
1985
|
+
for ((d.opera > 0 || d.isWebkit > 0 && u(o, "position") == "absolute") && (p.top -= l.body.offsetTop), _ = o.offsetParent; _ && _ != l.body; )
|
|
1986
|
+
p.left -= _.scrollLeft, (!d.opera || _.tagName != "TR") && (p.top -= _.scrollTop), _ = _.offsetParent;
|
|
1979
1987
|
}
|
|
1980
1988
|
return p;
|
|
1981
|
-
}, r.event = r.event || {}, r.event._listeners = r.event._listeners || [], r.event.on = function(o, l,
|
|
1989
|
+
}, r.event = r.event || {}, r.event._listeners = r.event._listeners || [], r.event.on = function(o, l, d) {
|
|
1982
1990
|
l = l.replace(/^on/i, ""), o = r.dom._g(o);
|
|
1983
1991
|
var u = function(g) {
|
|
1984
|
-
|
|
1992
|
+
d.call(o, g);
|
|
1985
1993
|
}, p = r.event._listeners, b = r.event._eventFilter, _, T = l;
|
|
1986
|
-
return l = l.toLowerCase(), b && b[l] && (_ = b[l](o, l, u), T = _.type, u = _.listener), o.addEventListener ? o.addEventListener(T, u, !1) : o.attachEvent && o.attachEvent("on" + T, u), p[p.length] = [o, l,
|
|
1994
|
+
return l = l.toLowerCase(), b && b[l] && (_ = b[l](o, l, u), T = _.type, u = _.listener), o.addEventListener ? o.addEventListener(T, u, !1) : o.attachEvent && o.attachEvent("on" + T, u), p[p.length] = [o, l, d, u, T], o;
|
|
1987
1995
|
}, r.on = r.event.on, function() {
|
|
1988
1996
|
var o = s[r.guid];
|
|
1989
1997
|
r.lang.guid = function() {
|
|
@@ -2002,87 +2010,87 @@ var pr = { exports: {} };
|
|
|
2002
2010
|
return "[object " + (this._className || "Object") + "]";
|
|
2003
2011
|
}, r.lang.Event = function(o, l) {
|
|
2004
2012
|
this.type = o, this.returnValue = !0, this.target = l || null, this.currentTarget = null;
|
|
2005
|
-
}, r.lang.Class.prototype.addEventListener = function(o, l,
|
|
2013
|
+
}, r.lang.Class.prototype.addEventListener = function(o, l, d) {
|
|
2006
2014
|
if (r.lang.isFunction(l)) {
|
|
2007
2015
|
!this.__listeners && (this.__listeners = {});
|
|
2008
2016
|
var u = this.__listeners, p;
|
|
2009
|
-
if (typeof
|
|
2010
|
-
if (/[^\w\-]/.test(
|
|
2011
|
-
throw "nonstandard key:" +
|
|
2012
|
-
l.hashCode =
|
|
2017
|
+
if (typeof d == "string" && d) {
|
|
2018
|
+
if (/[^\w\-]/.test(d))
|
|
2019
|
+
throw "nonstandard key:" + d;
|
|
2020
|
+
l.hashCode = d, p = d;
|
|
2013
2021
|
}
|
|
2014
2022
|
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;
|
|
2015
2023
|
}
|
|
2016
2024
|
}, r.lang.Class.prototype.removeEventListener = function(o, l) {
|
|
2017
2025
|
if (!(typeof l < "u" && (r.lang.isFunction(l) && !(l = l.hashCode) || !r.lang.isString(l)))) {
|
|
2018
2026
|
!this.__listeners && (this.__listeners = {}), o.indexOf("on") != 0 && (o = "on" + o);
|
|
2019
|
-
var
|
|
2020
|
-
if (
|
|
2027
|
+
var d = this.__listeners;
|
|
2028
|
+
if (d[o])
|
|
2021
2029
|
if (typeof l < "u")
|
|
2022
|
-
|
|
2030
|
+
d[o][l] && delete d[o][l];
|
|
2023
2031
|
else
|
|
2024
|
-
for (var u in
|
|
2025
|
-
delete
|
|
2032
|
+
for (var u in d[o])
|
|
2033
|
+
delete d[o][u];
|
|
2026
2034
|
}
|
|
2027
2035
|
}, r.lang.Class.prototype.dispatchEvent = function(o, l) {
|
|
2028
2036
|
r.lang.isString(o) && (o = new r.lang.Event(o)), !this.__listeners && (this.__listeners = {}), l = l || {};
|
|
2029
|
-
for (var
|
|
2030
|
-
o[
|
|
2031
|
-
var
|
|
2037
|
+
for (var d in l)
|
|
2038
|
+
o[d] = l[d];
|
|
2039
|
+
var d, u = this.__listeners, p = o.type;
|
|
2032
2040
|
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")
|
|
2033
|
-
for (
|
|
2034
|
-
u[p][
|
|
2041
|
+
for (d in u[p])
|
|
2042
|
+
u[p][d].apply(this, arguments);
|
|
2035
2043
|
return o.returnValue;
|
|
2036
|
-
}, r.lang.inherits = function(o, l,
|
|
2044
|
+
}, r.lang.inherits = function(o, l, d) {
|
|
2037
2045
|
var u, p, b = o.prototype, _ = new Function();
|
|
2038
2046
|
_.prototype = l.prototype, p = o.prototype = new _();
|
|
2039
2047
|
for (u in b)
|
|
2040
2048
|
p[u] = b[u];
|
|
2041
|
-
o.prototype.constructor = o, o.superClass = l.prototype, typeof
|
|
2049
|
+
o.prototype.constructor = o, o.superClass = l.prototype, typeof d == "string" && (p._className = d);
|
|
2042
2050
|
}, r.inherits = r.lang.inherits;
|
|
2043
|
-
var n = "http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m", a = "png",
|
|
2051
|
+
var n = "http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m", a = "png", h = function(o, l, d) {
|
|
2044
2052
|
try {
|
|
2045
2053
|
BMap;
|
|
2046
2054
|
} catch {
|
|
2047
2055
|
throw Error("Baidu Map JS API is not ready yet!");
|
|
2048
2056
|
}
|
|
2049
|
-
e.lang.inherits(
|
|
2057
|
+
e.lang.inherits(h, BMap.Overlay, "TextIconOverlay"), this._position = o, this._text = l, this._options = d || {}, this._styles = this._options.styles || [], this._zIndex = this._options.zIndex, !this._styles.length && this._setupDefaultStyles();
|
|
2050
2058
|
};
|
|
2051
|
-
return
|
|
2052
|
-
for (var o = [53, 56, 66, 78, 90], l = 0,
|
|
2059
|
+
return h.prototype._setupDefaultStyles = function() {
|
|
2060
|
+
for (var o = [53, 56, 66, 78, 90], l = 0, d; d = o[l]; l++)
|
|
2053
2061
|
this._styles.push({
|
|
2054
2062
|
url: n + l + "." + a,
|
|
2055
|
-
size: new BMap.Size(
|
|
2063
|
+
size: new BMap.Size(d, d)
|
|
2056
2064
|
});
|
|
2057
|
-
},
|
|
2065
|
+
}, h.prototype.initialize = function(o) {
|
|
2058
2066
|
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;
|
|
2059
|
-
},
|
|
2067
|
+
}, h.prototype.draw = function() {
|
|
2060
2068
|
this._map && this._updatePosition();
|
|
2061
|
-
},
|
|
2069
|
+
}, h.prototype.getText = function() {
|
|
2062
2070
|
return this._text;
|
|
2063
|
-
},
|
|
2071
|
+
}, h.prototype.setText = function(o) {
|
|
2064
2072
|
o && (!this._text || this._text.toString() != o.toString()) && (this._text = o, this._updateText(), this._updateCss(), this._updatePosition());
|
|
2065
|
-
},
|
|
2073
|
+
}, h.prototype.getPosition = function() {
|
|
2066
2074
|
return this._position;
|
|
2067
|
-
},
|
|
2075
|
+
}, h.prototype.setPosition = function(o) {
|
|
2068
2076
|
o && (!this._position || !this._position.equals(o)) && (this._position = o, this._updatePosition());
|
|
2069
|
-
},
|
|
2070
|
-
var
|
|
2077
|
+
}, h.prototype.getStyleByText = function(o, l) {
|
|
2078
|
+
var d = parseInt(o), u = parseInt(d / 10);
|
|
2071
2079
|
return u = Math.max(0, u), u = Math.min(u, l.length - 1), l[u];
|
|
2072
|
-
},
|
|
2080
|
+
}, h.prototype._updateCss = function() {
|
|
2073
2081
|
if (this._domElement) {
|
|
2074
2082
|
var o = this.getStyleByText(this._text, this._styles);
|
|
2075
2083
|
this._domElement.style.cssText = this._buildCssText(o);
|
|
2076
2084
|
}
|
|
2077
|
-
},
|
|
2085
|
+
}, h.prototype._updateText = function() {
|
|
2078
2086
|
this._domElement && (this._domElement.innerHTML = this._text);
|
|
2079
|
-
},
|
|
2087
|
+
}, h.prototype._updatePosition = function() {
|
|
2080
2088
|
if (this._domElement && this._position) {
|
|
2081
2089
|
var o = this._domElement.style, l = this._map.pointToOverlayPixel(this._position);
|
|
2082
2090
|
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";
|
|
2083
2091
|
}
|
|
2084
|
-
},
|
|
2085
|
-
var l = o.url,
|
|
2092
|
+
}, h.prototype._buildCssText = function(o) {
|
|
2093
|
+
var l = o.url, d = o.size, u = o.anchor, p = o.offset, b = o.textColor || "black", _ = o.textSize || 10, T = [];
|
|
2086
2094
|
if (this._zIndex && T.push("z-index:" + this._zIndex + ";"), e.browser.ie < 7)
|
|
2087
2095
|
T.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="' + l + '");');
|
|
2088
2096
|
else {
|
|
@@ -2090,11 +2098,11 @@ var pr = { exports: {} };
|
|
|
2090
2098
|
var g = "0 0";
|
|
2091
2099
|
p instanceof BMap.Size && (g = p.width + "px " + p.height + "px"), T.push("background-position:" + g + ";");
|
|
2092
2100
|
}
|
|
2093
|
-
return
|
|
2094
|
-
},
|
|
2101
|
+
return d instanceof BMap.Size && (u instanceof BMap.Size ? (u.height > 0 && u.height < d.height && T.push("height:" + (d.height - u.height) + "px; padding-top:" + u.height + "px;"), u.width > 0 && u.width < d.width && T.push("width:" + (d.width - u.width) + "px; padding-left:" + u.width + "px;")) : (T.push("height:" + d.height + "px; line-height:" + d.height + "px;"), T.push("width:" + d.width + "px; text-align:center;"))), T.push("cursor:pointer; color:" + b + "; position:absolute; font-size:" + _ + "px; font-family:Arial,sans-serif; font-weight:bold"), T.join("");
|
|
2102
|
+
}, h.prototype._bind = function() {
|
|
2095
2103
|
if (!this._domElement)
|
|
2096
2104
|
return;
|
|
2097
|
-
var o = this, l = this._map,
|
|
2105
|
+
var o = this, l = this._map, d = e.lang.Event;
|
|
2098
2106
|
function u(p, b) {
|
|
2099
2107
|
var _ = p.srcElement || p.target, T = p.clientX || p.pageX, g = p.clientY || p.pageY;
|
|
2100
2108
|
if (p && b && T && g && _) {
|
|
@@ -2104,33 +2112,33 @@ var pr = { exports: {} };
|
|
|
2104
2112
|
return b;
|
|
2105
2113
|
}
|
|
2106
2114
|
e.event.on(this._domElement, "mouseover", function(p) {
|
|
2107
|
-
o.dispatchEvent(u(p, new
|
|
2115
|
+
o.dispatchEvent(u(p, new d("onmouseover")));
|
|
2108
2116
|
}), e.event.on(this._domElement, "mouseout", function(p) {
|
|
2109
|
-
o.dispatchEvent(u(p, new
|
|
2117
|
+
o.dispatchEvent(u(p, new d("onmouseout")));
|
|
2110
2118
|
}), e.event.on(this._domElement, "click", function(p) {
|
|
2111
|
-
o.dispatchEvent(u(p, new
|
|
2119
|
+
o.dispatchEvent(u(p, new d("onclick")));
|
|
2112
2120
|
});
|
|
2113
|
-
},
|
|
2121
|
+
}, h;
|
|
2114
2122
|
});
|
|
2115
|
-
})(
|
|
2116
|
-
var
|
|
2117
|
-
const
|
|
2118
|
-
var
|
|
2119
|
-
t =
|
|
2123
|
+
})(fr);
|
|
2124
|
+
var bi = fr.exports;
|
|
2125
|
+
const Wt = /* @__PURE__ */ nt(bi);
|
|
2126
|
+
var yr = function(i, t, e) {
|
|
2127
|
+
t = Ti(t);
|
|
2120
2128
|
var r = i.pointToPixel(t.getNorthEast()), s = i.pointToPixel(t.getSouthWest());
|
|
2121
2129
|
r.x += e, r.y -= e, s.x -= e, s.y += e;
|
|
2122
2130
|
var n = i.pixelToPoint(r), a = i.pixelToPoint(s);
|
|
2123
2131
|
return new BMap.Bounds(a, n);
|
|
2124
|
-
},
|
|
2132
|
+
}, Ti = function(i) {
|
|
2125
2133
|
var t = xe(i.getNorthEast().lng, -180, 180), e = xe(i.getSouthWest().lng, -180, 180), r = xe(i.getNorthEast().lat, -74, 74), s = xe(i.getSouthWest().lat, -74, 74);
|
|
2126
2134
|
return new BMap.Bounds(new BMap.Point(e, s), new BMap.Point(t, r));
|
|
2127
2135
|
}, xe = function(i, t, e) {
|
|
2128
2136
|
return t && (i = Math.max(i, t)), e && (i = Math.min(i, e)), i;
|
|
2129
|
-
},
|
|
2137
|
+
}, vr = function(i) {
|
|
2130
2138
|
return Object.prototype.toString.call(i) === "[object Array]";
|
|
2131
|
-
},
|
|
2139
|
+
}, _r = function(i, t) {
|
|
2132
2140
|
var e = -1;
|
|
2133
|
-
if (
|
|
2141
|
+
if (vr(t)) {
|
|
2134
2142
|
if (t.indexOf)
|
|
2135
2143
|
e = t.indexOf(i);
|
|
2136
2144
|
else
|
|
@@ -2158,7 +2166,7 @@ var gr = function(i, t, e) {
|
|
|
2158
2166
|
r._redraw();
|
|
2159
2167
|
});
|
|
2160
2168
|
var s = e.markers;
|
|
2161
|
-
|
|
2169
|
+
vr(s) && this.addMarkers(s);
|
|
2162
2170
|
}
|
|
2163
2171
|
};
|
|
2164
2172
|
M.prototype.addMarkers = function(i) {
|
|
@@ -2169,7 +2177,7 @@ M.prototype.addMarkers = function(i) {
|
|
|
2169
2177
|
}
|
|
2170
2178
|
};
|
|
2171
2179
|
M.prototype._pushMarkerTo = function(i) {
|
|
2172
|
-
var t =
|
|
2180
|
+
var t = _r(i, this._markers);
|
|
2173
2181
|
t === -1 && (i.isInCluster = !1, this._markers.push(i));
|
|
2174
2182
|
};
|
|
2175
2183
|
M.prototype.addMarker = function(i) {
|
|
@@ -2178,7 +2186,7 @@ M.prototype.addMarker = function(i) {
|
|
|
2178
2186
|
M.prototype._createClusters = function() {
|
|
2179
2187
|
var i = this._map.getBounds();
|
|
2180
2188
|
if (i.getCenter()) {
|
|
2181
|
-
for (var t =
|
|
2189
|
+
for (var t = yr(this._map, i, this._gridSize), e = 0, r; r = this._markers[e]; e++)
|
|
2182
2190
|
!r.isInCluster && t.containsPoint(r.getPosition()) && this._addToClosestCluster(r);
|
|
2183
2191
|
for (var s = this._markers.length, e = 0; e < s; e++)
|
|
2184
2192
|
this._clusters[e] && this._clusters[e].render();
|
|
@@ -2218,7 +2226,7 @@ M.prototype._removeMarkersFromMap = function() {
|
|
|
2218
2226
|
}
|
|
2219
2227
|
};
|
|
2220
2228
|
M.prototype._removeMarker = function(i) {
|
|
2221
|
-
var t =
|
|
2229
|
+
var t = _r(i, this._markers);
|
|
2222
2230
|
return t === -1 ? !1 : (this._map.removeOverlay(i), this._markers.splice(t, 1), !0);
|
|
2223
2231
|
};
|
|
2224
2232
|
M.prototype.removeMarker = function(i) {
|
|
@@ -2294,7 +2302,7 @@ M.prototype.setStylesIndexCalculator = function(i) {
|
|
|
2294
2302
|
};
|
|
2295
2303
|
function z(i) {
|
|
2296
2304
|
var t = this;
|
|
2297
|
-
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
|
|
2305
|
+
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 Wt(this._center, this._markers.length, {
|
|
2298
2306
|
styles: this._markerClusterer.getStyles(),
|
|
2299
2307
|
zIndex: i._zIndex
|
|
2300
2308
|
}), this._clusterMarker.getStyleByText = function(e, r) {
|
|
@@ -2302,7 +2310,7 @@ function z(i) {
|
|
|
2302
2310
|
var s = t._markerClusterer._stylesIndexCalculator(t._markers, r.length);
|
|
2303
2311
|
return r[s];
|
|
2304
2312
|
}
|
|
2305
|
-
return
|
|
2313
|
+
return Wt.prototype.getStyleByText.call(this, e, r);
|
|
2306
2314
|
}, this._clusterMarker.addEventListener && this._clusterMarker.addEventListener("click", function(e) {
|
|
2307
2315
|
t._map.setViewport(t.getBounds());
|
|
2308
2316
|
});
|
|
@@ -2342,7 +2350,7 @@ z.prototype.isReal = function(i) {
|
|
|
2342
2350
|
};
|
|
2343
2351
|
z.prototype.updateGridBounds = function() {
|
|
2344
2352
|
var i = new BMap.Bounds(this._center, this._center);
|
|
2345
|
-
this._gridBounds =
|
|
2353
|
+
this._gridBounds = yr(this._map, i, this._markerClusterer.getGridSize());
|
|
2346
2354
|
};
|
|
2347
2355
|
z.prototype.updateClusterMarker = function() {
|
|
2348
2356
|
if (this._map.getZoom() > this._markerClusterer.getMaxZoom()) {
|
|
@@ -2398,9 +2406,9 @@ var Re;
|
|
|
2398
2406
|
}
|
|
2399
2407
|
i.toGoogle = e;
|
|
2400
2408
|
})(Re || (Re = {}));
|
|
2401
|
-
class
|
|
2409
|
+
class br {
|
|
2402
2410
|
constructor(t) {
|
|
2403
|
-
|
|
2411
|
+
c(this, "inner");
|
|
2404
2412
|
this.map = t;
|
|
2405
2413
|
}
|
|
2406
2414
|
/** baidu/google 拥有相同的函数名 */
|
|
@@ -2424,7 +2432,7 @@ class yr {
|
|
|
2424
2432
|
return this.inner.removeMarkers(t.map((e) => e.innerOverlay));
|
|
2425
2433
|
}
|
|
2426
2434
|
}
|
|
2427
|
-
class
|
|
2435
|
+
class Mi extends br {
|
|
2428
2436
|
constructor(t, e) {
|
|
2429
2437
|
var s;
|
|
2430
2438
|
super(t), this.inner = new M(t.innerMap, {
|
|
@@ -2444,10 +2452,10 @@ class bi extends yr {
|
|
|
2444
2452
|
this.inner._redraw();
|
|
2445
2453
|
}
|
|
2446
2454
|
}
|
|
2447
|
-
class
|
|
2455
|
+
class Oi extends br {
|
|
2448
2456
|
constructor(t, e) {
|
|
2449
2457
|
var s, n;
|
|
2450
|
-
super(t), this.inner = new
|
|
2458
|
+
super(t), this.inner = new vi(
|
|
2451
2459
|
t.innerMap,
|
|
2452
2460
|
// google的构造器中的markers,不会触发重绘, 第一次绘制通过监听地图的'idle'事件触发, 可以直接设置
|
|
2453
2461
|
(s = e.markers) == null ? void 0 : s.map((a) => a.innerOverlay),
|
|
@@ -2461,24 +2469,24 @@ class Ti extends yr {
|
|
|
2461
2469
|
}
|
|
2462
2470
|
);
|
|
2463
2471
|
const r = e.stylesIndexCalculator;
|
|
2464
|
-
r && this.inner.setCalculator((a,
|
|
2472
|
+
r && this.inner.setCalculator((a, h) => ({
|
|
2465
2473
|
text: a.length,
|
|
2466
2474
|
// google内部, 取index时, 会`-1`...故我们这里`+1`, 抵消掉它
|
|
2467
|
-
index: r(a.length,
|
|
2475
|
+
index: r(a.length, h) + 1
|
|
2468
2476
|
}));
|
|
2469
2477
|
}
|
|
2470
2478
|
recreate() {
|
|
2471
2479
|
this.inner.repaint();
|
|
2472
2480
|
}
|
|
2473
2481
|
}
|
|
2474
|
-
class
|
|
2482
|
+
class Tr {
|
|
2475
2483
|
constructor() {
|
|
2476
2484
|
}
|
|
2477
2485
|
}
|
|
2478
|
-
class
|
|
2486
|
+
class Ci extends Tr {
|
|
2479
2487
|
constructor(e, r) {
|
|
2480
2488
|
super();
|
|
2481
|
-
|
|
2489
|
+
c(this, "inner");
|
|
2482
2490
|
this.map = e, this.inner = new google.maps.places.PlacesService(e.innerMap);
|
|
2483
2491
|
}
|
|
2484
2492
|
search(e, r) {
|
|
@@ -2505,27 +2513,27 @@ class Mi extends vr {
|
|
|
2505
2513
|
// 'address_components', // TODO: 2023/04/28 ipcjs 查询请求不支持该字段...
|
|
2506
2514
|
],
|
|
2507
2515
|
locationBias: r
|
|
2508
|
-
}, (a,
|
|
2509
|
-
switch (
|
|
2516
|
+
}, (a, h) => {
|
|
2517
|
+
switch (h) {
|
|
2510
2518
|
case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:
|
|
2511
2519
|
case google.maps.places.PlacesServiceStatus.OK: {
|
|
2512
|
-
const o = (a ?? []).map((l) =>
|
|
2520
|
+
const o = (a ?? []).map((l) => ur(l, this.map));
|
|
2513
2521
|
s(o);
|
|
2514
2522
|
break;
|
|
2515
2523
|
}
|
|
2516
2524
|
default:
|
|
2517
|
-
n(new Error(`status: ${
|
|
2525
|
+
n(new Error(`status: ${h}`));
|
|
2518
2526
|
break;
|
|
2519
2527
|
}
|
|
2520
2528
|
});
|
|
2521
2529
|
});
|
|
2522
2530
|
}
|
|
2523
2531
|
}
|
|
2524
|
-
class
|
|
2532
|
+
class wi extends Tr {
|
|
2525
2533
|
constructor(e, r) {
|
|
2526
2534
|
super();
|
|
2527
|
-
|
|
2528
|
-
|
|
2535
|
+
c(this, "searchRequestMap", /* @__PURE__ */ new Map());
|
|
2536
|
+
c(this, "currentSearch");
|
|
2529
2537
|
this.map = e;
|
|
2530
2538
|
}
|
|
2531
2539
|
get inner() {
|
|
@@ -2552,14 +2560,14 @@ class Oi extends vr {
|
|
|
2552
2560
|
newSearch(e, r) {
|
|
2553
2561
|
return new Promise((s, n) => {
|
|
2554
2562
|
const a = new BMap.LocalSearch(e ?? this.map.innerMap, {
|
|
2555
|
-
onSearchComplete: (
|
|
2556
|
-
Array.isArray(
|
|
2563
|
+
onSearchComplete: (h) => {
|
|
2564
|
+
Array.isArray(h) && at("当前只支持一次搜索一条数据");
|
|
2557
2565
|
const o = a.getStatus();
|
|
2558
2566
|
switch (o) {
|
|
2559
2567
|
case BMAP_STATUS_SUCCESS: {
|
|
2560
2568
|
const l = [];
|
|
2561
|
-
for (let
|
|
2562
|
-
const u =
|
|
2569
|
+
for (let d = 0; d < h.getCurrentNumPois(); d++) {
|
|
2570
|
+
const u = h.getPoi(d);
|
|
2563
2571
|
l.push({
|
|
2564
2572
|
id: u.uid,
|
|
2565
2573
|
city: u.city,
|
|
@@ -2587,10 +2595,10 @@ class Oi extends vr {
|
|
|
2587
2595
|
});
|
|
2588
2596
|
}
|
|
2589
2597
|
}
|
|
2590
|
-
class
|
|
2598
|
+
class Mr {
|
|
2591
2599
|
constructor(t, e) {
|
|
2592
|
-
|
|
2593
|
-
|
|
2600
|
+
c(this, "onData");
|
|
2601
|
+
c(this, "onError");
|
|
2594
2602
|
this.map = t, this.input = e;
|
|
2595
2603
|
}
|
|
2596
2604
|
/**
|
|
@@ -2602,27 +2610,27 @@ class _r {
|
|
|
2602
2610
|
return this.onData && C("setSearchListener只能调用一次"), this.onData = t, this.onError = e, ve;
|
|
2603
2611
|
}
|
|
2604
2612
|
}
|
|
2605
|
-
class
|
|
2613
|
+
class Ei extends Mr {
|
|
2606
2614
|
constructor(e, r) {
|
|
2607
2615
|
super(e, r.input);
|
|
2608
|
-
|
|
2616
|
+
c(this, "searchBox");
|
|
2609
2617
|
this.searchBox = new google.maps.places.SearchBox(r.input), this.searchBox.bindTo("bounds", e.innerMap);
|
|
2610
2618
|
}
|
|
2611
2619
|
setSearchListener(e, r) {
|
|
2612
|
-
return super.setSearchListener(e, r),
|
|
2620
|
+
return super.setSearchListener(e, r), sr(this.searchBox, "places_changed", () => {
|
|
2613
2621
|
const s = this.searchBox.getPlaces();
|
|
2614
|
-
e((s ?? []).map((n) =>
|
|
2622
|
+
e((s ?? []).map((n) => ur(n, this.map)));
|
|
2615
2623
|
});
|
|
2616
2624
|
}
|
|
2617
2625
|
search() {
|
|
2618
2626
|
this.input.value && (google.maps.event.trigger(this.input, "focus", {}), google.maps.event.trigger(this.input, "keydown", { keyCode: 13 }));
|
|
2619
2627
|
}
|
|
2620
2628
|
}
|
|
2621
|
-
class
|
|
2629
|
+
class Li extends Mr {
|
|
2622
2630
|
constructor(e, r) {
|
|
2623
2631
|
super(e, r.input);
|
|
2624
|
-
|
|
2625
|
-
|
|
2632
|
+
c(this, "autocomplete");
|
|
2633
|
+
c(this, "placesService");
|
|
2626
2634
|
this.autocomplete = e.createAutocomplete({ input: r.input, bindToMap: !0 }), this.placesService = e.createPlacesService({});
|
|
2627
2635
|
}
|
|
2628
2636
|
setSearchListener(e, r) {
|
|
@@ -2637,12 +2645,12 @@ class wi extends _r {
|
|
|
2637
2645
|
this.placesService.search(e).then(this.onData, this.onError);
|
|
2638
2646
|
}
|
|
2639
2647
|
}
|
|
2640
|
-
var
|
|
2641
|
-
class
|
|
2648
|
+
var xi = /* @__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))(xi || {});
|
|
2649
|
+
class ft {
|
|
2642
2650
|
constructor(t) {
|
|
2643
|
-
|
|
2651
|
+
c(this, "latestInfoWindow");
|
|
2644
2652
|
/** 使用{@link setEventTargetDelegate}初始化 */
|
|
2645
|
-
|
|
2653
|
+
c(this, "delegate", void 0);
|
|
2646
2654
|
this.element = t, process.env.NODE_ENV !== "production" && setTimeout(() => {
|
|
2647
2655
|
this.delegate || console.warn(`${this.constructor.name}继承了AbstractMap, 但未调用setEventTargetDelegate(delegate)`);
|
|
2648
2656
|
});
|
|
@@ -2691,7 +2699,7 @@ class gt {
|
|
|
2691
2699
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
2692
2700
|
* Released under the MIT License.
|
|
2693
2701
|
*/
|
|
2694
|
-
function
|
|
2702
|
+
function Pi(i) {
|
|
2695
2703
|
return i != null && typeof i == "object" && Array.isArray(i) === !1;
|
|
2696
2704
|
}
|
|
2697
2705
|
/*!
|
|
@@ -2700,49 +2708,49 @@ function Li(i) {
|
|
|
2700
2708
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
2701
2709
|
* Released under the MIT License.
|
|
2702
2710
|
*/
|
|
2703
|
-
function
|
|
2704
|
-
return
|
|
2711
|
+
function Ht(i) {
|
|
2712
|
+
return Pi(i) === !0 && Object.prototype.toString.call(i) === "[object Object]";
|
|
2705
2713
|
}
|
|
2706
|
-
function
|
|
2714
|
+
function Or(i) {
|
|
2707
2715
|
var t, e;
|
|
2708
|
-
return !(
|
|
2716
|
+
return !(Ht(i) === !1 || (t = i.constructor, typeof t != "function") || (e = t.prototype, Ht(e) === !1) || e.hasOwnProperty("isPrototypeOf") === !1);
|
|
2709
2717
|
}
|
|
2710
2718
|
var be;
|
|
2711
2719
|
((i) => {
|
|
2712
|
-
function t(
|
|
2713
|
-
return
|
|
2720
|
+
function t(h, o) {
|
|
2721
|
+
return h.reduce((l, d) => (l[o(d)] = d, l), {});
|
|
2714
2722
|
}
|
|
2715
2723
|
i.fromArray = t;
|
|
2716
|
-
function e(
|
|
2717
|
-
return
|
|
2724
|
+
function e(h) {
|
|
2725
|
+
return h.reduce((o, l) => (o[l[0]] = l[1], o), {});
|
|
2718
2726
|
}
|
|
2719
2727
|
i.fromEntries = e;
|
|
2720
|
-
function r(
|
|
2721
|
-
return JSON.stringify(
|
|
2728
|
+
function r(h) {
|
|
2729
|
+
return JSON.stringify(h, (o, l) => typeof l == "object" && Object.getPrototypeOf(l) !== Object.prototype ? l.toString !== Object.prototype.toString ? l.toString() : `[object ${Object.getPrototypeOf(l).constructor.name}]` : l);
|
|
2722
2730
|
}
|
|
2723
2731
|
i.toJsonSafely = r;
|
|
2724
|
-
function s(
|
|
2725
|
-
|
|
2726
|
-
|
|
2732
|
+
function s(h) {
|
|
2733
|
+
Or(h) && Object.keys(h).forEach((o) => {
|
|
2734
|
+
h[o] === void 0 ? delete h[o] : s(h[o]);
|
|
2727
2735
|
});
|
|
2728
2736
|
}
|
|
2729
2737
|
i.deleteUndefinedPropertyOnPlainObjectDeeply = s;
|
|
2730
|
-
function n(
|
|
2731
|
-
const l =
|
|
2732
|
-
for (const u in
|
|
2733
|
-
l(u) || (
|
|
2734
|
-
return
|
|
2738
|
+
function n(h, ...o) {
|
|
2739
|
+
const l = jt(o), d = {};
|
|
2740
|
+
for (const u in h)
|
|
2741
|
+
l(u) || (d[u] = h[u]);
|
|
2742
|
+
return d;
|
|
2735
2743
|
}
|
|
2736
2744
|
i.omit = n;
|
|
2737
|
-
function a(
|
|
2738
|
-
const l =
|
|
2739
|
-
for (const u in
|
|
2740
|
-
l(u) && (
|
|
2741
|
-
return
|
|
2745
|
+
function a(h, ...o) {
|
|
2746
|
+
const l = jt(o), d = {};
|
|
2747
|
+
for (const u in h)
|
|
2748
|
+
l(u) && (d[u] = h[u]);
|
|
2749
|
+
return d;
|
|
2742
2750
|
}
|
|
2743
2751
|
i.pick = a;
|
|
2744
2752
|
})(be || (be = {}));
|
|
2745
|
-
function
|
|
2753
|
+
function jt(i) {
|
|
2746
2754
|
if (i.length <= 4)
|
|
2747
2755
|
return i.includes.bind(i);
|
|
2748
2756
|
{
|
|
@@ -2751,21 +2759,21 @@ function Wt(i) {
|
|
|
2751
2759
|
}
|
|
2752
2760
|
}
|
|
2753
2761
|
be.toJsonSafely;
|
|
2754
|
-
const
|
|
2755
|
-
var j = /* @__PURE__ */ ((i) => (i.auto = "auto", i.none = "none", i.greedy = "greedy", i.cooperative = "cooperative", i))(j || {}),
|
|
2762
|
+
const ki = ["single", "multi"];
|
|
2763
|
+
var j = /* @__PURE__ */ ((i) => (i.auto = "auto", i.none = "none", i.greedy = "greedy", i.cooperative = "cooperative", i))(j || {}), it;
|
|
2756
2764
|
((i) => {
|
|
2757
2765
|
function t(e) {
|
|
2758
2766
|
be.deleteUndefinedPropertyOnPlainObjectDeeply(e);
|
|
2759
2767
|
const r = { center: y.ZERO, zoom: 5 };
|
|
2760
|
-
return
|
|
2761
|
-
isMergeableObject:
|
|
2768
|
+
return tr(r, e || {}, {
|
|
2769
|
+
isMergeableObject: Or
|
|
2762
2770
|
});
|
|
2763
2771
|
}
|
|
2764
2772
|
i.create = t;
|
|
2765
|
-
})(
|
|
2766
|
-
class
|
|
2773
|
+
})(it || (it = {}));
|
|
2774
|
+
class Cr {
|
|
2767
2775
|
constructor(t, e, r) {
|
|
2768
|
-
|
|
2776
|
+
c(this, "_delegate");
|
|
2769
2777
|
this.innerOverlay = t, this.coordType = e, this.map = r;
|
|
2770
2778
|
}
|
|
2771
2779
|
get delegate() {
|
|
@@ -2781,7 +2789,7 @@ class Tr {
|
|
|
2781
2789
|
this.map.removeOverlay(this);
|
|
2782
2790
|
}
|
|
2783
2791
|
}
|
|
2784
|
-
class
|
|
2792
|
+
class yt extends Cr {
|
|
2785
2793
|
constructor(t, e, r) {
|
|
2786
2794
|
super(t, e, r);
|
|
2787
2795
|
}
|
|
@@ -2795,7 +2803,7 @@ class mt extends Tr {
|
|
|
2795
2803
|
this.innerOverlay.setVisible(t);
|
|
2796
2804
|
}
|
|
2797
2805
|
}
|
|
2798
|
-
class je extends
|
|
2806
|
+
class je extends Cr {
|
|
2799
2807
|
constructor(t, e, r) {
|
|
2800
2808
|
super(t, e, r);
|
|
2801
2809
|
}
|
|
@@ -2850,8 +2858,8 @@ let k = Ge;
|
|
|
2850
2858
|
* - 透明度为0.7和0.8时, 在maintain的发布模式下, polyline的线条会不可见 (原因未知, 在tg-map中无法复现)
|
|
2851
2859
|
* 故统一加个0.001, 规避这些问题...
|
|
2852
2860
|
*/
|
|
2853
|
-
|
|
2854
|
-
class Ve extends
|
|
2861
|
+
c(k, "OPACITY_DELTA", 1e-3);
|
|
2862
|
+
class Ve extends yt {
|
|
2855
2863
|
isEditable() {
|
|
2856
2864
|
return this.innerOverlay.getEditable();
|
|
2857
2865
|
}
|
|
@@ -2874,25 +2882,25 @@ class Ve extends mt {
|
|
|
2874
2882
|
this.innerOverlay.setOptions({ fillOpacity: t });
|
|
2875
2883
|
}
|
|
2876
2884
|
}
|
|
2877
|
-
class
|
|
2885
|
+
class vt extends k {
|
|
2878
2886
|
constructor() {
|
|
2879
2887
|
super(...arguments);
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2888
|
+
c(this, "prevCenter");
|
|
2889
|
+
c(this, "prevRadius");
|
|
2890
|
+
c(this, "isDoingSetCenter", !1);
|
|
2891
|
+
c(this, "isDoingSetRadius", !1);
|
|
2892
|
+
c(this, "eventHubDelegate");
|
|
2893
|
+
c(this, "onRadiusChanged", () => {
|
|
2886
2894
|
var r;
|
|
2887
2895
|
const e = this.innerOverlay.getRadius();
|
|
2888
2896
|
this.prevRadius !== e && (this.isDoingSetRadius || (r = this.eventHubDelegate) == null || r.notify({ type: "radius-changed", target: this }), this.prevRadius = e);
|
|
2889
2897
|
});
|
|
2890
|
-
|
|
2898
|
+
c(this, "onCenterChanged", () => {
|
|
2891
2899
|
var r;
|
|
2892
2900
|
const e = this.innerOverlay.getCenter();
|
|
2893
2901
|
this.prevCenter !== e && (this.isDoingSetCenter || (r = this.eventHubDelegate) == null || r.notify({ type: "center-changed", target: this }), this.prevCenter = e);
|
|
2894
2902
|
});
|
|
2895
|
-
|
|
2903
|
+
c(this, "resetEditableTimeoutId");
|
|
2896
2904
|
}
|
|
2897
2905
|
static create(e) {
|
|
2898
2906
|
const r = this.coordType, s = new BMap.Circle(e.center.toBaidu(r), e.radius, {
|
|
@@ -2905,7 +2913,7 @@ class ft extends k {
|
|
|
2905
2913
|
strokeWeight: e.strokeWeight,
|
|
2906
2914
|
fillColor: e.fillColor,
|
|
2907
2915
|
fillOpacity: e.fillOpacity != null ? e.fillOpacity + k.OPACITY_DELTA : void 0
|
|
2908
|
-
}), n = new
|
|
2916
|
+
}), n = new vt(s, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
2909
2917
|
return n.state.editable && setTimeout(() => {
|
|
2910
2918
|
n.state.editable && s.enableEditing();
|
|
2911
2919
|
}, 0), n;
|
|
@@ -2936,7 +2944,7 @@ class ft extends k {
|
|
|
2936
2944
|
return this.innerOverlay.getRadius();
|
|
2937
2945
|
}
|
|
2938
2946
|
}
|
|
2939
|
-
class
|
|
2947
|
+
class _t extends Ve {
|
|
2940
2948
|
static create(t) {
|
|
2941
2949
|
const e = this.coordType, r = new google.maps.Circle({
|
|
2942
2950
|
center: t.center.toGoogle(e),
|
|
@@ -2950,7 +2958,7 @@ class yt extends Ve {
|
|
|
2950
2958
|
fillOpacity: t.fillOpacity,
|
|
2951
2959
|
visible: t.visible
|
|
2952
2960
|
});
|
|
2953
|
-
return new
|
|
2961
|
+
return new _t(r, e, this);
|
|
2954
2962
|
}
|
|
2955
2963
|
setCenter(t) {
|
|
2956
2964
|
this.coordType = this.map.coordType, this.innerOverlay.setCenter(t.toGoogle(this.coordType));
|
|
@@ -2965,10 +2973,10 @@ class yt extends Ve {
|
|
|
2965
2973
|
return this.innerOverlay.getRadius();
|
|
2966
2974
|
}
|
|
2967
2975
|
}
|
|
2968
|
-
function
|
|
2976
|
+
function wr() {
|
|
2969
2977
|
BMap.OverlayV3 || (BMap.OverlayV3 = BMap.Overlay);
|
|
2970
2978
|
}
|
|
2971
|
-
const
|
|
2979
|
+
const Vt = {
|
|
2972
2980
|
/** {@link BMap.Point.equals} 无效, 故需要自己写一个 */
|
|
2973
2981
|
equals(i, t) {
|
|
2974
2982
|
return i.lat === t.lat && i.lng === t.lng;
|
|
@@ -2979,28 +2987,28 @@ var X;
|
|
|
2979
2987
|
i.ZERO = { x: 0, y: 0 };
|
|
2980
2988
|
})(X || (X = {}));
|
|
2981
2989
|
let Ke;
|
|
2982
|
-
function
|
|
2983
|
-
return Ke || (Ke =
|
|
2990
|
+
function Bi(i, t, e, r, s, n) {
|
|
2991
|
+
return Ke || (Ke = Ii()), new Ke(i, t, e, r, s, n);
|
|
2984
2992
|
}
|
|
2985
|
-
function
|
|
2986
|
-
|
|
2993
|
+
function Ii() {
|
|
2994
|
+
wr();
|
|
2987
2995
|
const i = new BMap.Point(0, 0);
|
|
2988
2996
|
return class extends BMap.OverlayV3 {
|
|
2989
|
-
constructor(r, s = i, n = X.ZERO, a,
|
|
2997
|
+
constructor(r, s = i, n = X.ZERO, a, h = 654, o = "") {
|
|
2990
2998
|
super();
|
|
2991
2999
|
// 类表达式不能有私有成员, 故改成public
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
3000
|
+
c(this, "container");
|
|
3001
|
+
c(this, "border");
|
|
3002
|
+
c(this, "inner");
|
|
3003
|
+
c(this, "map");
|
|
3004
|
+
c(this, "marker");
|
|
2997
3005
|
this.content = r, this.position = s, this.offset = n;
|
|
2998
3006
|
const l = "baidu-info-box-container";
|
|
2999
3007
|
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";
|
|
3000
|
-
const
|
|
3001
|
-
|
|
3008
|
+
const d = document.createElement("img");
|
|
3009
|
+
d.className = l + "__close", d.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", d.addEventListener("click", () => {
|
|
3002
3010
|
this.close(), this.dispatchEvent({ type: "onclickclose" });
|
|
3003
|
-
}), this.inner.appendChild(r), this.border.appendChild(this.inner), this.border.appendChild(
|
|
3011
|
+
}), this.inner.appendChild(r), this.border.appendChild(this.inner), this.border.appendChild(d), this.container.appendChild(this.border), a && this.setZIndex(a), this.setMaxWidth(h), this.onMarkerPositionChanged = this.onMarkerPositionChanged.bind(this);
|
|
3004
3012
|
}
|
|
3005
3013
|
initialize(r) {
|
|
3006
3014
|
return this.map = r, r.getPanes().floatPane.appendChild(this.container), this.container;
|
|
@@ -3049,7 +3057,7 @@ function ki() {
|
|
|
3049
3057
|
}
|
|
3050
3058
|
};
|
|
3051
3059
|
}
|
|
3052
|
-
class
|
|
3060
|
+
class bt {
|
|
3053
3061
|
constructor(t) {
|
|
3054
3062
|
this.delegate = t, this.delegate.setTarget(this);
|
|
3055
3063
|
}
|
|
@@ -3060,7 +3068,7 @@ class vt {
|
|
|
3060
3068
|
this.delegate.removeEventListener(t, e);
|
|
3061
3069
|
}
|
|
3062
3070
|
}
|
|
3063
|
-
class
|
|
3071
|
+
class Tt extends bt {
|
|
3064
3072
|
constructor(t, e, r) {
|
|
3065
3073
|
super(new ae(t, e)), this.inner = t, this.map = e, this.state = r;
|
|
3066
3074
|
}
|
|
@@ -3070,7 +3078,7 @@ class _t extends vt {
|
|
|
3070
3078
|
offset: t.offset && new BMap.Size(t.offset.x, t.offset.y),
|
|
3071
3079
|
enableAutoPan: !t.disableAutoPan
|
|
3072
3080
|
});
|
|
3073
|
-
return new
|
|
3081
|
+
return new Tt(r, this, { position: e });
|
|
3074
3082
|
}
|
|
3075
3083
|
isOpen() {
|
|
3076
3084
|
return this.inner.isOpen();
|
|
@@ -3089,11 +3097,11 @@ class _t extends vt {
|
|
|
3089
3097
|
this.state.position = t, this.inner.isOpen() && this.open();
|
|
3090
3098
|
}
|
|
3091
3099
|
}
|
|
3092
|
-
class
|
|
3100
|
+
class Mt extends bt {
|
|
3093
3101
|
constructor(e, r) {
|
|
3094
3102
|
super(new re(e, r));
|
|
3095
|
-
|
|
3096
|
-
|
|
3103
|
+
c(this, "eventHub", new or());
|
|
3104
|
+
c(this, "isOpened", !1);
|
|
3097
3105
|
this.inner = e, this.map = r, e.addListener("closeclick", () => {
|
|
3098
3106
|
this.isOpened = !1, this.eventHub.hasListener("close") && this.eventHub.notify({ type: "close", target: this });
|
|
3099
3107
|
}), e.addListener("map_changed", () => {
|
|
@@ -3109,7 +3117,7 @@ class bt extends vt {
|
|
|
3109
3117
|
position: r.toGoogle(this.coordType),
|
|
3110
3118
|
disableAutoPan: e.disableAutoPan
|
|
3111
3119
|
});
|
|
3112
|
-
return new
|
|
3120
|
+
return new Mt(s, this);
|
|
3113
3121
|
}
|
|
3114
3122
|
isOpen() {
|
|
3115
3123
|
return this.isOpened;
|
|
@@ -3147,13 +3155,13 @@ class bt extends vt {
|
|
|
3147
3155
|
this.inner.setPosition(e.toGoogle(this.map.coordType));
|
|
3148
3156
|
}
|
|
3149
3157
|
}
|
|
3150
|
-
class
|
|
3158
|
+
class Ot extends je {
|
|
3151
3159
|
constructor(t, e, r) {
|
|
3152
3160
|
super(t, e, r), this.baiduMap = r;
|
|
3153
3161
|
}
|
|
3154
3162
|
static create(t) {
|
|
3155
3163
|
var s;
|
|
3156
|
-
const e = this.coordType, r =
|
|
3164
|
+
const e = this.coordType, r = Bi(
|
|
3157
3165
|
t.content,
|
|
3158
3166
|
(s = t.position) == null ? void 0 : s.toBaidu(e),
|
|
3159
3167
|
t.offset,
|
|
@@ -3161,7 +3169,7 @@ class Tt extends je {
|
|
|
3161
3169
|
t.maxWidth,
|
|
3162
3170
|
t.borderClass
|
|
3163
3171
|
);
|
|
3164
|
-
return new
|
|
3172
|
+
return new Ot(r, e, this);
|
|
3165
3173
|
}
|
|
3166
3174
|
open(t) {
|
|
3167
3175
|
this.innerOverlay.open(this.baiduMap.innerMap, t == null ? void 0 : t.innerOverlay);
|
|
@@ -3182,7 +3190,7 @@ class Tt extends je {
|
|
|
3182
3190
|
this.innerOverlay.setZIndex(t);
|
|
3183
3191
|
}
|
|
3184
3192
|
}
|
|
3185
|
-
class
|
|
3193
|
+
class Ct extends bt {
|
|
3186
3194
|
constructor(t, e, r) {
|
|
3187
3195
|
super(new re(t, r)), this.inner = t, this.coordType = e, this.map = r;
|
|
3188
3196
|
}
|
|
@@ -3196,10 +3204,10 @@ class Mt extends vt {
|
|
|
3196
3204
|
maxWidth: t.maxWidth
|
|
3197
3205
|
}), s = t.borderClass;
|
|
3198
3206
|
return s && r.addListener("domready", () => {
|
|
3199
|
-
var
|
|
3200
|
-
const a = (
|
|
3207
|
+
var h;
|
|
3208
|
+
const a = (h = t.content.parentElement) == null ? void 0 : h.parentElement;
|
|
3201
3209
|
a && a.className.includes("gm-style-iw-c") && !a.className.includes(s) && (a.className += ` ${s}`);
|
|
3202
|
-
}), new
|
|
3210
|
+
}), new Ct(r, e, this);
|
|
3203
3211
|
}
|
|
3204
3212
|
open(t) {
|
|
3205
3213
|
this.inner.open(this.map.innerMap, t == null ? void 0 : t.innerOverlay);
|
|
@@ -3241,11 +3249,11 @@ var Te;
|
|
|
3241
3249
|
}
|
|
3242
3250
|
i.trimIndent = e;
|
|
3243
3251
|
function r(s) {
|
|
3244
|
-
return s.replace(/([^A-Z]?)([A-Z])/g, (n, a,
|
|
3252
|
+
return s.replace(/([^A-Z]?)([A-Z])/g, (n, a, h) => a ? `${a}-${h.toLowerCase()}` : h.toLowerCase());
|
|
3245
3253
|
}
|
|
3246
3254
|
i.pascal2kebab = r;
|
|
3247
3255
|
})(Te || (Te = {}));
|
|
3248
|
-
const
|
|
3256
|
+
const Si = {
|
|
3249
3257
|
/** @see https://nodejs.org/docs/v10.3.0/api/path.html#path_path_basename_path_ext */
|
|
3250
3258
|
basename(i, t) {
|
|
3251
3259
|
const e = i.endsWith("/") ? i.slice(0, -1) : i, r = e.lastIndexOf("/"), s = r >= 0 ? e.substring(r + 1) : e;
|
|
@@ -3285,13 +3293,13 @@ var Me = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overla
|
|
|
3285
3293
|
}
|
|
3286
3294
|
i.toBaidu = e;
|
|
3287
3295
|
})(Oe || (Oe = {}));
|
|
3288
|
-
class
|
|
3296
|
+
class Ai {
|
|
3289
3297
|
constructor(t, e) {
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3298
|
+
c(this, "baidu");
|
|
3299
|
+
c(this, "google");
|
|
3300
|
+
c(this, "projection");
|
|
3301
|
+
c(this, "element", void 0);
|
|
3302
|
+
c(this, "mapPane");
|
|
3295
3303
|
this.map = t, this.mapPane = e.mapPane;
|
|
3296
3304
|
}
|
|
3297
3305
|
create() {
|
|
@@ -3306,12 +3314,12 @@ class Bi {
|
|
|
3306
3314
|
asBaidu() {
|
|
3307
3315
|
if (!this.baidu) {
|
|
3308
3316
|
const t = this;
|
|
3309
|
-
|
|
3317
|
+
wr();
|
|
3310
3318
|
class e extends BMap.OverlayV3 {
|
|
3311
3319
|
initialize(n) {
|
|
3312
3320
|
var o;
|
|
3313
|
-
const a = t.create(),
|
|
3314
|
-
return (o = Oe.toBaidu(t.mapPane,
|
|
3321
|
+
const a = t.create(), h = n.getPanes();
|
|
3322
|
+
return (o = Oe.toBaidu(t.mapPane, h)) == null || o.appendChild(a), a;
|
|
3315
3323
|
}
|
|
3316
3324
|
draw() {
|
|
3317
3325
|
t.draw();
|
|
@@ -3359,14 +3367,14 @@ class Bi {
|
|
|
3359
3367
|
}
|
|
3360
3368
|
}
|
|
3361
3369
|
let Xe;
|
|
3362
|
-
function
|
|
3363
|
-
return Xe || (Xe =
|
|
3370
|
+
function Ri(i, t, e, r, s) {
|
|
3371
|
+
return Xe || (Xe = $i()), new Xe(i, t, e, r, s);
|
|
3364
3372
|
}
|
|
3365
|
-
function
|
|
3373
|
+
function $i() {
|
|
3366
3374
|
return class extends google.maps.OverlayView {
|
|
3367
3375
|
constructor(e, r, s, n = Me.overlayMouseTarget, a) {
|
|
3368
3376
|
super();
|
|
3369
|
-
|
|
3377
|
+
c(this, "container");
|
|
3370
3378
|
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", () => {
|
|
3371
3379
|
google.maps.event.trigger(this, "click");
|
|
3372
3380
|
}), this.setElement(e);
|
|
@@ -3431,13 +3439,13 @@ var de;
|
|
|
3431
3439
|
}
|
|
3432
3440
|
i.toElement = e;
|
|
3433
3441
|
})(de || (de = {}));
|
|
3434
|
-
class
|
|
3442
|
+
class wt extends je {
|
|
3435
3443
|
constructor(e, r, s, n) {
|
|
3436
3444
|
super(e, r, s);
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3445
|
+
c(this, "icon");
|
|
3446
|
+
c(this, "iconAnchor");
|
|
3447
|
+
c(this, "content", void 0);
|
|
3448
|
+
c(this, "contentObserver");
|
|
3441
3449
|
this.setContentInternal(n, !0);
|
|
3442
3450
|
}
|
|
3443
3451
|
static create(e) {
|
|
@@ -3451,7 +3459,7 @@ class Ot extends je {
|
|
|
3451
3459
|
padding: "0px",
|
|
3452
3460
|
backgroundColor: "unset"
|
|
3453
3461
|
});
|
|
3454
|
-
const n = new
|
|
3462
|
+
const n = new wt(s, r, this, e.content);
|
|
3455
3463
|
return s.__label__ = n, n;
|
|
3456
3464
|
}
|
|
3457
3465
|
setContentInternal(e, r = !1) {
|
|
@@ -3490,7 +3498,7 @@ class Ot extends je {
|
|
|
3490
3498
|
* @description baidu中Label默认左上角对齐Icon的左上, 我们要将其转换为对齐marker的position
|
|
3491
3499
|
* */
|
|
3492
3500
|
attachIcon(e) {
|
|
3493
|
-
var
|
|
3501
|
+
var h;
|
|
3494
3502
|
let r;
|
|
3495
3503
|
if (e instanceof BMap.Icon)
|
|
3496
3504
|
r = e.anchor;
|
|
@@ -3498,7 +3506,7 @@ class Ot extends je {
|
|
|
3498
3506
|
if (e.anchor)
|
|
3499
3507
|
r = e.anchor;
|
|
3500
3508
|
else {
|
|
3501
|
-
const o = ((
|
|
3509
|
+
const o = ((h = e.__icon__) == null ? void 0 : h.baiduLabelOffset) ?? { x: 0, y: 0 };
|
|
3502
3510
|
r = {
|
|
3503
3511
|
width: e.style.anchor.width + o.x,
|
|
3504
3512
|
height: e.style.anchor.height + o.y
|
|
@@ -3508,8 +3516,8 @@ class Ot extends je {
|
|
|
3508
3516
|
console.log("BaiduLabelOverlay.attachIcon", "Bmap.Symbol.anchor尚未计算完成");
|
|
3509
3517
|
return;
|
|
3510
3518
|
}
|
|
3511
|
-
const l = e.anchor.width - e.style.anchor.width,
|
|
3512
|
-
if (o.x !== l || o.y !==
|
|
3519
|
+
const l = e.anchor.width - e.style.anchor.width, d = e.anchor.height - e.style.anchor.height;
|
|
3520
|
+
if (o.x !== l || o.y !== d) {
|
|
3513
3521
|
const b = [
|
|
3514
3522
|
(u = e.__icon__.anchor) == null ? void 0 : u.x,
|
|
3515
3523
|
(p = e.__icon__.anchor) == null ? void 0 : p.y,
|
|
@@ -3520,7 +3528,7 @@ class Ot extends je {
|
|
|
3520
3528
|
console.warn("BaiduLabelOverlay.attachIcon", e.__icon__, Te.trimIndent(
|
|
3521
3529
|
`
|
|
3522
3530
|
为了保证Label的位置正确, 请将SymbolIcon(${b})中baiduLabelOffset的值改写成:
|
|
3523
|
-
${JSON.stringify({ x: l, y:
|
|
3531
|
+
${JSON.stringify({ x: l, y: d })}
|
|
3524
3532
|
`
|
|
3525
3533
|
));
|
|
3526
3534
|
}
|
|
@@ -3531,17 +3539,17 @@ class Ot extends je {
|
|
|
3531
3539
|
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;
|
|
3532
3540
|
}
|
|
3533
3541
|
}
|
|
3534
|
-
class
|
|
3542
|
+
class Et extends yt {
|
|
3535
3543
|
static create(t) {
|
|
3536
3544
|
var s;
|
|
3537
|
-
const e = this.coordType, r =
|
|
3545
|
+
const e = this.coordType, r = Ri(
|
|
3538
3546
|
de.toElement(t.content),
|
|
3539
3547
|
(s = t.position) == null ? void 0 : s.toGoogle(e),
|
|
3540
3548
|
t.offset,
|
|
3541
3549
|
t.mapPane,
|
|
3542
3550
|
t.zIndex
|
|
3543
3551
|
);
|
|
3544
|
-
return new
|
|
3552
|
+
return new Et(r, e, this);
|
|
3545
3553
|
}
|
|
3546
3554
|
setZIndex(t) {
|
|
3547
3555
|
this.innerOverlay.setZIndex(t);
|
|
@@ -3624,7 +3632,7 @@ var ze;
|
|
|
3624
3632
|
}
|
|
3625
3633
|
i.toBaidu = e;
|
|
3626
3634
|
})(ze || (ze = {}));
|
|
3627
|
-
const
|
|
3635
|
+
const Vs = {
|
|
3628
3636
|
CIRCLE: { baidu: () => BMap_Symbol_SHAPE_CIRCLE, google: () => google.maps.SymbolPath.CIRCLE },
|
|
3629
3637
|
BACKWARD_CLOSED_ARROW: { baidu: () => BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW, google: () => google.maps.SymbolPath.BACKWARD_CLOSED_ARROW },
|
|
3630
3638
|
BACKWARD_OPEN_ARROW: { baidu: () => BMap_Symbol_SHAPE_BACKWARD_OPEN_ARROW, google: () => google.maps.SymbolPath.BACKWARD_OPEN_ARROW },
|
|
@@ -3646,8 +3654,8 @@ class Ce extends je {
|
|
|
3646
3654
|
draggingCursor: t.cursor
|
|
3647
3655
|
}, n = new BMap.Marker(t.position.toBaidu(e), s);
|
|
3648
3656
|
t.zIndex !== void 0 && n.setZIndex(t.zIndex);
|
|
3649
|
-
const a = t.clickable === void 0 ? !0 : t.clickable,
|
|
3650
|
-
return new Ce(n, e, this, { clickable: a, draggable:
|
|
3657
|
+
const a = t.clickable === void 0 ? !0 : t.clickable, h = !!t.draggable;
|
|
3658
|
+
return new Ce(n, e, this, { clickable: a, draggable: h, zIndex: t.zIndex }).visibleOptionInternal(t.visible);
|
|
3651
3659
|
}
|
|
3652
3660
|
getPosition() {
|
|
3653
3661
|
return y.fromBaidu(this.innerOverlay.getPosition(), this.coordType);
|
|
@@ -3698,13 +3706,13 @@ class Ce extends je {
|
|
|
3698
3706
|
return (t = this.innerOverlay.getLabel()) == null ? void 0 : t.__label__;
|
|
3699
3707
|
}
|
|
3700
3708
|
}
|
|
3701
|
-
class
|
|
3709
|
+
class Lt extends yt {
|
|
3702
3710
|
constructor() {
|
|
3703
3711
|
super(...arguments);
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3712
|
+
c(this, "label");
|
|
3713
|
+
c(this, "labelPositionListener");
|
|
3714
|
+
c(this, "labelVisibleListener");
|
|
3715
|
+
c(this, "labelMapChangedListener");
|
|
3708
3716
|
}
|
|
3709
3717
|
static create(e) {
|
|
3710
3718
|
const r = this.coordType, s = e.icon, n = {
|
|
@@ -3721,7 +3729,7 @@ class wt extends mt {
|
|
|
3721
3729
|
// InfoWindow相对marker的position的偏移量, 若不指定, 则偏移到marker的icon的上部中央
|
|
3722
3730
|
anchorPoint: new google.maps.Point(0, 0)
|
|
3723
3731
|
};
|
|
3724
|
-
return new
|
|
3732
|
+
return new Lt(new google.maps.Marker(n), r, this);
|
|
3725
3733
|
}
|
|
3726
3734
|
getPosition() {
|
|
3727
3735
|
return y.fromGoogle(this.innerOverlay.getPosition(), this.coordType);
|
|
@@ -3774,13 +3782,13 @@ class wt extends mt {
|
|
|
3774
3782
|
this.label = void 0, this.labelPositionListener = void 0, this.labelVisibleListener = void 0, this.labelMapChangedListener = void 0;
|
|
3775
3783
|
}
|
|
3776
3784
|
}
|
|
3777
|
-
class
|
|
3785
|
+
class xt extends k {
|
|
3778
3786
|
constructor() {
|
|
3779
3787
|
super(...arguments);
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3788
|
+
c(this, "eventHubDelegate");
|
|
3789
|
+
c(this, "prevPath");
|
|
3790
|
+
c(this, "isDoingSetPath", !1);
|
|
3791
|
+
c(this, "onLineUpdate", () => {
|
|
3784
3792
|
var r;
|
|
3785
3793
|
const e = this.innerOverlay.getPath();
|
|
3786
3794
|
e !== this.prevPath && (this.isDoingSetPath || (r = this.eventHubDelegate) == null || r.notify({
|
|
@@ -3810,10 +3818,10 @@ class Et extends k {
|
|
|
3810
3818
|
});
|
|
3811
3819
|
}
|
|
3812
3820
|
}
|
|
3813
|
-
class
|
|
3821
|
+
class Pt extends xt {
|
|
3814
3822
|
constructor() {
|
|
3815
3823
|
super(...arguments);
|
|
3816
|
-
|
|
3824
|
+
c(this, "pathEditedEventType", "path-edited");
|
|
3817
3825
|
}
|
|
3818
3826
|
static create(e) {
|
|
3819
3827
|
const r = this.coordType, s = new BMap.Polyline(e.path.map((n) => n.toBaidu(r)), {
|
|
@@ -3823,7 +3831,7 @@ class Lt extends Et {
|
|
|
3823
3831
|
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity + k.OPACITY_DELTA : void 0,
|
|
3824
3832
|
strokeWeight: e.strokeWeight
|
|
3825
3833
|
});
|
|
3826
|
-
return new
|
|
3834
|
+
return new Pt(s, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
3827
3835
|
}
|
|
3828
3836
|
getPath() {
|
|
3829
3837
|
return this.innerOverlay.getPath().map((e) => y.fromBaidu(e, this.coordType));
|
|
@@ -3832,11 +3840,11 @@ class Lt extends Et {
|
|
|
3832
3840
|
this.coordType = this.map.coordType, this.setPathInternal(e.map((r) => r.toBaidu(this.coordType)));
|
|
3833
3841
|
}
|
|
3834
3842
|
}
|
|
3835
|
-
class
|
|
3843
|
+
class kt extends Ve {
|
|
3836
3844
|
constructor() {
|
|
3837
3845
|
super(...arguments);
|
|
3838
|
-
|
|
3839
|
-
|
|
3846
|
+
c(this, "pathChangedListeners");
|
|
3847
|
+
c(this, "eventHubDelegate");
|
|
3840
3848
|
}
|
|
3841
3849
|
static create(e) {
|
|
3842
3850
|
const r = this.coordType, s = new google.maps.Polyline({
|
|
@@ -3848,7 +3856,7 @@ class xt extends Ve {
|
|
|
3848
3856
|
strokeWeight: e.strokeWeight,
|
|
3849
3857
|
visible: e.visible
|
|
3850
3858
|
});
|
|
3851
|
-
return new
|
|
3859
|
+
return new kt(s, r, this);
|
|
3852
3860
|
}
|
|
3853
3861
|
setupPathChangedListeners() {
|
|
3854
3862
|
const e = () => {
|
|
@@ -3879,10 +3887,10 @@ class xt extends Ve {
|
|
|
3879
3887
|
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();
|
|
3880
3888
|
}
|
|
3881
3889
|
}
|
|
3882
|
-
class
|
|
3890
|
+
class Bt extends xt {
|
|
3883
3891
|
constructor() {
|
|
3884
3892
|
super(...arguments);
|
|
3885
|
-
|
|
3893
|
+
c(this, "pathEditedEventType", "paths-edited");
|
|
3886
3894
|
}
|
|
3887
3895
|
static create(e) {
|
|
3888
3896
|
const r = this.coordType;
|
|
@@ -3896,7 +3904,7 @@ class Pt extends Et {
|
|
|
3896
3904
|
fillColor: e.fillColor,
|
|
3897
3905
|
fillOpacity: e.fillOpacity != null ? e.fillOpacity + k.OPACITY_DELTA : void 0
|
|
3898
3906
|
});
|
|
3899
|
-
return new
|
|
3907
|
+
return new Bt(n, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
3900
3908
|
}
|
|
3901
3909
|
getPaths() {
|
|
3902
3910
|
return [this.innerOverlay.getPath().map((e) => y.fromBaidu(e, this.coordType))];
|
|
@@ -3905,11 +3913,11 @@ class Pt extends Et {
|
|
|
3905
3913
|
e.length > 1 && console.warn("baidu不支持多path, 只会显示paths[0]"), this.coordType = this.map.coordType, this.setPathInternal((e[0] || []).map((r) => r.toBaidu(this.coordType)));
|
|
3906
3914
|
}
|
|
3907
3915
|
}
|
|
3908
|
-
class
|
|
3916
|
+
class It extends Ve {
|
|
3909
3917
|
constructor() {
|
|
3910
3918
|
super(...arguments);
|
|
3911
|
-
|
|
3912
|
-
|
|
3919
|
+
c(this, "pathChangedListeners");
|
|
3920
|
+
c(this, "eventHubDelegate");
|
|
3913
3921
|
}
|
|
3914
3922
|
static create(e) {
|
|
3915
3923
|
const r = this.coordType, s = new google.maps.Polygon({
|
|
@@ -3923,7 +3931,7 @@ class kt extends Ve {
|
|
|
3923
3931
|
fillOpacity: e.fillOpacity,
|
|
3924
3932
|
visible: e.visible
|
|
3925
3933
|
});
|
|
3926
|
-
return new
|
|
3934
|
+
return new It(s, r, this);
|
|
3927
3935
|
}
|
|
3928
3936
|
setupPathChangedListeners() {
|
|
3929
3937
|
const e = () => {
|
|
@@ -3959,12 +3967,12 @@ class kt extends Ve {
|
|
|
3959
3967
|
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();
|
|
3960
3968
|
}
|
|
3961
3969
|
}
|
|
3962
|
-
class
|
|
3970
|
+
class St extends xt {
|
|
3963
3971
|
constructor(e, r, s, n) {
|
|
3964
3972
|
super(e, r, s, n);
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3973
|
+
c(this, "pathEditedEventType", "bounds-changed");
|
|
3974
|
+
c(this, "isDoingUpdateRectangle", !1);
|
|
3975
|
+
c(this, "onBoundsChanged", ({ originalEvent: e }) => {
|
|
3968
3976
|
if (this.isDoingUpdateRectangle)
|
|
3969
3977
|
return;
|
|
3970
3978
|
const r = e.prevPath ?? [], s = e.path;
|
|
@@ -3974,15 +3982,15 @@ class It extends Et {
|
|
|
3974
3982
|
if (r.length === 4)
|
|
3975
3983
|
if (a > r.length) {
|
|
3976
3984
|
for (let o = 0; o < a; o++)
|
|
3977
|
-
if (r[o] == null || !
|
|
3978
|
-
const l = s[(o - 2 + a) % a],
|
|
3985
|
+
if (r[o] == null || !Vt.equals(s[o], r[o])) {
|
|
3986
|
+
const l = s[(o - 2 + a) % a], d = s[(o - 1 + a) % a], u = s[o], p = s[(o + 1) % a], b = s[(o + 2) % a];
|
|
3979
3987
|
let _;
|
|
3980
|
-
|
|
3988
|
+
d.lat === p.lat ? _ = new BMap.Point(d.lng, u.lat) : d.lng === p.lng ? _ = new BMap.Point(u.lng, d.lat) : _ = u, n = [l, b, _];
|
|
3981
3989
|
break;
|
|
3982
3990
|
}
|
|
3983
3991
|
} else if (a === r.length) {
|
|
3984
3992
|
for (let o = 0; o < a; o++)
|
|
3985
|
-
if (!
|
|
3993
|
+
if (!Vt.equals(s[o], r[o])) {
|
|
3986
3994
|
n = [
|
|
3987
3995
|
s[o],
|
|
3988
3996
|
s[(o + 2) % 4]
|
|
@@ -3991,8 +3999,8 @@ class It extends Et {
|
|
|
3991
3999
|
}
|
|
3992
4000
|
} else
|
|
3993
4001
|
a < r.length;
|
|
3994
|
-
const
|
|
3995
|
-
|
|
4002
|
+
const h = A.fromArray(n.map((o) => y.fromBaidu(o, this.coordType)));
|
|
4003
|
+
h && (this.isDoingUpdateRectangle = !0, this.innerOverlay.setPath(h.toRectArray().map((o) => o.toBaidu(this.coordType))), this.isDoingUpdateRectangle = !1);
|
|
3996
4004
|
}, 0);
|
|
3997
4005
|
});
|
|
3998
4006
|
this.addEventListener("bounds-changed", this.onBoundsChanged);
|
|
@@ -4007,7 +4015,7 @@ class It extends Et {
|
|
|
4007
4015
|
fillColor: e.fillColor,
|
|
4008
4016
|
fillOpacity: e.fillOpacity != null ? e.fillOpacity + k.OPACITY_DELTA : void 0
|
|
4009
4017
|
});
|
|
4010
|
-
return new
|
|
4018
|
+
return new St(s, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
4011
4019
|
}
|
|
4012
4020
|
getBounds() {
|
|
4013
4021
|
return A.fromBaidu(this.innerOverlay.getBounds(), this.coordType);
|
|
@@ -4019,7 +4027,7 @@ class It extends Et {
|
|
|
4019
4027
|
}) : this.setPathInternal(r.map((s) => s.toBaidu(this.coordType)));
|
|
4020
4028
|
}
|
|
4021
4029
|
}
|
|
4022
|
-
class
|
|
4030
|
+
class At extends Ve {
|
|
4023
4031
|
static create(t) {
|
|
4024
4032
|
const e = this.coordType, r = new google.maps.Rectangle({
|
|
4025
4033
|
bounds: t.bounds.toGoogle(e),
|
|
@@ -4032,7 +4040,7 @@ class Bt extends Ve {
|
|
|
4032
4040
|
fillOpacity: t.fillOpacity,
|
|
4033
4041
|
visible: t.visible
|
|
4034
4042
|
});
|
|
4035
|
-
return new
|
|
4043
|
+
return new At(r, e, this);
|
|
4036
4044
|
}
|
|
4037
4045
|
getBounds() {
|
|
4038
4046
|
return A.fromGoogle(this.innerOverlay.getBounds() ?? J.BOUNDS_ZERO, this.coordType);
|
|
@@ -4043,24 +4051,24 @@ class Bt extends Ve {
|
|
|
4043
4051
|
}
|
|
4044
4052
|
}
|
|
4045
4053
|
const ee = 1;
|
|
4046
|
-
class
|
|
4054
|
+
class Di extends ft {
|
|
4047
4055
|
constructor(e, r) {
|
|
4048
4056
|
var s;
|
|
4049
4057
|
super(e);
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4058
|
+
c(this, "buildInMapTypeId2BIMT");
|
|
4059
|
+
c(this, "baiduMapType2BIMT");
|
|
4060
|
+
c(this, "map");
|
|
4061
|
+
c(this, "createLabel", wt.create);
|
|
4062
|
+
c(this, "createCircle", vt.create);
|
|
4063
|
+
c(this, "createPolygon", Bt.create);
|
|
4064
|
+
c(this, "createPolyline", Pt.create);
|
|
4065
|
+
c(this, "createRectangle", St.create);
|
|
4066
|
+
c(this, "createInfoWindow", Tt.create);
|
|
4067
|
+
c(this, "createInfoBox", Ot.create);
|
|
4068
|
+
c(this, "createMarker", Ce.create);
|
|
4069
|
+
c(this, "createMapTypeControl", ct.create);
|
|
4070
|
+
c(this, "createZoomControl", pt.create);
|
|
4071
|
+
c(this, "createScaleControl", dt.create);
|
|
4064
4072
|
this.buildInMapTypeId2BIMT = R.BUILD_IN_MAP_TYPES.getValueMap(S.prototype.getId), this.baiduMapType2BIMT = R.BUILD_IN_MAP_TYPES.getValueMap(S.prototype.asBaiduMapType), this.map = new BMap.Map(e, {
|
|
4065
4073
|
minZoom: r.minZoom && r.minZoom + ee,
|
|
4066
4074
|
maxZoom: r.maxZoom && r.maxZoom + ee,
|
|
@@ -4076,7 +4084,7 @@ class Ri extends gt {
|
|
|
4076
4084
|
});
|
|
4077
4085
|
}
|
|
4078
4086
|
setGestureHandling(e = j.auto) {
|
|
4079
|
-
switch (e === j.auto && (e = this.element.parentElement &&
|
|
4087
|
+
switch (e === j.auto && (e = this.element.parentElement && rt.isScrollable(this.element.parentElement) ? j.cooperative : j.greedy), e) {
|
|
4080
4088
|
case j.cooperative:
|
|
4081
4089
|
this.map.disableScrollWheelZoom(), this.map.enableDragging(), this.map.enableDoubleClickZoom();
|
|
4082
4090
|
break;
|
|
@@ -4194,8 +4202,8 @@ class Ri extends gt {
|
|
|
4194
4202
|
const r = class extends BMap.Control {
|
|
4195
4203
|
constructor() {
|
|
4196
4204
|
super(...arguments);
|
|
4197
|
-
|
|
4198
|
-
|
|
4205
|
+
c(this, "defaultAnchor", $.getBaidu().toValue(e.position));
|
|
4206
|
+
c(this, "defaultOffset", new BMap.Size(0, 0));
|
|
4199
4207
|
}
|
|
4200
4208
|
initialize(n) {
|
|
4201
4209
|
const a = e.onCreateElement();
|
|
@@ -4209,39 +4217,39 @@ class Ri extends gt {
|
|
|
4209
4217
|
e.inner && (oe(e.inner instanceof BMap.Control, `control.inner(${e.inner})需要是BMap.Control`), this.map.removeControl(e.inner));
|
|
4210
4218
|
}
|
|
4211
4219
|
createMarkerClusterer(e) {
|
|
4212
|
-
return new
|
|
4220
|
+
return new Mi(this, e);
|
|
4213
4221
|
}
|
|
4214
4222
|
createAutocomplete(e) {
|
|
4215
|
-
return new
|
|
4223
|
+
return new yi(this, e);
|
|
4216
4224
|
}
|
|
4217
4225
|
createSearchBox(e) {
|
|
4218
|
-
return new
|
|
4226
|
+
return new Li(this, e);
|
|
4219
4227
|
}
|
|
4220
4228
|
createPlacesService(e) {
|
|
4221
|
-
return new
|
|
4229
|
+
return new wi(this, e);
|
|
4222
4230
|
}
|
|
4223
4231
|
createMapUrls(e) {
|
|
4224
|
-
return new
|
|
4232
|
+
return new Ie(e);
|
|
4225
4233
|
}
|
|
4226
4234
|
}
|
|
4227
|
-
class
|
|
4235
|
+
class zi extends ft {
|
|
4228
4236
|
constructor(e, r) {
|
|
4229
4237
|
var n;
|
|
4230
4238
|
super(e);
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4239
|
+
c(this, "buildInMapTypeId2BIMT");
|
|
4240
|
+
c(this, "googleMapTypeId2BIMT");
|
|
4241
|
+
c(this, "map");
|
|
4242
|
+
c(this, "createLabel", Et.create);
|
|
4243
|
+
c(this, "createCircle", _t.create);
|
|
4244
|
+
c(this, "createPolygon", It.create);
|
|
4245
|
+
c(this, "createPolyline", kt.create);
|
|
4246
|
+
c(this, "createRectangle", At.create);
|
|
4247
|
+
c(this, "createInfoWindow", Mt.create);
|
|
4248
|
+
c(this, "createInfoBox", Ct.create);
|
|
4249
|
+
c(this, "createMarker", Lt.create);
|
|
4250
|
+
c(this, "createMapTypeControl", ke.create);
|
|
4251
|
+
c(this, "createZoomControl", gt.create);
|
|
4252
|
+
c(this, "createScaleControl", ut.create);
|
|
4245
4253
|
this.mapOptions = r, this.buildInMapTypeId2BIMT = R.BUILD_IN_MAP_TYPES.getValueMap(S.prototype.getId), this.googleMapTypeId2BIMT = R.BUILD_IN_MAP_TYPES.getValueMap(S.prototype.getGoogleMapTypeId);
|
|
4246
4254
|
const s = r.buildInMapTypeId && this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId);
|
|
4247
4255
|
this.map = new google.maps.Map(e, {
|
|
@@ -4271,20 +4279,20 @@ class $i extends gt {
|
|
|
4271
4279
|
const r = this.innerMap.getProjection(), s = this.innerMap.getBounds();
|
|
4272
4280
|
if (r == null || s == null)
|
|
4273
4281
|
return y.ZERO;
|
|
4274
|
-
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()),
|
|
4275
|
-
if (n == null || a == null ||
|
|
4282
|
+
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()), h = this.innerMap.getZoom();
|
|
4283
|
+
if (n == null || a == null || h == null)
|
|
4276
4284
|
return y.ZERO;
|
|
4277
|
-
const o = Math.pow(2,
|
|
4285
|
+
const o = Math.pow(2, h), l = new google.maps.Point(e.x / o + n.x, e.y / o + a.y);
|
|
4278
4286
|
return y.fromGoogle(r.fromPointToLatLng(l) ?? J.LATLNG_ZERO, this.coordType);
|
|
4279
4287
|
}
|
|
4280
4288
|
fromLatLngToContainerPoint(e) {
|
|
4281
4289
|
const r = this.innerMap.getProjection(), s = this.innerMap.getBounds();
|
|
4282
4290
|
if (r == null || s == null)
|
|
4283
4291
|
return X.ZERO;
|
|
4284
|
-
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()),
|
|
4285
|
-
if (n == null || a == null ||
|
|
4292
|
+
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()), h = this.innerMap.getZoom();
|
|
4293
|
+
if (n == null || a == null || h == null)
|
|
4286
4294
|
return X.ZERO;
|
|
4287
|
-
const o = Math.pow(2,
|
|
4295
|
+
const o = Math.pow(2, h), l = r.fromLatLngToPoint(e.toGoogle(this.coordType));
|
|
4288
4296
|
return l == null ? X.ZERO : { x: (l.x - n.x) * o, y: (l.y - a.y) * o };
|
|
4289
4297
|
}
|
|
4290
4298
|
setDefaultCursor(e) {
|
|
@@ -4370,29 +4378,29 @@ class $i extends gt {
|
|
|
4370
4378
|
}
|
|
4371
4379
|
}
|
|
4372
4380
|
createMarkerClusterer(e) {
|
|
4373
|
-
return new
|
|
4381
|
+
return new Oi(this, e);
|
|
4374
4382
|
}
|
|
4375
4383
|
createAutocomplete(e) {
|
|
4376
|
-
return new
|
|
4384
|
+
return new fi(this, e);
|
|
4377
4385
|
}
|
|
4378
4386
|
createSearchBox(e) {
|
|
4379
|
-
return new
|
|
4387
|
+
return new Ei(this, e);
|
|
4380
4388
|
}
|
|
4381
4389
|
createPlacesService(e) {
|
|
4382
|
-
return new
|
|
4390
|
+
return new Ci(this, e);
|
|
4383
4391
|
}
|
|
4384
4392
|
createMapUrls(e) {
|
|
4385
|
-
return new
|
|
4393
|
+
return new Be(e);
|
|
4386
4394
|
}
|
|
4387
4395
|
}
|
|
4388
|
-
class
|
|
4396
|
+
class Ni extends ft {
|
|
4389
4397
|
constructor(e, r) {
|
|
4390
4398
|
var a;
|
|
4391
4399
|
super(e);
|
|
4392
|
-
|
|
4393
|
-
|
|
4400
|
+
c(this, "map");
|
|
4401
|
+
c(this, "defaultLayers");
|
|
4394
4402
|
this.mapOptions = r;
|
|
4395
|
-
const s =
|
|
4403
|
+
const s = ir().here;
|
|
4396
4404
|
Ae.includes(s.version) || C(`不支持${s.version}, HereMap当前只支持如下版本: ${Ae}`);
|
|
4397
4405
|
const n = new H.service.Platform({
|
|
4398
4406
|
app_id: s.key.split(",")[0],
|
|
@@ -4407,7 +4415,7 @@ class Di extends gt {
|
|
|
4407
4415
|
return this.map;
|
|
4408
4416
|
}
|
|
4409
4417
|
get coordType() {
|
|
4410
|
-
return
|
|
4418
|
+
return I.wgs84;
|
|
4411
4419
|
}
|
|
4412
4420
|
getCenter() {
|
|
4413
4421
|
return y.fromHere(this.map.getCenter(), this.coordType);
|
|
@@ -4537,34 +4545,34 @@ class Di extends gt {
|
|
|
4537
4545
|
throw new Error("Method not implemented.");
|
|
4538
4546
|
}
|
|
4539
4547
|
}
|
|
4540
|
-
var G = /* @__PURE__ */ ((i) => (i.google = "google", i.baidu = "baidu", i.here = "here", i))(G || {}),
|
|
4548
|
+
var G = /* @__PURE__ */ ((i) => (i.google = "google", i.baidu = "baidu", i.here = "here", i))(G || {}), st;
|
|
4541
4549
|
((i) => {
|
|
4542
4550
|
function t(e, r, s) {
|
|
4543
|
-
const n =
|
|
4551
|
+
const n = it.create(s);
|
|
4544
4552
|
switch (e) {
|
|
4545
4553
|
case "google":
|
|
4546
|
-
return new
|
|
4554
|
+
return new zi(r, n);
|
|
4547
4555
|
case "baidu":
|
|
4548
|
-
return new Ri(r, n);
|
|
4549
|
-
case "here":
|
|
4550
4556
|
return new Di(r, n);
|
|
4557
|
+
case "here":
|
|
4558
|
+
return new Ni(r, n);
|
|
4551
4559
|
}
|
|
4552
4560
|
}
|
|
4553
4561
|
i.createMap = t;
|
|
4554
|
-
})(
|
|
4555
|
-
function
|
|
4556
|
-
const e = window, r =
|
|
4562
|
+
})(st || (st = {}));
|
|
4563
|
+
function Gi({ type: i, config: t }) {
|
|
4564
|
+
const e = window, r = Zi(i);
|
|
4557
4565
|
if (e[r])
|
|
4558
4566
|
return Promise.resolve();
|
|
4559
4567
|
switch (i !== G.here && !t.key && C(`请先配置${i}地图的key`), i) {
|
|
4560
4568
|
case G.google:
|
|
4561
|
-
return {}.VITE_FALSE ? (
|
|
4569
|
+
return {}.VITE_FALSE ? (pi({
|
|
4562
4570
|
key: t.key,
|
|
4563
4571
|
v: "3.52"
|
|
4564
4572
|
// v: config.version,
|
|
4565
|
-
}), google.maps.importLibrary("core")) :
|
|
4573
|
+
}), google.maps.importLibrary("core")) : Ft(`https://maps.googleapis.com/maps/api/js?key=${t.key}&language=${t.language}&v=${t.version}&libraries=${t.libraries.join(",")}`);
|
|
4566
4574
|
case G.baidu:
|
|
4567
|
-
return
|
|
4575
|
+
return Ft(`https://api.map.baidu.com/api?v=${t.version}&ak=${t.key}`);
|
|
4568
4576
|
case G.here:
|
|
4569
4577
|
return ge(pe("core", t.version)).then(() => Promise.all([
|
|
4570
4578
|
// 其他大多数模块都可以同时载入
|
|
@@ -4580,7 +4588,7 @@ function zi({ type: i, config: t }) {
|
|
|
4580
4588
|
function pe(i, t = Ae[0]) {
|
|
4581
4589
|
return `https://js.api.here.com/v3/${t}/mapsjs-${i}.js`;
|
|
4582
4590
|
}
|
|
4583
|
-
function
|
|
4591
|
+
function Zi(i) {
|
|
4584
4592
|
switch (i) {
|
|
4585
4593
|
case G.google:
|
|
4586
4594
|
return "google";
|
|
@@ -4590,10 +4598,10 @@ function Ni(i) {
|
|
|
4590
4598
|
return "H";
|
|
4591
4599
|
}
|
|
4592
4600
|
}
|
|
4593
|
-
let
|
|
4594
|
-
function
|
|
4601
|
+
let Wi = 0;
|
|
4602
|
+
function Ft(i, t = "callback") {
|
|
4595
4603
|
return new Promise((e, r) => {
|
|
4596
|
-
const s = `__callback${
|
|
4604
|
+
const s = `__callback${Wi++}`;
|
|
4597
4605
|
window[s] = e;
|
|
4598
4606
|
const n = document.createElement("script");
|
|
4599
4607
|
n.src = `${i}&${t}=${s}`, n.onerror = r, document.body.appendChild(n);
|
|
@@ -4612,7 +4620,7 @@ function Z(i, t) {
|
|
|
4612
4620
|
validator: (e) => Object.values(i).includes(e)
|
|
4613
4621
|
};
|
|
4614
4622
|
}
|
|
4615
|
-
function
|
|
4623
|
+
function Hi(i, t) {
|
|
4616
4624
|
return {
|
|
4617
4625
|
type: String,
|
|
4618
4626
|
default: t,
|
|
@@ -4631,7 +4639,7 @@ function m(i, t) {
|
|
|
4631
4639
|
default: t
|
|
4632
4640
|
};
|
|
4633
4641
|
}
|
|
4634
|
-
function
|
|
4642
|
+
function Fs(i) {
|
|
4635
4643
|
const t = {};
|
|
4636
4644
|
return Object.entries(i).forEach(([e, r]) => {
|
|
4637
4645
|
const s = `__${e}`;
|
|
@@ -4654,17 +4662,17 @@ const me = {
|
|
|
4654
4662
|
get: ve,
|
|
4655
4663
|
set: ve
|
|
4656
4664
|
};
|
|
4657
|
-
function
|
|
4665
|
+
function ji(i) {
|
|
4658
4666
|
return Object.keys(i).forEach((t) => {
|
|
4659
4667
|
const e = i[t];
|
|
4660
4668
|
let r = !1;
|
|
4661
4669
|
typeof e == "function" ? (me.get = e, me.set = ve, r = !0) : typeof e == "object" && typeof e.get == "function" && (me.get = e.get, me.set = e.set, r = !0), r && (i[t] = Object.defineProperty(i, t, me));
|
|
4662
4670
|
}), i;
|
|
4663
4671
|
}
|
|
4664
|
-
function
|
|
4665
|
-
return
|
|
4672
|
+
function Us(i) {
|
|
4673
|
+
return ji(i);
|
|
4666
4674
|
}
|
|
4667
|
-
function
|
|
4675
|
+
function Er() {
|
|
4668
4676
|
return Je();
|
|
4669
4677
|
}
|
|
4670
4678
|
function Pe(i, t) {
|
|
@@ -4673,12 +4681,12 @@ function Pe(i, t) {
|
|
|
4673
4681
|
for (const r of e)
|
|
4674
4682
|
r.call(i);
|
|
4675
4683
|
}
|
|
4676
|
-
function
|
|
4684
|
+
function Ys(i, t) {
|
|
4677
4685
|
for (const e of i)
|
|
4678
4686
|
if (e.$options.name === t.name)
|
|
4679
4687
|
return e;
|
|
4680
4688
|
}
|
|
4681
|
-
function
|
|
4689
|
+
function qs(i, t) {
|
|
4682
4690
|
if (!i.default)
|
|
4683
4691
|
return;
|
|
4684
4692
|
const e = i.default();
|
|
@@ -4686,7 +4694,7 @@ function Us(i, t) {
|
|
|
4686
4694
|
if ((r == null ? void 0 : r.type).name === t.name)
|
|
4687
4695
|
return r;
|
|
4688
4696
|
}
|
|
4689
|
-
function
|
|
4697
|
+
function Vi(i, t) {
|
|
4690
4698
|
const e = {}, r = {}, s = {};
|
|
4691
4699
|
return Object.keys(i).forEach((n) => {
|
|
4692
4700
|
n.startsWith("on") ? e[Te.pascal2kebab(n.substring(2))] = i[n] : r[n] = i[n];
|
|
@@ -4702,12 +4710,12 @@ function Hi(i, t) {
|
|
|
4702
4710
|
};
|
|
4703
4711
|
}
|
|
4704
4712
|
function Y(i, t) {
|
|
4705
|
-
return
|
|
4713
|
+
return Yt(() => Vi(i, t));
|
|
4706
4714
|
}
|
|
4707
4715
|
function L() {
|
|
4708
4716
|
return Function;
|
|
4709
4717
|
}
|
|
4710
|
-
const
|
|
4718
|
+
const Ks = () => {
|
|
4711
4719
|
let i, t;
|
|
4712
4720
|
function e(s) {
|
|
4713
4721
|
console.log(s), i = s && s.type, t = Date.now();
|
|
@@ -4716,8 +4724,8 @@ const Ys = () => {
|
|
|
4716
4724
|
((s && s.type) !== i || Date.now() - (t ?? 0) > 1e3) && e(s);
|
|
4717
4725
|
}
|
|
4718
4726
|
return { eventLog: e, eventLogLess: r };
|
|
4719
|
-
},
|
|
4720
|
-
inject: [
|
|
4727
|
+
}, Rt = "$map", we = "onCreate", Ee = "onDestroy", P = w({
|
|
4728
|
+
inject: [Rt],
|
|
4721
4729
|
mounted() {
|
|
4722
4730
|
Pe(this, we);
|
|
4723
4731
|
},
|
|
@@ -4730,13 +4738,13 @@ const Ys = () => {
|
|
|
4730
4738
|
}
|
|
4731
4739
|
},
|
|
4732
4740
|
render() {
|
|
4733
|
-
return
|
|
4741
|
+
return Er();
|
|
4734
4742
|
}
|
|
4735
|
-
}),
|
|
4743
|
+
}), Fi = w({
|
|
4736
4744
|
name: "tg-map",
|
|
4737
4745
|
provide() {
|
|
4738
4746
|
return {
|
|
4739
|
-
[
|
|
4747
|
+
[Rt]: Yt(() => this.map)
|
|
4740
4748
|
};
|
|
4741
4749
|
},
|
|
4742
4750
|
inheritAttrs: !1,
|
|
@@ -4773,12 +4781,12 @@ const Ys = () => {
|
|
|
4773
4781
|
* 该属性不会响应式更新, 要让它立即生效, 请参考{@link file://./../views/map/InfoDemo.vue#L3}
|
|
4774
4782
|
* @see MapOptions.infoWindowMode
|
|
4775
4783
|
*/
|
|
4776
|
-
infoWindowMode:
|
|
4784
|
+
infoWindowMode: Hi(ki),
|
|
4777
4785
|
gestureHandling: Z(j),
|
|
4778
4786
|
minZoom: m(Number),
|
|
4779
4787
|
maxZoom: m(Number),
|
|
4780
4788
|
mapStyle: m(Object),
|
|
4781
|
-
mapTypeId: Z(
|
|
4789
|
+
mapTypeId: Z(lr),
|
|
4782
4790
|
/** 地图类型对象, 优先级比mapTypeId高 */
|
|
4783
4791
|
mapType: m(Object),
|
|
4784
4792
|
hideLogo: m(Boolean),
|
|
@@ -4839,7 +4847,7 @@ const Ys = () => {
|
|
|
4839
4847
|
async mounted() {
|
|
4840
4848
|
const i = this.type;
|
|
4841
4849
|
try {
|
|
4842
|
-
await
|
|
4850
|
+
await Gi({ type: i, config: ir()[i] });
|
|
4843
4851
|
} catch (s) {
|
|
4844
4852
|
this.$emit("error", s);
|
|
4845
4853
|
return;
|
|
@@ -4848,7 +4856,7 @@ const Ys = () => {
|
|
|
4848
4856
|
console.warn(`tg-map(type=${i})已销毁, 不需要继续执行`);
|
|
4849
4857
|
return;
|
|
4850
4858
|
}
|
|
4851
|
-
const t =
|
|
4859
|
+
const t = st.createMap(
|
|
4852
4860
|
i,
|
|
4853
4861
|
this.$refs.map,
|
|
4854
4862
|
/* options: */
|
|
@@ -4863,17 +4871,17 @@ const Ys = () => {
|
|
|
4863
4871
|
buildInMapTypeId: this.mapTypeId
|
|
4864
4872
|
}
|
|
4865
4873
|
);
|
|
4866
|
-
if (this.map =
|
|
4874
|
+
if (this.map = Ar(t), this.mapType && t.setMapType(this.mapType), "ready" in this.attrs.listeners && console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"), U(
|
|
4867
4875
|
this.attrs.listeners,
|
|
4868
4876
|
t,
|
|
4869
4877
|
/* excludes: */
|
|
4870
4878
|
["load"]
|
|
4871
|
-
), this.$emit("load", t),
|
|
4879
|
+
), this.$emit("load", t), qt([
|
|
4872
4880
|
() => this.zoom,
|
|
4873
4881
|
() => this.center
|
|
4874
4882
|
//
|
|
4875
|
-
], ([s, n], [a,
|
|
4876
|
-
s !== a && t.setZoom(s), n !==
|
|
4883
|
+
], ([s, n], [a, h]) => {
|
|
4884
|
+
s !== a && t.setZoom(s), n !== h && (t.getCenter().equals(n) || t.setCenter(n));
|
|
4877
4885
|
}), "update:center" in this.attrs.listenerProps) {
|
|
4878
4886
|
const s = () => this.$emit("update:center", t.getCenter());
|
|
4879
4887
|
t.addEventListener("center-changed", () => {
|
|
@@ -4902,9 +4910,9 @@ const q = (i, t) => {
|
|
|
4902
4910
|
e[r] = s;
|
|
4903
4911
|
return e;
|
|
4904
4912
|
};
|
|
4905
|
-
function
|
|
4913
|
+
function Ui(i, t, e, r, s, n) {
|
|
4906
4914
|
return V(), F("div", ue({ class: "tg-map" }, i.attrs.binds), [
|
|
4907
|
-
|
|
4915
|
+
Rr("div", {
|
|
4908
4916
|
ref: "map",
|
|
4909
4917
|
class: Ze({
|
|
4910
4918
|
"tg-map__map": !0,
|
|
@@ -4916,8 +4924,8 @@ function Vi(i, t, e, r, s, n) {
|
|
|
4916
4924
|
W(i.$slots, "overlay")
|
|
4917
4925
|
], 16);
|
|
4918
4926
|
}
|
|
4919
|
-
const
|
|
4920
|
-
function
|
|
4927
|
+
const Le = /* @__PURE__ */ q(Fi, [["render", Ui]]);
|
|
4928
|
+
function Yi(i) {
|
|
4921
4929
|
if (i == null)
|
|
4922
4930
|
return;
|
|
4923
4931
|
let t;
|
|
@@ -4928,7 +4936,7 @@ function Fi(i) {
|
|
|
4928
4936
|
t = i;
|
|
4929
4937
|
return `${t}px`;
|
|
4930
4938
|
}
|
|
4931
|
-
const
|
|
4939
|
+
const qi = w({
|
|
4932
4940
|
name: "tg-map-widget",
|
|
4933
4941
|
props: {
|
|
4934
4942
|
left: {
|
|
@@ -4954,22 +4962,22 @@ const Ui = w({
|
|
|
4954
4962
|
}
|
|
4955
4963
|
},
|
|
4956
4964
|
methods: {
|
|
4957
|
-
dimen:
|
|
4965
|
+
dimen: Yi
|
|
4958
4966
|
}
|
|
4959
4967
|
});
|
|
4960
|
-
function
|
|
4968
|
+
function Ki(i, t, e, r, s, n) {
|
|
4961
4969
|
return V(), F("div", {
|
|
4962
4970
|
class: Ze(i.$options.name),
|
|
4963
|
-
style:
|
|
4971
|
+
style: $r({ left: i.dimen(i.left), top: i.dimen(i.topValue), right: i.dimen(i.right), bottom: i.dimen(i.bottom) })
|
|
4964
4972
|
}, [
|
|
4965
4973
|
W(i.$slots, "default")
|
|
4966
4974
|
], 6);
|
|
4967
4975
|
}
|
|
4968
|
-
const
|
|
4976
|
+
const Xi = /* @__PURE__ */ q(qi, [["render", Ki]]), Ji = w({
|
|
4969
4977
|
name: "tg-custom-control",
|
|
4970
4978
|
mixins: [P],
|
|
4971
4979
|
props: {
|
|
4972
|
-
position: Z(
|
|
4980
|
+
position: Z(B, B.RIGHT_BOTTOM)
|
|
4973
4981
|
},
|
|
4974
4982
|
setup() {
|
|
4975
4983
|
return {
|
|
@@ -4982,8 +4990,8 @@ const qi = /* @__PURE__ */ q(Ui, [["render", Yi]]), Ki = w({
|
|
|
4982
4990
|
}
|
|
4983
4991
|
},
|
|
4984
4992
|
onCreate() {
|
|
4985
|
-
|
|
4986
|
-
const { $el: i } = this, t = class extends
|
|
4993
|
+
Jt(this.$parent, Le) || console.warn("请将tg-custom-control放到tg-map中");
|
|
4994
|
+
const { $el: i } = this, t = class extends di {
|
|
4987
4995
|
onCreateElement() {
|
|
4988
4996
|
return i;
|
|
4989
4997
|
}
|
|
@@ -4994,19 +5002,19 @@ const qi = /* @__PURE__ */ q(Ui, [["render", Yi]]), Ki = w({
|
|
|
4994
5002
|
this.$map.removeCustomControl(this.control);
|
|
4995
5003
|
}
|
|
4996
5004
|
});
|
|
4997
|
-
function
|
|
5005
|
+
function Qi(i, t, e, r, s, n) {
|
|
4998
5006
|
return V(), F("div", {
|
|
4999
5007
|
class: Ze(i.$options.name)
|
|
5000
5008
|
}, [
|
|
5001
5009
|
W(i.$slots, "default")
|
|
5002
5010
|
], 2);
|
|
5003
5011
|
}
|
|
5004
|
-
const
|
|
5012
|
+
const es = /* @__PURE__ */ q(Ji, [["render", Qi]]), ts = w({
|
|
5005
5013
|
name: "tg-map-type-control",
|
|
5006
5014
|
mixins: [P],
|
|
5007
5015
|
props: {
|
|
5008
|
-
position: Z(
|
|
5009
|
-
type: Z(
|
|
5016
|
+
position: Z(B, B.TOP_LEFT),
|
|
5017
|
+
type: Z(hr),
|
|
5010
5018
|
mapTypes: m(Array)
|
|
5011
5019
|
},
|
|
5012
5020
|
setup() {
|
|
@@ -5034,11 +5042,11 @@ const Ji = /* @__PURE__ */ q(Ki, [["render", Xi]]), Qi = w({
|
|
|
5034
5042
|
onDestroy() {
|
|
5035
5043
|
this.$map.removeControl(this.control);
|
|
5036
5044
|
}
|
|
5037
|
-
}),
|
|
5045
|
+
}), rs = w({
|
|
5038
5046
|
name: "tg-scale-control",
|
|
5039
5047
|
mixins: [P],
|
|
5040
5048
|
props: {
|
|
5041
|
-
position: Z(
|
|
5049
|
+
position: Z(B, B.BOTTOM_RIGHT)
|
|
5042
5050
|
},
|
|
5043
5051
|
setup() {
|
|
5044
5052
|
return {
|
|
@@ -5057,20 +5065,20 @@ const Ji = /* @__PURE__ */ q(Ki, [["render", Xi]]), Qi = w({
|
|
|
5057
5065
|
this.$map.removeControl(this.control);
|
|
5058
5066
|
}
|
|
5059
5067
|
});
|
|
5060
|
-
function
|
|
5068
|
+
function Lr() {
|
|
5061
5069
|
var e;
|
|
5062
|
-
const i = (e =
|
|
5070
|
+
const i = (e = Dr()) == null ? void 0 : e.type;
|
|
5063
5071
|
let t = (i == null ? void 0 : i.name) ?? (i == null ? void 0 : i.__name);
|
|
5064
5072
|
if (!t) {
|
|
5065
5073
|
const r = i == null ? void 0 : i.__file;
|
|
5066
|
-
r && (t =
|
|
5074
|
+
r && (t = Si.basename(r, ".vue"));
|
|
5067
5075
|
}
|
|
5068
5076
|
return t;
|
|
5069
5077
|
}
|
|
5070
|
-
function
|
|
5071
|
-
const i =
|
|
5078
|
+
function is() {
|
|
5079
|
+
const i = zr(Rt);
|
|
5072
5080
|
let t, e;
|
|
5073
|
-
return i == null && C(`<${
|
|
5081
|
+
return i == null && C(`<${Lr() || "unknown"}>必须作为<tg-map>的子代组件`), {
|
|
5074
5082
|
mapRef: i,
|
|
5075
5083
|
/** 读取map对象, 只要放在<tg-map>里面的组件(除#overlay插槽外)都能够立即读取到map对象 */
|
|
5076
5084
|
get map() {
|
|
@@ -5078,11 +5086,11 @@ function ts() {
|
|
|
5078
5086
|
},
|
|
5079
5087
|
/** 地图元素创建回调 */
|
|
5080
5088
|
[we](r) {
|
|
5081
|
-
|
|
5089
|
+
Nr(r), t && C(`${we}只能调用一次`), t = r;
|
|
5082
5090
|
},
|
|
5083
5091
|
/** 地图元素销毁回调 */
|
|
5084
5092
|
[Ee](r) {
|
|
5085
|
-
|
|
5093
|
+
Gr(r), e && C(`${Ee}只能调用一次`), e = r;
|
|
5086
5094
|
},
|
|
5087
5095
|
/** 重新创建地图元素 */
|
|
5088
5096
|
recreate() {
|
|
@@ -5090,23 +5098,23 @@ function ts() {
|
|
|
5090
5098
|
}
|
|
5091
5099
|
};
|
|
5092
5100
|
}
|
|
5093
|
-
const
|
|
5101
|
+
const ss = w({
|
|
5094
5102
|
name: "tg-zoom-control",
|
|
5095
5103
|
props: {
|
|
5096
|
-
position: Z(
|
|
5104
|
+
position: Z(B, B.RIGHT_BOTTOM)
|
|
5097
5105
|
},
|
|
5098
5106
|
setup(i) {
|
|
5099
5107
|
let t = void 0;
|
|
5100
|
-
const { map: e, onCreate: r, onDestroy: s } =
|
|
5108
|
+
const { map: e, onCreate: r, onDestroy: s } = is();
|
|
5101
5109
|
return r(() => {
|
|
5102
5110
|
t = e.createZoomControl(i), e.addControl(t);
|
|
5103
5111
|
}), s(() => {
|
|
5104
5112
|
e.removeControl(t);
|
|
5105
|
-
}),
|
|
5113
|
+
}), qt(() => i.position, (n) => {
|
|
5106
5114
|
t.setPosition(n);
|
|
5107
|
-
}),
|
|
5115
|
+
}), Er;
|
|
5108
5116
|
}
|
|
5109
|
-
}),
|
|
5117
|
+
}), ns = w({
|
|
5110
5118
|
name: "tg-marker-clusterer",
|
|
5111
5119
|
mixins: [P],
|
|
5112
5120
|
// markers从this.$children中读取, 故需要省略(Omit)
|
|
@@ -5170,14 +5178,14 @@ const rs = w({
|
|
|
5170
5178
|
}
|
|
5171
5179
|
}
|
|
5172
5180
|
});
|
|
5173
|
-
function
|
|
5181
|
+
function os(i, t, e, r, s, n) {
|
|
5174
5182
|
return V(), F("div", {
|
|
5175
5183
|
class: Ze(i.$options.name)
|
|
5176
5184
|
}, [
|
|
5177
5185
|
W(i.$slots, "default")
|
|
5178
5186
|
], 2);
|
|
5179
5187
|
}
|
|
5180
|
-
const
|
|
5188
|
+
const xr = /* @__PURE__ */ q(ns, [["render", os]]), as = w({
|
|
5181
5189
|
name: "tg-traffic-layer",
|
|
5182
5190
|
mixins: [P],
|
|
5183
5191
|
// 请直接使用v-if来控制它的显隐
|
|
@@ -5190,12 +5198,12 @@ const Er = /* @__PURE__ */ q(is, [["render", ss]]), ns = w({
|
|
|
5190
5198
|
},
|
|
5191
5199
|
watch: {},
|
|
5192
5200
|
onCreate() {
|
|
5193
|
-
this.layer = new
|
|
5201
|
+
this.layer = new ui(), this.$map.addLayer(this.layer);
|
|
5194
5202
|
},
|
|
5195
5203
|
onDestroy() {
|
|
5196
5204
|
this.$map.removeLayer(this.layer);
|
|
5197
5205
|
}
|
|
5198
|
-
}),
|
|
5206
|
+
}), ls = w({
|
|
5199
5207
|
name: "tg-circle",
|
|
5200
5208
|
mixins: [P],
|
|
5201
5209
|
inheritAttrs: !1,
|
|
@@ -5275,7 +5283,7 @@ const Er = /* @__PURE__ */ q(is, [["render", ss]]), ns = w({
|
|
|
5275
5283
|
this.$map.removeOverlay(this.overlay);
|
|
5276
5284
|
}
|
|
5277
5285
|
});
|
|
5278
|
-
class
|
|
5286
|
+
class hs extends Ai {
|
|
5279
5287
|
constructor(t, e, r, s) {
|
|
5280
5288
|
super(t, e), this.content = r, this.position = s;
|
|
5281
5289
|
}
|
|
@@ -5290,7 +5298,7 @@ class as extends Bi {
|
|
|
5290
5298
|
this.position = t, this.draw();
|
|
5291
5299
|
}
|
|
5292
5300
|
}
|
|
5293
|
-
const
|
|
5301
|
+
const cs = w({
|
|
5294
5302
|
name: "tg-element-overlay",
|
|
5295
5303
|
mixins: [P],
|
|
5296
5304
|
props: {
|
|
@@ -5316,20 +5324,20 @@ const ls = w({
|
|
|
5316
5324
|
}
|
|
5317
5325
|
},
|
|
5318
5326
|
onCreate() {
|
|
5319
|
-
this.overlay = new
|
|
5327
|
+
this.overlay = new hs(this.$map, this, this.content(), this.position), this.$map.addElementOverlay(this.overlay);
|
|
5320
5328
|
},
|
|
5321
5329
|
onDestroy() {
|
|
5322
5330
|
this.$map.removeElementOverlay(this.overlay);
|
|
5323
5331
|
}
|
|
5324
5332
|
});
|
|
5325
|
-
function
|
|
5333
|
+
function ds(i, t, e, r, s, n) {
|
|
5326
5334
|
return V(), F("div", ue({
|
|
5327
5335
|
class: i.$options.name
|
|
5328
5336
|
}, i.$attrs), [
|
|
5329
5337
|
W(i.$slots, "default")
|
|
5330
5338
|
], 16);
|
|
5331
5339
|
}
|
|
5332
|
-
const
|
|
5340
|
+
const us = /* @__PURE__ */ q(cs, [["render", ds]]), ps = w({
|
|
5333
5341
|
name: "tg-marker",
|
|
5334
5342
|
mixins: [P],
|
|
5335
5343
|
inheritAttrs: !1,
|
|
@@ -5399,7 +5407,7 @@ const cs = /* @__PURE__ */ q(ls, [["render", hs]]), ds = w({
|
|
|
5399
5407
|
},
|
|
5400
5408
|
methods: {
|
|
5401
5409
|
$clusterer() {
|
|
5402
|
-
return
|
|
5410
|
+
return Jt(this.$parent, xr);
|
|
5403
5411
|
},
|
|
5404
5412
|
onAddLabel(i) {
|
|
5405
5413
|
this.label = i, this.marker && this.marker.setLabel(i.overlay);
|
|
@@ -5418,14 +5426,14 @@ const cs = /* @__PURE__ */ q(ls, [["render", hs]]), ds = w({
|
|
|
5418
5426
|
}
|
|
5419
5427
|
}
|
|
5420
5428
|
});
|
|
5421
|
-
function
|
|
5429
|
+
function gs(i, t, e, r, s, n) {
|
|
5422
5430
|
return V(), F("div", ue({
|
|
5423
5431
|
class: i.$options.name
|
|
5424
5432
|
}, i.attrs.binds), [
|
|
5425
5433
|
W(i.$slots, "default")
|
|
5426
5434
|
], 16);
|
|
5427
5435
|
}
|
|
5428
|
-
const Fe = /* @__PURE__ */ q(
|
|
5436
|
+
const Fe = /* @__PURE__ */ q(ps, [["render", gs]]), ms = w({
|
|
5429
5437
|
name: "tg-info-box",
|
|
5430
5438
|
mixins: [P],
|
|
5431
5439
|
inheritAttrs: !1,
|
|
@@ -5488,7 +5496,7 @@ const Fe = /* @__PURE__ */ q(ds, [["render", us]]), ps = w({
|
|
|
5488
5496
|
return this.$el;
|
|
5489
5497
|
},
|
|
5490
5498
|
$marker() {
|
|
5491
|
-
return
|
|
5499
|
+
return ot(Fe, this.$parent, Le);
|
|
5492
5500
|
},
|
|
5493
5501
|
open(i) {
|
|
5494
5502
|
this.overlay.open(i);
|
|
@@ -5498,14 +5506,14 @@ const Fe = /* @__PURE__ */ q(ds, [["render", us]]), ps = w({
|
|
|
5498
5506
|
}
|
|
5499
5507
|
}
|
|
5500
5508
|
});
|
|
5501
|
-
function
|
|
5509
|
+
function fs(i, t, e, r, s, n) {
|
|
5502
5510
|
return V(), F("div", ue({
|
|
5503
5511
|
class: i.$options.name
|
|
5504
5512
|
}, i.attrs.binds), [
|
|
5505
5513
|
W(i.$slots, "default")
|
|
5506
5514
|
], 16);
|
|
5507
5515
|
}
|
|
5508
|
-
const
|
|
5516
|
+
const ys = /* @__PURE__ */ q(ms, [["render", fs]]), vs = w({
|
|
5509
5517
|
name: "tg-info-window",
|
|
5510
5518
|
mixins: [P],
|
|
5511
5519
|
inheritAttrs: !1,
|
|
@@ -5546,7 +5554,7 @@ const ms = /* @__PURE__ */ q(ps, [["render", gs]]), fs = w({
|
|
|
5546
5554
|
return this.$el;
|
|
5547
5555
|
},
|
|
5548
5556
|
$marker() {
|
|
5549
|
-
return
|
|
5557
|
+
return ot(Fe, this.$parent, Le);
|
|
5550
5558
|
},
|
|
5551
5559
|
getOptions() {
|
|
5552
5560
|
return {
|
|
@@ -5569,16 +5577,16 @@ const ms = /* @__PURE__ */ q(ps, [["render", gs]]), fs = w({
|
|
|
5569
5577
|
this.$marker() ? this.$marker().onRemoveInfo(this) : this.overlay.close();
|
|
5570
5578
|
}
|
|
5571
5579
|
});
|
|
5572
|
-
function
|
|
5573
|
-
return
|
|
5580
|
+
function _s(i, t, e, r, s, n) {
|
|
5581
|
+
return Zr((V(), F("div", ue({
|
|
5574
5582
|
class: i.$options.name
|
|
5575
5583
|
}, i.attrs.binds), [
|
|
5576
5584
|
W(i.$slots, "default")
|
|
5577
5585
|
], 16)), [
|
|
5578
|
-
[
|
|
5586
|
+
[Wr, i.show]
|
|
5579
5587
|
]);
|
|
5580
5588
|
}
|
|
5581
|
-
const
|
|
5589
|
+
const bs = /* @__PURE__ */ q(vs, [["render", _s]]), Ts = w({
|
|
5582
5590
|
name: "tg-label",
|
|
5583
5591
|
mixins: [P],
|
|
5584
5592
|
inheritAttrs: !1,
|
|
@@ -5621,7 +5629,7 @@ const vs = /* @__PURE__ */ q(fs, [["render", ys]]), _s = w({
|
|
|
5621
5629
|
return (i = this.$marker()) == null ? void 0 : i.marker;
|
|
5622
5630
|
},
|
|
5623
5631
|
$marker() {
|
|
5624
|
-
return
|
|
5632
|
+
return ot(Fe, this.$parent, Le);
|
|
5625
5633
|
},
|
|
5626
5634
|
getOptions() {
|
|
5627
5635
|
return {
|
|
@@ -5640,14 +5648,14 @@ const vs = /* @__PURE__ */ q(fs, [["render", ys]]), _s = w({
|
|
|
5640
5648
|
this.$marker() ? this.$marker().onRemoveLabel(this) : this.$map.removeOverlay(this.overlay);
|
|
5641
5649
|
}
|
|
5642
5650
|
});
|
|
5643
|
-
function
|
|
5651
|
+
function Ms(i, t, e, r, s, n) {
|
|
5644
5652
|
return V(), F("div", ue({
|
|
5645
5653
|
class: i.$options.name
|
|
5646
5654
|
}, i.attrs.binds), [
|
|
5647
5655
|
W(i.$slots, "default")
|
|
5648
5656
|
], 16);
|
|
5649
5657
|
}
|
|
5650
|
-
const
|
|
5658
|
+
const Os = /* @__PURE__ */ q(Ts, [["render", Ms]]), Cs = w({
|
|
5651
5659
|
name: "tg-polygon",
|
|
5652
5660
|
mixins: [P],
|
|
5653
5661
|
inheritAttrs: !1,
|
|
@@ -5716,7 +5724,7 @@ const Ts = /* @__PURE__ */ q(_s, [["render", bs]]), Ms = w({
|
|
|
5716
5724
|
onDestroy() {
|
|
5717
5725
|
this.$map.removeOverlay(this.overlay);
|
|
5718
5726
|
}
|
|
5719
|
-
}),
|
|
5727
|
+
}), ws = w({
|
|
5720
5728
|
name: "tg-polyline",
|
|
5721
5729
|
mixins: [P],
|
|
5722
5730
|
inheritAttrs: !1,
|
|
@@ -5777,7 +5785,7 @@ const Ts = /* @__PURE__ */ q(_s, [["render", bs]]), Ms = w({
|
|
|
5777
5785
|
onDestroy() {
|
|
5778
5786
|
this.$map.removeOverlay(this.overlay);
|
|
5779
5787
|
}
|
|
5780
|
-
}),
|
|
5788
|
+
}), Es = w({
|
|
5781
5789
|
name: "tg-rectangle",
|
|
5782
5790
|
mixins: [P],
|
|
5783
5791
|
inheritAttrs: !1,
|
|
@@ -5843,13 +5851,13 @@ const Ts = /* @__PURE__ */ q(_s, [["render", bs]]), Ms = w({
|
|
|
5843
5851
|
onDestroy() {
|
|
5844
5852
|
this.$map.removeOverlay(this.overlay);
|
|
5845
5853
|
}
|
|
5846
|
-
}),
|
|
5854
|
+
}), Ls = ["beforeUpdate", "updated"], Xs = {
|
|
5847
5855
|
install(i, t = {}) {
|
|
5848
5856
|
if (t.enable !== !1) {
|
|
5849
5857
|
const e = w({
|
|
5850
5858
|
beforeCreate() {
|
|
5851
|
-
const r =
|
|
5852
|
-
t.hookNames ? t.hookNames.includes(a) && console.debug("[lifecycle]", r, a) :
|
|
5859
|
+
const r = Lr() ?? "", n = (t.nameRegex || /^[A-Z]/).test(r) ? (a) => {
|
|
5860
|
+
t.hookNames ? t.hookNames.includes(a) && console.debug("[lifecycle]", r, a) : Ls.includes(a) || console.debug("[lifecycle]", r, a);
|
|
5853
5861
|
} : ve;
|
|
5854
5862
|
n("beforeCreate"), this.__life_impl = n;
|
|
5855
5863
|
},
|
|
@@ -5889,44 +5897,44 @@ const Ts = /* @__PURE__ */ q(_s, [["render", bs]]), Ms = w({
|
|
|
5889
5897
|
i.mixin(e);
|
|
5890
5898
|
}
|
|
5891
5899
|
}
|
|
5892
|
-
},
|
|
5900
|
+
}, xs = 6378137;
|
|
5893
5901
|
function ye(i) {
|
|
5894
5902
|
return i * Math.PI / 180;
|
|
5895
5903
|
}
|
|
5896
|
-
function
|
|
5904
|
+
function Ut(i) {
|
|
5897
5905
|
return i * 180 / Math.PI;
|
|
5898
5906
|
}
|
|
5899
|
-
function
|
|
5907
|
+
function Ps(i, t) {
|
|
5900
5908
|
if (i.lat === t.lat && i.lng === t.lng)
|
|
5901
5909
|
return 0;
|
|
5902
5910
|
const e = ye((i.lat + t.lat) / 2), r = ye((i.lat - t.lat) / 2), s = ye((i.lng - t.lng) / 2);
|
|
5903
|
-
let n = Math.sin(r), a = Math.sin(s),
|
|
5904
|
-
const o =
|
|
5905
|
-
n = n * n, a = a * a,
|
|
5906
|
-
const
|
|
5907
|
-
return _ * (1 + l * (T *
|
|
5908
|
-
}
|
|
5909
|
-
function
|
|
5910
|
-
const s = 63567523142e-4, n = 1 / 298.257223563, a = ye(t),
|
|
5911
|
+
let n = Math.sin(r), a = Math.sin(s), h = Math.sin(e);
|
|
5912
|
+
const o = xs, l = 1 / 298.257;
|
|
5913
|
+
n = n * n, a = a * a, h = h * h;
|
|
5914
|
+
const d = n * (1 - a) + (1 - h) * a, u = (1 - n) * (1 - a) + h * a, p = Math.atan(Math.sqrt(d / u)), b = Math.sqrt(d * u) / p, _ = 2 * p * o, T = (3 * b - 1) / 2 / u, g = (3 * b + 1) / 2 / d;
|
|
5915
|
+
return _ * (1 + l * (T * h * (1 - n) - g * (1 - h) * n));
|
|
5916
|
+
}
|
|
5917
|
+
function ks(i, t, e) {
|
|
5918
|
+
const s = 63567523142e-4, n = 1 / 298.257223563, a = ye(t), h = Math.sin(a), o = Math.cos(a), l = (1 - n) * Math.tan(ye(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)));
|
|
5911
5919
|
let v = 0, O = 0, x = 0, E = e / (s * g), Q = 2 * Math.PI;
|
|
5912
5920
|
for (; Math.abs(E - Q) > 1e-12; ) {
|
|
5913
5921
|
v = Math.cos(2 * p + E), O = Math.sin(E), x = Math.cos(E);
|
|
5914
|
-
const
|
|
5915
|
-
Q = E, E = e / (s * g) +
|
|
5922
|
+
const Br = f * O * (v + f / 4 * (x * (-1 + 2 * v * v) - f / 6 * v * (-3 + 4 * O * O) * (-3 + 4 * v * v)));
|
|
5923
|
+
Q = E, E = e / (s * g) + Br;
|
|
5916
5924
|
}
|
|
5917
|
-
const ie = u * O -
|
|
5918
|
-
u * x +
|
|
5925
|
+
const ie = u * O - d * x * o, Ue = Math.atan2(
|
|
5926
|
+
u * x + d * O * o,
|
|
5919
5927
|
(1 - n) * Math.sqrt(b * b + ie * ie)
|
|
5920
|
-
),
|
|
5921
|
-
return { lng: i.lng +
|
|
5928
|
+
), Pr = Math.atan2(O * h, d * x - u * O * o), Ye = n / 16 * _ * (4 + n * (4 - 3 * _)), kr = Pr - (1 - Ye) * n * b * (E + Ye * O * (v + Ye * x * (-1 + 2 * v * v)));
|
|
5929
|
+
return { lng: i.lng + Ut(kr), lat: Ut(Ue) };
|
|
5922
5930
|
}
|
|
5923
|
-
const
|
|
5924
|
-
getDistance:
|
|
5925
|
-
getDestination:
|
|
5926
|
-
},
|
|
5931
|
+
const Js = {
|
|
5932
|
+
getDistance: Ps,
|
|
5933
|
+
getDestination: ks
|
|
5934
|
+
}, Qs = {
|
|
5927
5935
|
install(i, t) {
|
|
5928
|
-
if (
|
|
5929
|
-
const r = /* @__PURE__ */ Object.assign({ "./TgMap.vue":
|
|
5936
|
+
if (ai(t), {}.VITE_FALSE) {
|
|
5937
|
+
const r = /* @__PURE__ */ Object.assign({ "./TgMap.vue": Le, "./TgMapWidget.vue": Xi, "./controls/TgCustomControl.vue": es, "./controls/TgMapTypeControl.vue": ts, "./controls/TgScaleControl.vue": rs, "./controls/TgZoomControl.vue": ss, "./extra/TgMarkerClusterer.vue": xr, "./layers/TgTrafficLayer.vue": as, "./overlays/TgCircle.vue": ls, "./overlays/TgElementOverlay.vue": us, "./overlays/TgInfoBox.vue": ys, "./overlays/TgInfoWindow.vue": bs, "./overlays/TgLabel.vue": Os, "./overlays/TgMarker.vue": Fe, "./overlays/TgPolygon.vue": Cs, "./overlays/TgPolyline.vue": ws, "./overlays/TgRectangle.vue": Es });
|
|
5930
5938
|
Object.keys(r).forEach((s) => {
|
|
5931
5939
|
const n = r[s];
|
|
5932
5940
|
i.component(n.name ?? C(`Tg开头的组件必须设置name: ${s}`), n);
|
|
@@ -5937,136 +5945,138 @@ const Ks = {
|
|
|
5937
5945
|
}
|
|
5938
5946
|
};
|
|
5939
5947
|
export {
|
|
5940
|
-
|
|
5941
|
-
|
|
5948
|
+
ar as AbstractControl,
|
|
5949
|
+
ft as AbstractMap,
|
|
5942
5950
|
he as Arrays,
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
+
pr as Autocomplete,
|
|
5952
|
+
yi as BaiduAutocomplete,
|
|
5953
|
+
vt as BaiduCircle,
|
|
5954
|
+
lt as BaiduControl,
|
|
5955
|
+
Ot as BaiduInfoBoxOverlay,
|
|
5956
|
+
Tt as BaiduInfoWindow,
|
|
5957
|
+
ct as BaiduMapTypeControl,
|
|
5958
|
+
Ie as BaiduMapUrls,
|
|
5951
5959
|
Ce as BaiduMarker,
|
|
5952
|
-
|
|
5960
|
+
Mi as BaiduMarkerClusterer,
|
|
5953
5961
|
je as BaiduOverlay,
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
+
wi as BaiduPlacesService,
|
|
5963
|
+
xt as BaiduPolyShape,
|
|
5964
|
+
Bt as BaiduPolygon,
|
|
5965
|
+
Pt as BaiduPolyline,
|
|
5966
|
+
St as BaiduRectangle,
|
|
5967
|
+
dt as BaiduScaleControl,
|
|
5968
|
+
Li as BaiduSearchBox,
|
|
5969
|
+
pt as BaiduZoomControl,
|
|
5962
5970
|
S as BuildInMapType,
|
|
5963
|
-
|
|
5971
|
+
lr as BuildInMapTypeId,
|
|
5964
5972
|
fe as CachedValue,
|
|
5965
|
-
|
|
5973
|
+
B as ControlPosition,
|
|
5966
5974
|
$ as ControlPositionConverter,
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
|
|
5970
|
-
|
|
5971
|
-
|
|
5972
|
-
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
+
I as CoordType,
|
|
5976
|
+
di as CustomControl,
|
|
5977
|
+
ci as FastFindValues,
|
|
5978
|
+
fi as GoogleAutocomplete,
|
|
5979
|
+
_t as GoogleCircle,
|
|
5980
|
+
ht as GoogleControl,
|
|
5981
|
+
Ct as GoogleInfoBoxOverlay,
|
|
5982
|
+
Mt as GoogleInfoWindow,
|
|
5975
5983
|
ke as GoogleMapTypeControl,
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5984
|
+
Be as GoogleMapUrls,
|
|
5985
|
+
Lt as GoogleMarker,
|
|
5986
|
+
Oi as GoogleMarkerClusterer,
|
|
5987
|
+
yt as GoogleOverlay,
|
|
5988
|
+
Ci as GooglePlacesService,
|
|
5989
|
+
It as GooglePolygon,
|
|
5990
|
+
kt as GooglePolyline,
|
|
5991
|
+
At as GoogleRectangle,
|
|
5992
|
+
ut as GoogleScaleControl,
|
|
5993
|
+
Ei as GoogleSearchBox,
|
|
5994
|
+
gt as GoogleZoomControl,
|
|
5987
5995
|
De as Icon,
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5996
|
+
Zs as ImageMapType,
|
|
5997
|
+
bt as InfoWindow,
|
|
5998
|
+
Zt as KeyValue,
|
|
5991
5999
|
y as LatLng,
|
|
5992
6000
|
A as LatLngBounds,
|
|
5993
|
-
|
|
6001
|
+
Xs as LifecycleLogPlugin,
|
|
5994
6002
|
K as Location,
|
|
5995
6003
|
we as MIXIN_HOOK_CREATE,
|
|
5996
6004
|
Ee as MIXIN_HOOK_DESTROY,
|
|
5997
|
-
|
|
6005
|
+
Rt as MIXIN_MAP_NAME,
|
|
5998
6006
|
ce as MVCArrays,
|
|
5999
6007
|
P as MapMixin,
|
|
6000
6008
|
R as MapType,
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6009
|
+
hr as MapTypeControlType,
|
|
6010
|
+
gr as MapUrls,
|
|
6011
|
+
xi as MapZoom,
|
|
6012
|
+
br as MarkerClusterer,
|
|
6005
6013
|
be as Objects,
|
|
6006
|
-
|
|
6007
|
-
|
|
6014
|
+
Cr as Overlay,
|
|
6015
|
+
Tr as PlacesService,
|
|
6008
6016
|
X as Point,
|
|
6009
|
-
|
|
6010
|
-
|
|
6017
|
+
Mr as SearchBox,
|
|
6018
|
+
Js as SphericalUtils,
|
|
6011
6019
|
Te as Strings,
|
|
6012
6020
|
ze as SymbolIcon,
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6021
|
+
Vs as SymbolPath,
|
|
6022
|
+
ls as TgCircle,
|
|
6023
|
+
es as TgCustomControl,
|
|
6024
|
+
us as TgElementOverlay,
|
|
6025
|
+
ys as TgInfoBox,
|
|
6026
|
+
bs as TgInfoWindow,
|
|
6027
|
+
Os as TgLabel,
|
|
6028
|
+
Le as TgMap,
|
|
6029
|
+
st as TgMapFactory,
|
|
6022
6030
|
G as TgMapType,
|
|
6023
|
-
|
|
6024
|
-
|
|
6031
|
+
ts as TgMapTypeControl,
|
|
6032
|
+
Xi as TgMapWidget,
|
|
6025
6033
|
Fe as TgMarker,
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
+
xr as TgMarkerClusterer,
|
|
6035
|
+
Cs as TgPolygon,
|
|
6036
|
+
ws as TgPolyline,
|
|
6037
|
+
Es as TgRectangle,
|
|
6038
|
+
rs as TgScaleControl,
|
|
6039
|
+
as as TgTrafficLayer,
|
|
6040
|
+
ss as TgZoomControl,
|
|
6041
|
+
ui as TrafficLayer,
|
|
6034
6042
|
$e as UnionIcon,
|
|
6035
6043
|
oe as assert,
|
|
6036
6044
|
Qe as assertNever,
|
|
6037
6045
|
Pe as callHook,
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6046
|
+
Fs as computedSaveOnThis,
|
|
6047
|
+
Er as createEmptyVNode,
|
|
6048
|
+
ji as createPropertyObject,
|
|
6049
|
+
Us as createPropertyObjectTyped,
|
|
6050
|
+
Ns as debug,
|
|
6051
|
+
Qs as default,
|
|
6044
6052
|
L as eventProp,
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
+
qs as extractVNodeFromSlotsByComponent,
|
|
6054
|
+
ot as findAncestorComponentByType,
|
|
6055
|
+
Ys as findByComponentType,
|
|
6056
|
+
ks as getDestination,
|
|
6057
|
+
ir as getTgMapConfig,
|
|
6058
|
+
tt as isComponentByType,
|
|
6059
|
+
Gs as isDef,
|
|
6060
|
+
Qt as isEntryValueDef,
|
|
6061
|
+
Rs as isInstanceOf,
|
|
6062
|
+
As as lateinit,
|
|
6053
6063
|
ve as noop,
|
|
6054
6064
|
m as optionalProp,
|
|
6055
|
-
|
|
6065
|
+
Si as path,
|
|
6056
6066
|
D as requiredProp,
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6067
|
+
$s as safeAs,
|
|
6068
|
+
Jt as safeAsComponent,
|
|
6069
|
+
ai as setTgMapConfig,
|
|
6070
|
+
Vi as splitAttrs,
|
|
6061
6071
|
Z as stringEnumProp,
|
|
6062
|
-
|
|
6072
|
+
Hi as stringUnionPropFromValues,
|
|
6063
6073
|
C as throwError,
|
|
6064
|
-
|
|
6065
|
-
|
|
6074
|
+
at as throwUnsupported,
|
|
6075
|
+
zs as todo,
|
|
6066
6076
|
et as typed,
|
|
6067
|
-
|
|
6068
|
-
|
|
6077
|
+
Ds as unwrapStringEnumValue,
|
|
6078
|
+
Ks as useEventLogMethods,
|
|
6069
6079
|
Y as useSplittedAttrs,
|
|
6070
|
-
|
|
6080
|
+
is as useTgMapInner
|
|
6071
6081
|
};
|
|
6072
6082
|
//# sourceMappingURL=tg-map.js.map
|