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