tg-map-vue3 3.2.0 → 3.2.2
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/components/overlays/TgMarker.vue.d.ts +5 -5
- package/dist/src/map/map/extra/places-service.d.ts +2 -2
- package/dist/src/map/map/overlay/icon.d.ts +79 -1
- package/dist/src/map/map/overlay/label.d.ts +3 -1
- package/dist/src/map/map/overlay/marker.d.ts +10 -11
- package/dist/src/map/unions.d.ts +2 -1
- package/dist/src/utils/objects.d.ts +4 -0
- package/dist/tg-map.js +918 -811
- package/dist/tg-map.js.map +1 -1
- package/dist/tg-map.umd.cjs +7 -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
|
|
2
|
+
var cr = Object.defineProperty;
|
|
3
|
+
var dr = (i, e, t) => e in i ? cr(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
4
|
+
var p = (i, e, t) => (dr(i, typeof e != "symbol" ? e + "" : e, t), t);
|
|
5
|
+
import { createCommentVNode as Ge, computed as St, defineComponent as x, markRaw as pr, openBlock as Z, createElementBlock as W, mergeProps as le, createElementVNode as ur, normalizeClass as Se, renderSlot as R, normalizeStyle as gr, getCurrentInstance as mr, inject as fr, onMounted as yr, onBeforeUnmount as vr, watch as _r, withDirectives as Mr, vShow as br } 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 Tr = 1;
|
|
12
|
+
function Or() {
|
|
13
|
+
return Tr++;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return e.__id__ || (e.__id__ =
|
|
15
|
+
function we(i, e) {
|
|
16
|
+
return e.__id__ || (e.__id__ = Or()), `${i}::${e.__id__}`;
|
|
17
17
|
}
|
|
18
|
-
var
|
|
18
|
+
var At = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, V = {}, wr = {
|
|
19
19
|
get exports() {
|
|
20
20
|
return V;
|
|
21
21
|
},
|
|
@@ -26,10 +26,10 @@ var It = 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
|
+
})(At, 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, O) {
|
|
32
|
+
this.west = Math.min(g, v), this.north = Math.max(m, O), this.east = Math.max(g, v), this.south = Math.min(m, O);
|
|
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 It = 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
|
+
], c = [
|
|
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,43 +53,43 @@ var It = 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 O = 0; O < c.length; O++)
|
|
57
|
+
if (c[O].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,
|
|
65
|
-
return [
|
|
64
|
+
var v = g - 65e-4, O = m - 6e-3, E = Math.sqrt(v * v + O * O) - 2e-5 * Math.sin(O * e), w = Math.atan2(O, v) - 3e-6 * Math.cos(v * e), q = E * Math.cos(w), re = E * Math.sin(w);
|
|
65
|
+
return [q, 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), O = Math.atan2(m, g) + 3e-6 * Math.cos(g * e), E = v * Math.cos(O) + 65e-4, w = v * Math.sin(O) + 6e-3;
|
|
69
|
+
return [E, w];
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
return o(g, m) ?
|
|
71
|
+
function d(g, m) {
|
|
72
|
+
return o(g, m) ? _(g, m) : [g, m];
|
|
73
73
|
}
|
|
74
74
|
function u(g, m) {
|
|
75
75
|
if (!o(g, m))
|
|
76
76
|
return [g, m];
|
|
77
|
-
var v =
|
|
77
|
+
var v = _(g, m);
|
|
78
78
|
return [g * 2 - v[0], m * 2 - v[1]];
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
var v = b(g - 105, m - 35),
|
|
82
|
-
|
|
83
|
-
var
|
|
84
|
-
v = v * 180 / (r * (1 - s) / (
|
|
85
|
-
var re = m + v,
|
|
86
|
-
return [
|
|
80
|
+
function _(g, m) {
|
|
81
|
+
var v = b(g - 105, m - 35), O = M(g - 105, m - 35), E = m / 180 * t, w = Math.sin(E);
|
|
82
|
+
w = 1 - s * w * w;
|
|
83
|
+
var q = Math.sqrt(w);
|
|
84
|
+
v = v * 180 / (r * (1 - s) / (w * q) * t), O = O * 180 / (r / q * Math.cos(E) * t);
|
|
85
|
+
var re = m + v, $e = g + O;
|
|
86
|
+
return [$e, re];
|
|
87
87
|
}
|
|
88
88
|
function b(g, m) {
|
|
89
89
|
var v = -100 + 2 * g + 3 * m + 0.2 * m * m + 0.1 * g * m + 0.2 * Math.sqrt(Math.abs(g));
|
|
90
90
|
return v += (20 * Math.sin(6 * g * t) + 20 * Math.sin(2 * g * t)) * 2 / 3, v += (20 * Math.sin(m * t) + 40 * Math.sin(m / 3 * t)) * 2 / 3, v += (160 * Math.sin(m / 12 * t) + 320 * Math.sin(m * t / 30)) * 2 / 3, v;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function M(g, m) {
|
|
93
93
|
var v = 300 + g + 2 * m + 0.1 * g * g + 0.1 * g * m + 0.1 * Math.sqrt(Math.abs(g));
|
|
94
94
|
return v += (20 * Math.sin(6 * g * t) + 20 * Math.sin(2 * g * t)) * 2 / 3, v += (20 * Math.sin(g * t) + 40 * Math.sin(g / 3 * t)) * 2 / 3, v += (150 * Math.sin(g / 12 * t) + 300 * Math.sin(g / 30 * t)) * 2 / 3, v;
|
|
95
95
|
}
|
|
@@ -97,12 +97,12 @@ var It = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
97
97
|
// 向前兼容
|
|
98
98
|
bd09togcj02: l,
|
|
99
99
|
gcj02tobd09: h,
|
|
100
|
-
wgs84togcj02:
|
|
100
|
+
wgs84togcj02: d,
|
|
101
101
|
gcj02towgs84: u,
|
|
102
102
|
// 小驼峰命名风格
|
|
103
103
|
bd09ToGcj02: l,
|
|
104
104
|
gcj02ToBd09: h,
|
|
105
|
-
wgs84ToGcj02:
|
|
105
|
+
wgs84ToGcj02: d,
|
|
106
106
|
gcj02ToWgs84: u,
|
|
107
107
|
bd09ToWgs84: function(g, m) {
|
|
108
108
|
if (!o(g, m))
|
|
@@ -113,38 +113,38 @@ var It = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
113
113
|
wgs84ToBd09: function(g, m) {
|
|
114
114
|
if (!o(g, m))
|
|
115
115
|
return [g, m];
|
|
116
|
-
var v =
|
|
116
|
+
var v = d(g, m);
|
|
117
117
|
return h(v[0], v[1]);
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
120
|
});
|
|
121
|
-
})(
|
|
122
|
-
function
|
|
121
|
+
})(wr);
|
|
122
|
+
function se(i, e) {
|
|
123
123
|
if (!i)
|
|
124
124
|
throw new Error(`AssertionError: ${e}`);
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function Ze(i) {
|
|
127
127
|
throw new Error(`Unexpected object: ${i}`);
|
|
128
128
|
}
|
|
129
129
|
function C(i) {
|
|
130
130
|
throw new Error(i);
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function $t(i) {
|
|
133
133
|
throw new Error(`Unsupported: ${i}`);
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function Qi(i) {
|
|
136
136
|
throw new Error(`todo: ${i}`);
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function es(i) {
|
|
139
139
|
return i;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function ue(...i) {
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function ts(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 || {});
|
|
147
|
-
const
|
|
147
|
+
const ze = "wgs84", A = class {
|
|
148
148
|
constructor(e, t, r) {
|
|
149
149
|
this.lat = e, this.lng = t, this.coord = r;
|
|
150
150
|
}
|
|
@@ -160,12 +160,12 @@ const $e = "wgs84", A = class {
|
|
|
160
160
|
return new A(e.lat, e.lng, t);
|
|
161
161
|
}
|
|
162
162
|
static fromLiteral(e) {
|
|
163
|
-
return new A(e.lat, e.lng, e.coord ||
|
|
163
|
+
return new A(e.lat, e.lng, e.coord || ze);
|
|
164
164
|
}
|
|
165
|
-
static fromLngLat(e, t, r =
|
|
165
|
+
static fromLngLat(e, t, r = ze) {
|
|
166
166
|
return new A(t, e, r);
|
|
167
167
|
}
|
|
168
|
-
static create(e, t, r =
|
|
168
|
+
static create(e, t, r = ze) {
|
|
169
169
|
return new A(e, t, r);
|
|
170
170
|
}
|
|
171
171
|
to(e) {
|
|
@@ -213,7 +213,7 @@ const $e = "wgs84", A = class {
|
|
|
213
213
|
}
|
|
214
214
|
};
|
|
215
215
|
let y = A;
|
|
216
|
-
|
|
216
|
+
p(y, "ZERO", A.create(0, 0));
|
|
217
217
|
const J = class {
|
|
218
218
|
/**
|
|
219
219
|
* 不推荐直接创建LatLngBounds, sw和ne的大小关系可能没法保证, 推荐用LatLngBounds.Builder或者LatLngBounds.from等静态方法来创建
|
|
@@ -221,8 +221,8 @@ const J = class {
|
|
|
221
221
|
* @param ne 东北, lat/lng更大
|
|
222
222
|
*/
|
|
223
223
|
constructor(e, t) {
|
|
224
|
-
|
|
225
|
-
this.sw = e, this.ne = t,
|
|
224
|
+
p(this, "coord");
|
|
225
|
+
this.sw = e, this.ne = t, se(e.coord === t.coord, "sw和ne的coord应该相同"), se(Number.isFinite(e.lat) && Number.isFinite(e.lng) && Number.isFinite(t.lat) && Number.isFinite(t.lng), `sw(${e})和ne(${t})不能包含NaN或Infinite`), se(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) {
|
|
228
228
|
return e <= t ? e <= r && r <= t : e <= r || r <= t;
|
|
@@ -281,15 +281,15 @@ const J = class {
|
|
|
281
281
|
}
|
|
282
282
|
};
|
|
283
283
|
let F = J;
|
|
284
|
-
|
|
284
|
+
p(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
|
+
p(this, "coord");
|
|
289
|
+
p(this, "minLat");
|
|
290
|
+
p(this, "minLng");
|
|
291
|
+
p(this, "maxLat");
|
|
292
|
+
p(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,77 +310,77 @@ c(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 Cr = function(e) {
|
|
314
|
+
return xr(e) && !Er(e);
|
|
315
315
|
};
|
|
316
|
-
function
|
|
316
|
+
function xr(i) {
|
|
317
317
|
return !!i && typeof i == "object";
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function Er(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]" || kr(i);
|
|
322
322
|
}
|
|
323
|
-
var
|
|
324
|
-
function
|
|
325
|
-
return i.$$typeof ===
|
|
323
|
+
var Lr = typeof Symbol == "function" && Symbol.for, Pr = Lr ? Symbol.for("react.element") : 60103;
|
|
324
|
+
function kr(i) {
|
|
325
|
+
return i.$$typeof === Pr;
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function Ir(i) {
|
|
328
328
|
return Array.isArray(i) ? [] : {};
|
|
329
329
|
}
|
|
330
|
-
function
|
|
331
|
-
return e.clone !== !1 && e.isMergeableObject(i) ?
|
|
330
|
+
function ge(i, e) {
|
|
331
|
+
return e.clone !== !1 && e.isMergeableObject(i) ? oe(Ir(i), i, e) : i;
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function Br(i, e, t) {
|
|
334
334
|
return i.concat(e).map(function(r) {
|
|
335
|
-
return
|
|
335
|
+
return ge(r, t);
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function Sr(i, e) {
|
|
339
339
|
if (!e.customMerge)
|
|
340
|
-
return
|
|
340
|
+
return oe;
|
|
341
341
|
var t = e.customMerge(i);
|
|
342
|
-
return typeof t == "function" ? t :
|
|
342
|
+
return typeof t == "function" ? t : oe;
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function Ar(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
|
-
function
|
|
350
|
-
return Object.keys(i).concat(
|
|
349
|
+
function Ot(i) {
|
|
350
|
+
return Object.keys(i).concat(Ar(i));
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function Rt(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 $r(i, e) {
|
|
360
|
+
return Rt(i, e) && !(Object.hasOwnProperty.call(i, e) && Object.propertyIsEnumerable.call(i, e));
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function Rr(i, e, t) {
|
|
363
363
|
var r = {};
|
|
364
|
-
return t.isMergeableObject(i) &&
|
|
365
|
-
r[s] =
|
|
366
|
-
}),
|
|
367
|
-
|
|
364
|
+
return t.isMergeableObject(i) && Ot(i).forEach(function(s) {
|
|
365
|
+
r[s] = ge(i[s], t);
|
|
366
|
+
}), Ot(e).forEach(function(s) {
|
|
367
|
+
$r(i, s) || (Rt(i, s) && t.isMergeableObject(e[s]) ? r[s] = Sr(s, t)(i[s], e[s], t) : r[s] = ge(e[s], t));
|
|
368
368
|
}), r;
|
|
369
369
|
}
|
|
370
|
-
function
|
|
371
|
-
t = t || {}, t.arrayMerge = t.arrayMerge ||
|
|
370
|
+
function oe(i, e, t) {
|
|
371
|
+
t = t || {}, t.arrayMerge = t.arrayMerge || Br, t.isMergeableObject = t.isMergeableObject || Cr, t.cloneUnlessOtherwiseSpecified = ge;
|
|
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) : Rr(i, e, t) : ge(e, t);
|
|
374
374
|
}
|
|
375
|
-
|
|
375
|
+
oe.all = function(e, t) {
|
|
376
376
|
if (!Array.isArray(e))
|
|
377
377
|
throw new Error("first argument should be an array");
|
|
378
378
|
return e.reduce(function(r, s) {
|
|
379
|
-
return
|
|
379
|
+
return oe(r, s, t);
|
|
380
380
|
}, {});
|
|
381
381
|
};
|
|
382
|
-
var
|
|
383
|
-
const Ce = ["3.0"],
|
|
382
|
+
var zr = oe, zt = zr;
|
|
383
|
+
const Ce = ["3.0"], Nr = {
|
|
384
384
|
baidu: {
|
|
385
385
|
version: "3.0",
|
|
386
386
|
// 在build时会被静态替换, 导致使用者不能无法设置它
|
|
@@ -399,20 +399,20 @@ const Ce = ["3.0"], $r = {
|
|
|
399
399
|
key: {}.VITE_APP_DEV_KEY_HERE
|
|
400
400
|
}
|
|
401
401
|
};
|
|
402
|
-
let
|
|
403
|
-
function
|
|
404
|
-
return
|
|
402
|
+
let Nt;
|
|
403
|
+
function Dt() {
|
|
404
|
+
return Nt || C("请先安装: Vue<PartialTgMapConfig>.use(TgMap, {})");
|
|
405
405
|
}
|
|
406
|
-
function
|
|
407
|
-
i != null && (
|
|
406
|
+
function Dr(i) {
|
|
407
|
+
i != null && (Nt = zt(Nr, i));
|
|
408
408
|
}
|
|
409
|
-
var
|
|
409
|
+
var We;
|
|
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
|
+
})(We || (We = {}));
|
|
416
416
|
var xe;
|
|
417
417
|
((i) => {
|
|
418
418
|
function e(r, s) {
|
|
@@ -445,15 +445,15 @@ var Ee;
|
|
|
445
445
|
}
|
|
446
446
|
i.remove = t;
|
|
447
447
|
})(Ee || (Ee = {}));
|
|
448
|
-
function
|
|
448
|
+
function rs() {
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function je(i) {
|
|
451
451
|
return i;
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function is(i, e) {
|
|
454
454
|
return i instanceof e;
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function ss(i, e) {
|
|
457
457
|
if (i instanceof e)
|
|
458
458
|
return i;
|
|
459
459
|
}
|
|
@@ -461,39 +461,39 @@ 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 ns(i) {
|
|
465
465
|
return i;
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function Gt(i, e, t) {
|
|
468
468
|
return i.addListener(e, t).remove;
|
|
469
469
|
}
|
|
470
|
-
function
|
|
470
|
+
function Gr(i, e, t) {
|
|
471
471
|
return i.addEventListener(e, t), () => i.removeEventListener(e, t);
|
|
472
472
|
}
|
|
473
|
-
function
|
|
473
|
+
function Zr(i, e, t, r) {
|
|
474
474
|
return i.addEventListener(e, t, r), () => i.removeEventListener(e, t, r);
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function wt(i, e, t) {
|
|
477
477
|
return i.addEventListener(e, t), () => i.removeEventListener(e, t);
|
|
478
478
|
}
|
|
479
|
-
class
|
|
479
|
+
class Zt {
|
|
480
480
|
constructor(e, t) {
|
|
481
|
-
|
|
482
|
-
|
|
481
|
+
p(this, "eventMap", /* @__PURE__ */ new Map());
|
|
482
|
+
p(this, "target", void 0);
|
|
483
483
|
this.inner = e, this.coordTypeSupplier = t, this.addEventListener = this.addEventListener.bind(this), this.removeEventListener = this.removeEventListener.bind(this);
|
|
484
484
|
}
|
|
485
485
|
setTarget(e) {
|
|
486
486
|
return this.target = e, this;
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
|
-
const
|
|
489
|
+
const Tt = class extends Zt {
|
|
490
490
|
addEventListener(e, t) {
|
|
491
|
-
const r =
|
|
491
|
+
const r = we(e, t);
|
|
492
492
|
if (this.eventMap.get(r)) {
|
|
493
493
|
console.warn("listener已经添加过了", r, t);
|
|
494
494
|
return;
|
|
495
495
|
}
|
|
496
|
-
const s = this.inner.addListener(
|
|
496
|
+
const s = this.inner.addListener(Tt.EVENT_TYPE_MAP[e] || e, (n) => {
|
|
497
497
|
const a = {
|
|
498
498
|
type: e,
|
|
499
499
|
target: this.target,
|
|
@@ -504,13 +504,13 @@ const Mt = class extends Rt {
|
|
|
504
504
|
this.eventMap.set(r, s);
|
|
505
505
|
}
|
|
506
506
|
removeEventListener(e, t) {
|
|
507
|
-
const r =
|
|
507
|
+
const r = we(e, t), s = this.eventMap.get(r);
|
|
508
508
|
s ? (s.remove(), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, t);
|
|
509
509
|
}
|
|
510
510
|
};
|
|
511
|
-
let ee =
|
|
511
|
+
let ee = Tt;
|
|
512
512
|
// 事件类型映射: tg => google
|
|
513
|
-
|
|
513
|
+
p(ee, "EVENT_TYPE_MAP", {
|
|
514
514
|
"center-changed": "center_changed",
|
|
515
515
|
"zoom-changed": "zoom_changed",
|
|
516
516
|
"map-type-changed": "maptypeid_changed",
|
|
@@ -521,9 +521,9 @@ c(ee, "EVENT_TYPE_MAP", {
|
|
|
521
521
|
"map-mouseup": "mouseup",
|
|
522
522
|
"map-dblclick": "dblclick"
|
|
523
523
|
});
|
|
524
|
-
const
|
|
524
|
+
const Be = class extends Zt {
|
|
525
525
|
addEventListener(e, t) {
|
|
526
|
-
const r =
|
|
526
|
+
const r = we(e, t);
|
|
527
527
|
if (this.eventMap.get(r)) {
|
|
528
528
|
console.warn("listener已经添加过了", r, t);
|
|
529
529
|
return;
|
|
@@ -536,25 +536,25 @@ const ke = class extends Rt {
|
|
|
536
536
|
};
|
|
537
537
|
n.point && (a.position = y.fromBaidu(n.point, this.coordTypeSupplier.coordType)), t.call(this.target, a);
|
|
538
538
|
};
|
|
539
|
-
this.inner.addEventListener(
|
|
539
|
+
this.inner.addEventListener(Be.EVENT_TYPE_MAP[e] || e, s), this.eventMap.set(r, s);
|
|
540
540
|
}
|
|
541
541
|
removeEventListener(e, t) {
|
|
542
|
-
const r =
|
|
543
|
-
s ? (this.inner.removeEventListener(
|
|
542
|
+
const r = we(e, t), s = this.eventMap.get(r);
|
|
543
|
+
s ? (this.inner.removeEventListener(Be.EVENT_TYPE_MAP[e] || e, s), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, t);
|
|
544
544
|
}
|
|
545
545
|
};
|
|
546
|
-
let
|
|
546
|
+
let ne = Be;
|
|
547
547
|
// cSpell:words clickclose
|
|
548
548
|
// 事件类型映射, tg => baidu
|
|
549
|
-
|
|
549
|
+
p(ne, "EVENT_TYPE_MAP", {
|
|
550
550
|
drag: "dragging",
|
|
551
551
|
closeclick: "clickclose",
|
|
552
552
|
"zoom-changed": "zoomend",
|
|
553
553
|
"map-type-changed": "maptypechange"
|
|
554
554
|
});
|
|
555
|
-
class
|
|
555
|
+
class Wr {
|
|
556
556
|
constructor() {
|
|
557
|
-
|
|
557
|
+
p(this, "typeMap", /* @__PURE__ */ new Map());
|
|
558
558
|
}
|
|
559
559
|
addEventListener(e, t) {
|
|
560
560
|
let r = this.typeMap.get(e);
|
|
@@ -573,14 +573,14 @@ class Dr {
|
|
|
573
573
|
t && t.forEach((r) => r.call(e.target, e));
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
-
class
|
|
576
|
+
class Ct {
|
|
577
577
|
/**
|
|
578
578
|
* `keys`和`values`数组中可以有相同的值, 若存在相同值, 则index越小的优先级越高
|
|
579
579
|
*/
|
|
580
580
|
constructor(e, t) {
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
581
|
+
p(this, "keyToValue", /* @__PURE__ */ new Map());
|
|
582
|
+
p(this, "valueToKey", /* @__PURE__ */ new Map());
|
|
583
|
+
se(e.length === t.length);
|
|
584
584
|
for (let r = e.length - 1; r >= 0; r--)
|
|
585
585
|
this.keyToValue.set(e[r], t[r]), this.valueToKey.set(t[r], e[r]);
|
|
586
586
|
}
|
|
@@ -591,9 +591,9 @@ class wt {
|
|
|
591
591
|
return this.keyToValue.get(e) ?? C();
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
|
-
class
|
|
594
|
+
class jr {
|
|
595
595
|
constructor(e, t = 10) {
|
|
596
|
-
|
|
596
|
+
p(this, "map", /* @__PURE__ */ new Map());
|
|
597
597
|
this.values = e, this.maxSize4Debug = t;
|
|
598
598
|
}
|
|
599
599
|
/** 获取保存key-value映射的Map */
|
|
@@ -620,9 +620,9 @@ class Gr {
|
|
|
620
620
|
return this.getOrNull(e, t) ?? C(`key(${t})不存在与valueMap(${this.getValueMap(e)})中`);
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
|
-
class
|
|
623
|
+
class xt {
|
|
624
624
|
constructor(e) {
|
|
625
|
-
|
|
625
|
+
p(this, "value");
|
|
626
626
|
this.creator = e;
|
|
627
627
|
}
|
|
628
628
|
get() {
|
|
@@ -648,7 +648,7 @@ var P = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
648
648
|
/* RIGHT_BOTTOM */
|
|
649
649
|
];
|
|
650
650
|
function s() {
|
|
651
|
-
return e || (e = new
|
|
651
|
+
return e || (e = new Ct(r, [
|
|
652
652
|
/* | @tg/map |名字相同| baidu | */
|
|
653
653
|
/* TOP_LEFT = */
|
|
654
654
|
BMAP_ANCHOR_TOP_LEFT,
|
|
@@ -678,7 +678,7 @@ var P = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
678
678
|
}
|
|
679
679
|
i.getBaidu = s;
|
|
680
680
|
function n() {
|
|
681
|
-
return t || (t = new
|
|
681
|
+
return t || (t = new Ct(r, [
|
|
682
682
|
google.maps.ControlPosition.TOP_LEFT,
|
|
683
683
|
google.maps.ControlPosition.TOP_CENTER,
|
|
684
684
|
google.maps.ControlPosition.TOP_RIGHT,
|
|
@@ -695,16 +695,16 @@ var P = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
695
695
|
}
|
|
696
696
|
i.getGoogle = n;
|
|
697
697
|
})(B || (B = {}));
|
|
698
|
-
class
|
|
698
|
+
class Vr {
|
|
699
699
|
constructor(e) {
|
|
700
700
|
/** 实际添加到地图中的control对象 */
|
|
701
|
-
|
|
701
|
+
p(this, "inner");
|
|
702
702
|
this.position = e;
|
|
703
703
|
}
|
|
704
704
|
}
|
|
705
|
-
class
|
|
705
|
+
class Wt {
|
|
706
706
|
}
|
|
707
|
-
class
|
|
707
|
+
class Ye extends Wt {
|
|
708
708
|
constructor(e, t) {
|
|
709
709
|
super(), this.inner = e, this.position = t;
|
|
710
710
|
}
|
|
@@ -727,11 +727,11 @@ class Fe extends Dt {
|
|
|
727
727
|
e.innerMap.removeControl(this.inner);
|
|
728
728
|
}
|
|
729
729
|
}
|
|
730
|
-
class
|
|
730
|
+
class Ke extends Wt {
|
|
731
731
|
constructor(t, r) {
|
|
732
732
|
super();
|
|
733
|
-
|
|
734
|
-
|
|
733
|
+
p(this, "visible", !1);
|
|
734
|
+
p(this, "map");
|
|
735
735
|
this._type = t, this.position = r;
|
|
736
736
|
}
|
|
737
737
|
isVisible() {
|
|
@@ -764,7 +764,7 @@ class Ue extends Dt {
|
|
|
764
764
|
});
|
|
765
765
|
}
|
|
766
766
|
}
|
|
767
|
-
var
|
|
767
|
+
var jt = /* @__PURE__ */ ((i) => (i.normal = "normal", i.satellite = "satellite", i.hybrid = "hybrid", i))(jt || {});
|
|
768
768
|
class k {
|
|
769
769
|
constructor(e, t, r, s) {
|
|
770
770
|
this.id = e, this.baidu = t, this.google = r, this.googleCoordType = s;
|
|
@@ -786,13 +786,13 @@ class k {
|
|
|
786
786
|
return this.google();
|
|
787
787
|
}
|
|
788
788
|
asGoogleMapType() {
|
|
789
|
-
|
|
789
|
+
$t("google的内置地图没有对应的实例");
|
|
790
790
|
}
|
|
791
791
|
}
|
|
792
|
-
class
|
|
792
|
+
class Hr {
|
|
793
793
|
constructor() {
|
|
794
|
-
|
|
795
|
-
|
|
794
|
+
p(this, "baiduCache", new xt(() => new BMap.TrafficLayer()));
|
|
795
|
+
p(this, "googleCache", new xt(() => new google.maps.TrafficLayer()));
|
|
796
796
|
}
|
|
797
797
|
asBaiduLayer() {
|
|
798
798
|
return this.baiduCache.get();
|
|
@@ -809,13 +809,13 @@ var I;
|
|
|
809
809
|
), () => (
|
|
810
810
|
/* 地形 */
|
|
811
811
|
google.maps.MapTypeId.TERRAIN
|
|
812
|
-
), Q.wgs84), i.BUILD_IN_MAP_TYPES = new
|
|
812
|
+
), Q.wgs84), i.BUILD_IN_MAP_TYPES = new jr([i.NORMAL, i.SATELLITE, i.HYBRID, i.TERRAIN]);
|
|
813
813
|
})(I || (I = {}));
|
|
814
|
-
var
|
|
815
|
-
const
|
|
816
|
-
class
|
|
814
|
+
var Vt = /* @__PURE__ */ ((i) => (i.DEFAULT = "default", i.HORIZONTAL = "horizontal", i.DROPDOWN = "dropdown", i))(Vt || {});
|
|
815
|
+
const Ht = [I.NORMAL, I.SATELLITE, I.HYBRID];
|
|
816
|
+
class qe extends Ye {
|
|
817
817
|
static create(e) {
|
|
818
|
-
const t = e.mapTypes ??
|
|
818
|
+
const t = e.mapTypes ?? Ht, r = {
|
|
819
819
|
default: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
820
820
|
horizontal: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
821
821
|
dropdown: BMAP_MAPTYPE_CONTROL_DROPDOWN
|
|
@@ -823,11 +823,11 @@ class Ye extends Fe {
|
|
|
823
823
|
type: e.type && r[e.type],
|
|
824
824
|
mapTypes: t.map((n) => n.asBaiduMapType())
|
|
825
825
|
});
|
|
826
|
-
return e.position && s.setAnchor(B.getBaidu().toValue(e.position)), new
|
|
826
|
+
return e.position && s.setAnchor(B.getBaidu().toValue(e.position)), new qe(s, e.position);
|
|
827
827
|
}
|
|
828
828
|
}
|
|
829
|
-
const ie = class extends
|
|
830
|
-
constructor(e = "default", t = P.TOP_LEFT, r =
|
|
829
|
+
const ie = class extends Ke {
|
|
830
|
+
constructor(e = "default", t = P.TOP_LEFT, r = Ht) {
|
|
831
831
|
super("mapType", t), this.type = e, this.mapTypes = r, ie.type2google || (ie.type2google = {
|
|
832
832
|
default: google.maps.MapTypeControlStyle.DEFAULT,
|
|
833
833
|
horizontal: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
|
|
@@ -847,61 +847,61 @@ const ie = class extends Ue {
|
|
|
847
847
|
});
|
|
848
848
|
}
|
|
849
849
|
};
|
|
850
|
-
let
|
|
851
|
-
|
|
852
|
-
class
|
|
850
|
+
let Oe = ie;
|
|
851
|
+
p(Oe, "type2google");
|
|
852
|
+
class Xe extends Ye {
|
|
853
853
|
static create(e) {
|
|
854
854
|
const t = new BMap.ScaleControl({
|
|
855
855
|
anchor: e.position && B.getBaidu().toValue(e.position)
|
|
856
856
|
});
|
|
857
|
-
return new
|
|
857
|
+
return new Xe(t, e.position);
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
|
-
class
|
|
860
|
+
class Je extends Ke {
|
|
861
861
|
static create(e) {
|
|
862
|
-
return new
|
|
862
|
+
return new Je(e.position);
|
|
863
863
|
}
|
|
864
864
|
constructor(e = P.BOTTOM_RIGHT) {
|
|
865
865
|
super("scale", e);
|
|
866
866
|
}
|
|
867
867
|
}
|
|
868
|
-
class
|
|
868
|
+
class Qe extends Ye {
|
|
869
869
|
static create(e) {
|
|
870
870
|
const t = new BMap.NavigationControl({
|
|
871
871
|
type: BMAP_NAVIGATION_CONTROL_ZOOM,
|
|
872
872
|
// enableGeolocation: true,
|
|
873
873
|
anchor: e.position && B.getBaidu().toValue(e.position)
|
|
874
874
|
});
|
|
875
|
-
return new
|
|
875
|
+
return new Qe(t, e.position);
|
|
876
876
|
}
|
|
877
877
|
}
|
|
878
|
-
class
|
|
878
|
+
class et extends Ke {
|
|
879
879
|
static create(e) {
|
|
880
|
-
return new
|
|
880
|
+
return new et(e.position);
|
|
881
881
|
}
|
|
882
882
|
constructor(e = P.RIGHT_BOTTOM) {
|
|
883
883
|
super("zoom", e);
|
|
884
884
|
}
|
|
885
885
|
}
|
|
886
|
-
function
|
|
886
|
+
function Fr(i) {
|
|
887
887
|
let e, t, r;
|
|
888
|
-
const s = "The Google Maps JavaScript API", n = "google", a = "importLibrary",
|
|
888
|
+
const s = "The Google Maps JavaScript API", n = "google", a = "importLibrary", c = "__ib__", o = document, l = window, h = l[n] || (l[n] = {}), d = h.maps || (h.maps = {}), u = /* @__PURE__ */ new Set(), _ = new URLSearchParams(), b = () => e || (e = new Promise(async (M, g) => {
|
|
889
889
|
var m;
|
|
890
|
-
await (t = o.createElement("script")),
|
|
890
|
+
await (t = o.createElement("script")), _.set("libraries", [...u] + "");
|
|
891
891
|
for (r in i)
|
|
892
|
-
|
|
893
|
-
|
|
892
|
+
_.set(r.replace(/[A-Z]/g, (v) => "_" + v[0].toLowerCase()), i[r]);
|
|
893
|
+
_.set("callback", n + ".maps." + c), t.src = `https://maps.${n}apis.com/maps/api/js?` + _, d[c] = M, 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);
|
|
894
894
|
}));
|
|
895
|
-
|
|
895
|
+
d[a] ? console.warn(s + " only loads once. Ignoring:", i) : d[a] = (M, ...g) => u.add(M) && b().then(() => d[a](M, ...g));
|
|
896
896
|
}
|
|
897
|
-
let
|
|
897
|
+
let Et;
|
|
898
898
|
const te = {
|
|
899
899
|
/** Google的坐标0点 */
|
|
900
900
|
get LATLNG_ZERO() {
|
|
901
|
-
return
|
|
901
|
+
return Et ?? (Et = new google.maps.LatLng({ lat: 0, lng: 0 }));
|
|
902
902
|
}
|
|
903
903
|
};
|
|
904
|
-
function
|
|
904
|
+
function Ft(i, e = { country: "", province: "", city: "", district: "", street: "", streetNumber: "" }) {
|
|
905
905
|
for (const t of i)
|
|
906
906
|
for (const r of t.types)
|
|
907
907
|
switch (r) {
|
|
@@ -926,9 +926,9 @@ function Wt(i, e = { country: "", province: "", city: "", district: "", street:
|
|
|
926
926
|
}
|
|
927
927
|
return e;
|
|
928
928
|
}
|
|
929
|
-
function
|
|
929
|
+
function Ut(i, e) {
|
|
930
930
|
var r;
|
|
931
|
-
const t = i.address_components &&
|
|
931
|
+
const t = i.address_components && Ft(i.address_components);
|
|
932
932
|
return {
|
|
933
933
|
country: (t == null ? void 0 : t.country) ?? "",
|
|
934
934
|
province: (t == null ? void 0 : t.province) ?? "",
|
|
@@ -939,12 +939,12 @@ function Vt(i, e) {
|
|
|
939
939
|
title: i.name ?? ""
|
|
940
940
|
};
|
|
941
941
|
}
|
|
942
|
-
class
|
|
942
|
+
class Yt {
|
|
943
943
|
}
|
|
944
|
-
class
|
|
944
|
+
class Ur extends Yt {
|
|
945
945
|
constructor(t, r) {
|
|
946
946
|
super();
|
|
947
|
-
|
|
947
|
+
p(this, "inner");
|
|
948
948
|
this.map = t, this.inner = new google.maps.places.Autocomplete(r.input, {
|
|
949
949
|
fields: [
|
|
950
950
|
"address_components",
|
|
@@ -957,7 +957,7 @@ class Vr extends Ht {
|
|
|
957
957
|
this.inner.setBounds(t.toGoogle(this.map.coordType));
|
|
958
958
|
}
|
|
959
959
|
addResultListener(t) {
|
|
960
|
-
return
|
|
960
|
+
return Gt(this.inner, "place_changed", () => {
|
|
961
961
|
const r = this.inner.getPlace(), s = {
|
|
962
962
|
title: r.name ?? "",
|
|
963
963
|
province: "",
|
|
@@ -967,17 +967,17 @@ class Vr extends Ht {
|
|
|
967
967
|
streetNumber: "",
|
|
968
968
|
country: ""
|
|
969
969
|
};
|
|
970
|
-
r.address_components &&
|
|
970
|
+
r.address_components && Ft(r.address_components, s), t(s);
|
|
971
971
|
});
|
|
972
972
|
}
|
|
973
973
|
}
|
|
974
|
-
class
|
|
974
|
+
class Yr extends Yt {
|
|
975
975
|
constructor(t, r) {
|
|
976
976
|
super();
|
|
977
|
-
|
|
978
|
-
|
|
977
|
+
p(this, "inner");
|
|
978
|
+
p(this, "input");
|
|
979
979
|
// TODO: 要不要添加个移除监听的方法?
|
|
980
|
-
|
|
980
|
+
p(this, "removeableArray", []);
|
|
981
981
|
if (this.map = t, this.input = r.input, this.inner = new BMap.Autocomplete({
|
|
982
982
|
input: r.input,
|
|
983
983
|
location: r.bindToMap ? t.innerMap : void 0
|
|
@@ -985,7 +985,7 @@ class Hr extends Ht {
|
|
|
985
985
|
const s = () => {
|
|
986
986
|
this.inner.setLocation(this.map.innerMap);
|
|
987
987
|
};
|
|
988
|
-
this.removeableArray.push(
|
|
988
|
+
this.removeableArray.push(wt(this.map, "center-changed", s)), this.removeableArray.push(wt(this.map, "zoom-changed", s));
|
|
989
989
|
}
|
|
990
990
|
}
|
|
991
991
|
setBounds(t) {
|
|
@@ -993,14 +993,14 @@ class Hr extends Ht {
|
|
|
993
993
|
}
|
|
994
994
|
addResultListener(t) {
|
|
995
995
|
let r = 0;
|
|
996
|
-
const s =
|
|
997
|
-
const
|
|
996
|
+
const s = Gr(this.inner, "confirm", (a) => {
|
|
997
|
+
const c = a.item.value;
|
|
998
998
|
r = Date.now(), t(Object.assign({
|
|
999
|
-
title:
|
|
999
|
+
title: c.business,
|
|
1000
1000
|
country: ""
|
|
1001
1001
|
// Baidu的自动完成只支持中国
|
|
1002
|
-
},
|
|
1003
|
-
}), n =
|
|
1002
|
+
}, c));
|
|
1003
|
+
}), n = Zr(this.input, "keyup", (a) => {
|
|
1004
1004
|
a.key === "Enter" && Date.now() - r > 100 && t({
|
|
1005
1005
|
title: this.input.value,
|
|
1006
1006
|
country: "",
|
|
@@ -1016,18 +1016,18 @@ class Hr extends Ht {
|
|
|
1016
1016
|
};
|
|
1017
1017
|
}
|
|
1018
1018
|
}
|
|
1019
|
-
let
|
|
1019
|
+
let Kr = class Kt {
|
|
1020
1020
|
constructor(e, t, r) {
|
|
1021
|
-
this.extend(
|
|
1021
|
+
this.extend(Kt, 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;
|
|
1022
1022
|
var s = r || {};
|
|
1023
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();
|
|
1024
1024
|
var n = this;
|
|
1025
1025
|
google.maps.event.addListener(this.map_, "zoom_changed", function() {
|
|
1026
|
-
var a = n.map_.getZoom(),
|
|
1026
|
+
var a = n.map_.getZoom(), c = n.map_.minZoom || 0, o = Math.min(
|
|
1027
1027
|
n.map_.maxZoom || 100,
|
|
1028
1028
|
n.map_.mapTypes[n.map_.getMapTypeId()].maxZoom
|
|
1029
1029
|
);
|
|
1030
|
-
a = Math.min(Math.max(a,
|
|
1030
|
+
a = Math.min(Math.max(a, c), o), n.prevZoom_ != a && (n.prevZoom_ = a, n.resetViewport());
|
|
1031
1031
|
}), google.maps.event.addListener(this.map_, "idle", function() {
|
|
1032
1032
|
n.redraw();
|
|
1033
1033
|
}), t && (t.length || Object.keys(t).length) && this.addMarkers(t, !1);
|
|
@@ -1270,8 +1270,8 @@ let Fr = class Ft {
|
|
|
1270
1270
|
*/
|
|
1271
1271
|
removeMarkers(e, t) {
|
|
1272
1272
|
for (var r = e === this.getMarkers() ? e.slice() : e, s = !1, n = 0, a; a = r[n]; n++) {
|
|
1273
|
-
var
|
|
1274
|
-
s = s ||
|
|
1273
|
+
var c = this.removeMarker_(a);
|
|
1274
|
+
s = s || c;
|
|
1275
1275
|
}
|
|
1276
1276
|
if (!t && s)
|
|
1277
1277
|
return this.resetViewport(), this.redraw(), !0;
|
|
@@ -1358,8 +1358,8 @@ let Fr = class Ft {
|
|
|
1358
1358
|
n.x += this.gridSize_, n.y -= this.gridSize_;
|
|
1359
1359
|
var a = t.fromLatLngToDivPixel(s);
|
|
1360
1360
|
a.x -= this.gridSize_, a.y += this.gridSize_;
|
|
1361
|
-
var
|
|
1362
|
-
return e.extend(
|
|
1361
|
+
var c = t.fromDivPixelToLatLng(n), o = t.fromDivPixelToLatLng(a);
|
|
1362
|
+
return e.extend(c), e.extend(o), e;
|
|
1363
1363
|
}
|
|
1364
1364
|
/**
|
|
1365
1365
|
* Determins if a marker is contained in a bounds.
|
|
@@ -1417,7 +1417,7 @@ let Fr = class Ft {
|
|
|
1417
1417
|
distanceBetweenPoints_(e, t) {
|
|
1418
1418
|
if (!e || !t)
|
|
1419
1419
|
return 0;
|
|
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),
|
|
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), c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)), o = r * c;
|
|
1421
1421
|
return o;
|
|
1422
1422
|
}
|
|
1423
1423
|
/**
|
|
@@ -1430,14 +1430,14 @@ let Fr = class Ft {
|
|
|
1430
1430
|
for (var t = 4e4, r = null, s = 0, n; n = this.clusters_[s]; s++) {
|
|
1431
1431
|
var a = n.getCenter();
|
|
1432
1432
|
if (a) {
|
|
1433
|
-
var
|
|
1434
|
-
|
|
1433
|
+
var c = this.distanceBetweenPoints_(a, e.getPosition());
|
|
1434
|
+
c < t && (t = c, r = n);
|
|
1435
1435
|
}
|
|
1436
1436
|
}
|
|
1437
1437
|
if (r && r.isMarkerInClusterBounds(e))
|
|
1438
1438
|
r.addMarker(e);
|
|
1439
1439
|
else {
|
|
1440
|
-
var o = new
|
|
1440
|
+
var o = new qr(this);
|
|
1441
1441
|
o.addMarker(e), this.clusters_.push(o);
|
|
1442
1442
|
}
|
|
1443
1443
|
}
|
|
@@ -1454,9 +1454,9 @@ let Fr = class Ft {
|
|
|
1454
1454
|
), t = this.getExtendedBounds(e), r = 0, s; s = this.markers_[r]; r++)
|
|
1455
1455
|
!s.isAdded && this.isMarkerInBounds_(s, t) && this.addToClosestCluster_(s);
|
|
1456
1456
|
}
|
|
1457
|
-
},
|
|
1457
|
+
}, qr = class {
|
|
1458
1458
|
constructor(e) {
|
|
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
|
|
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 tt(
|
|
1460
1460
|
this,
|
|
1461
1461
|
e.getStyles(),
|
|
1462
1462
|
e.getGridSize()
|
|
@@ -1590,9 +1590,9 @@ let Fr = class Ft {
|
|
|
1590
1590
|
this.clusterIcon_.setCenter(this.center_), this.clusterIcon_.setSums(a), this.clusterIcon_.show();
|
|
1591
1591
|
}
|
|
1592
1592
|
};
|
|
1593
|
-
class
|
|
1593
|
+
class tt {
|
|
1594
1594
|
constructor(e, t, r) {
|
|
1595
|
-
e.getMarkerClusterer().extend(
|
|
1595
|
+
e.getMarkerClusterer().extend(tt, google.maps.OverlayView), this.styles_ = t, this.padding_ = r || 0, this.cluster_ = e, this.center_ = null, this.map_ = e.getMap(), this.div_ = null, this.sums_ = null, this.visible_ = !1, this.setMap(this.map_);
|
|
1596
1596
|
}
|
|
1597
1597
|
/**
|
|
1598
1598
|
* Triggers the clusterclick event and zoom's if the option is set.
|
|
@@ -1723,18 +1723,18 @@ class Qe {
|
|
|
1723
1723
|
), t.join("");
|
|
1724
1724
|
}
|
|
1725
1725
|
}
|
|
1726
|
-
var
|
|
1726
|
+
var Ve = {}, Xr = {
|
|
1727
1727
|
get exports() {
|
|
1728
|
-
return
|
|
1728
|
+
return Ve;
|
|
1729
1729
|
},
|
|
1730
1730
|
set exports(i) {
|
|
1731
|
-
|
|
1731
|
+
Ve = i;
|
|
1732
1732
|
}
|
|
1733
1733
|
};
|
|
1734
1734
|
(function(i, e) {
|
|
1735
1735
|
(function(t, r) {
|
|
1736
1736
|
i.exports = r();
|
|
1737
|
-
})(
|
|
1737
|
+
})(At, function() {
|
|
1738
1738
|
var t, r = t = r || { version: "1.3.8" }, s = {};
|
|
1739
1739
|
r.guid = "$BAIDU$", s[r.guid] = s[r.guid] || {}, r.dom = r.dom || {}, r.dom.g = function(o) {
|
|
1740
1740
|
return typeof o == "string" || o instanceof String ? document.getElementById(o) : o && o.nodeName && (o.nodeType == 1 || o.nodeType == 9) ? o : null;
|
|
@@ -1746,11 +1746,11 @@ var je = {}, Yr = {
|
|
|
1746
1746
|
return r.lang.isString(o) ? document.getElementById(o) : o;
|
|
1747
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) {
|
|
1748
1748
|
o = r.dom._g(o);
|
|
1749
|
-
var h = r.dom.getDocument(o),
|
|
1750
|
-
return h.defaultView && h.defaultView.getComputedStyle && (
|
|
1749
|
+
var h = r.dom.getDocument(o), d;
|
|
1750
|
+
return h.defaultView && h.defaultView.getComputedStyle && (d = h.defaultView.getComputedStyle(o, null), d) ? d[l] || d.getPropertyValue(l) : "";
|
|
1751
1751
|
}, r.dom._styleFixer = r.dom._styleFixer || {}, r.dom._styleFilter = r.dom._styleFilter || [], r.dom._styleFilter.filter = function(o, l, h) {
|
|
1752
|
-
for (var
|
|
1753
|
-
(
|
|
1752
|
+
for (var d = 0, u = r.dom._styleFilter, _; _ = u[d]; d++)
|
|
1753
|
+
(_ = _[h]) && (l = _(o, l));
|
|
1754
1754
|
return l;
|
|
1755
1755
|
}, r.string = r.string || {}, r.string.toCamelCase = function(o) {
|
|
1756
1756
|
return o.indexOf("-") < 0 && o.indexOf("_") < 0 ? o : o.replace(/[-_][^-_]/g, function(l) {
|
|
@@ -1759,42 +1759,42 @@ var je = {}, Yr = {
|
|
|
1759
1759
|
}, r.dom.getStyle = function(o, l) {
|
|
1760
1760
|
var h = r.dom;
|
|
1761
1761
|
o = h.g(o), l = r.string.toCamelCase(l);
|
|
1762
|
-
var
|
|
1763
|
-
if (!
|
|
1762
|
+
var d = o.style[l] || (o.currentStyle ? o.currentStyle[l] : "") || h.getComputedStyle(o, l);
|
|
1763
|
+
if (!d) {
|
|
1764
1764
|
var u = h._styleFixer[l];
|
|
1765
|
-
u && (
|
|
1765
|
+
u && (d = u.get ? u.get(o) : r.dom.getStyle(o, u));
|
|
1766
1766
|
}
|
|
1767
|
-
return (u = h._styleFilter) && (
|
|
1767
|
+
return (u = h._styleFilter) && (d = u.filter(l, d, "get")), d;
|
|
1768
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) {
|
|
1769
1769
|
o = r.dom.g(o);
|
|
1770
|
-
var l = r.dom.getDocument(o), h = r.browser,
|
|
1771
|
-
h.isGecko > 0 && l.getBoxObjectFor &&
|
|
1772
|
-
var u = { left: 0, top: 0 },
|
|
1773
|
-
if (o ==
|
|
1770
|
+
var l = r.dom.getDocument(o), h = r.browser, d = r.dom.getStyle;
|
|
1771
|
+
h.isGecko > 0 && l.getBoxObjectFor && d(o, "position") == "absolute" && (o.style.top === "" || o.style.left);
|
|
1772
|
+
var u = { left: 0, top: 0 }, _ = h.ie && !h.isStrict ? l.body : l.documentElement, b, M;
|
|
1773
|
+
if (o == _)
|
|
1774
1774
|
return u;
|
|
1775
1775
|
if (o.getBoundingClientRect) {
|
|
1776
|
-
|
|
1777
|
-
var g = l.body, m = parseInt(
|
|
1776
|
+
M = o.getBoundingClientRect(), u.left = Math.floor(M.left) + Math.max(l.documentElement.scrollLeft, l.body.scrollLeft), u.top = Math.floor(M.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(d(g, "borderLeftWidth")), v = parseInt(d(g, "borderTopWidth"));
|
|
1778
1778
|
h.ie && !h.isStrict && (u.left -= isNaN(m) ? 2 : m, u.top -= isNaN(v) ? 2 : v);
|
|
1779
1779
|
} else {
|
|
1780
1780
|
b = o;
|
|
1781
1781
|
do {
|
|
1782
|
-
if (u.left += b.offsetLeft, u.top += b.offsetTop, h.isWebkit > 0 &&
|
|
1782
|
+
if (u.left += b.offsetLeft, u.top += b.offsetTop, h.isWebkit > 0 && d(b, "position") == "fixed") {
|
|
1783
1783
|
u.left += l.body.scrollLeft, u.top += l.body.scrollTop;
|
|
1784
1784
|
break;
|
|
1785
1785
|
}
|
|
1786
1786
|
b = b.offsetParent;
|
|
1787
1787
|
} while (b && b != o);
|
|
1788
|
-
for ((h.opera > 0 || h.isWebkit > 0 &&
|
|
1788
|
+
for ((h.opera > 0 || h.isWebkit > 0 && d(o, "position") == "absolute") && (u.top -= l.body.offsetTop), b = o.offsetParent; b && b != l.body; )
|
|
1789
1789
|
u.left -= b.scrollLeft, (!h.opera || b.tagName != "TR") && (u.top -= b.scrollTop), b = b.offsetParent;
|
|
1790
1790
|
}
|
|
1791
1791
|
return u;
|
|
1792
1792
|
}, r.event = r.event || {}, r.event._listeners = r.event._listeners || [], r.event.on = function(o, l, h) {
|
|
1793
1793
|
l = l.replace(/^on/i, ""), o = r.dom._g(o);
|
|
1794
|
-
var
|
|
1794
|
+
var d = function(g) {
|
|
1795
1795
|
h.call(o, g);
|
|
1796
|
-
}, u = r.event._listeners,
|
|
1797
|
-
return l = l.toLowerCase(),
|
|
1796
|
+
}, u = r.event._listeners, _ = r.event._eventFilter, b, M = l;
|
|
1797
|
+
return l = l.toLowerCase(), _ && _[l] && (b = _[l](o, l, d), M = b.type, d = b.listener), o.addEventListener ? o.addEventListener(M, d, !1) : o.attachEvent && o.attachEvent("on" + M, d), u[u.length] = [o, l, h, d, M], o;
|
|
1798
1798
|
}, r.on = r.event.on, function() {
|
|
1799
1799
|
var o = s[r.guid];
|
|
1800
1800
|
r.lang.guid = function() {
|
|
@@ -1816,13 +1816,13 @@ var je = {}, Yr = {
|
|
|
1816
1816
|
}, r.lang.Class.prototype.addEventListener = function(o, l, h) {
|
|
1817
1817
|
if (r.lang.isFunction(l)) {
|
|
1818
1818
|
!this.__listeners && (this.__listeners = {});
|
|
1819
|
-
var
|
|
1819
|
+
var d = this.__listeners, u;
|
|
1820
1820
|
if (typeof h == "string" && h) {
|
|
1821
1821
|
if (/[^\w\-]/.test(h))
|
|
1822
1822
|
throw "nonstandard key:" + h;
|
|
1823
1823
|
l.hashCode = h, u = h;
|
|
1824
1824
|
}
|
|
1825
|
-
o.indexOf("on") != 0 && (o = "on" + o), typeof
|
|
1825
|
+
o.indexOf("on") != 0 && (o = "on" + o), typeof d[o] != "object" && (d[o] = {}), u = u || r.lang.guid(), l.hashCode = u, d[o][u] = l;
|
|
1826
1826
|
}
|
|
1827
1827
|
}, r.lang.Class.prototype.removeEventListener = function(o, l) {
|
|
1828
1828
|
if (!(typeof l < "u" && (r.lang.isFunction(l) && !(l = l.hashCode) || !r.lang.isString(l)))) {
|
|
@@ -1832,115 +1832,115 @@ var je = {}, Yr = {
|
|
|
1832
1832
|
if (typeof l < "u")
|
|
1833
1833
|
h[o][l] && delete h[o][l];
|
|
1834
1834
|
else
|
|
1835
|
-
for (var
|
|
1836
|
-
delete h[o][
|
|
1835
|
+
for (var d in h[o])
|
|
1836
|
+
delete h[o][d];
|
|
1837
1837
|
}
|
|
1838
1838
|
}, r.lang.Class.prototype.dispatchEvent = function(o, l) {
|
|
1839
1839
|
r.lang.isString(o) && (o = new r.lang.Event(o)), !this.__listeners && (this.__listeners = {}), l = l || {};
|
|
1840
1840
|
for (var h in l)
|
|
1841
1841
|
o[h] = l[h];
|
|
1842
|
-
var h,
|
|
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
|
|
1844
|
-
for (h in
|
|
1845
|
-
|
|
1842
|
+
var h, d = 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 d[u] == "object")
|
|
1844
|
+
for (h in d[u])
|
|
1845
|
+
d[u][h].apply(this, arguments);
|
|
1846
1846
|
return o.returnValue;
|
|
1847
1847
|
}, r.lang.inherits = function(o, l, h) {
|
|
1848
|
-
var
|
|
1848
|
+
var d, u, _ = o.prototype, b = new Function();
|
|
1849
1849
|
b.prototype = l.prototype, u = o.prototype = new b();
|
|
1850
|
-
for (
|
|
1851
|
-
u[
|
|
1850
|
+
for (d in _)
|
|
1851
|
+
u[d] = _[d];
|
|
1852
1852
|
o.prototype.constructor = o, o.superClass = l.prototype, typeof h == "string" && (u._className = h);
|
|
1853
1853
|
}, r.inherits = r.lang.inherits;
|
|
1854
|
-
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", c = function(o, l, h) {
|
|
1855
1855
|
try {
|
|
1856
1856
|
BMap;
|
|
1857
1857
|
} catch {
|
|
1858
1858
|
throw Error("Baidu Map JS API is not ready yet!");
|
|
1859
1859
|
}
|
|
1860
|
-
t.lang.inherits(
|
|
1860
|
+
t.lang.inherits(c, BMap.Overlay, "TextIconOverlay"), this._position = o, this._text = l, this._options = h || {}, this._styles = this._options.styles || [], this._zIndex = this._options.zIndex, !this._styles.length && this._setupDefaultStyles();
|
|
1861
1861
|
};
|
|
1862
|
-
return
|
|
1862
|
+
return c.prototype._setupDefaultStyles = function() {
|
|
1863
1863
|
for (var o = [53, 56, 66, 78, 90], l = 0, h; h = o[l]; l++)
|
|
1864
1864
|
this._styles.push({
|
|
1865
1865
|
url: n + l + "." + a,
|
|
1866
1866
|
size: new BMap.Size(h, h)
|
|
1867
1867
|
});
|
|
1868
|
-
},
|
|
1868
|
+
}, c.prototype.initialize = function(o) {
|
|
1869
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;
|
|
1870
|
-
},
|
|
1870
|
+
}, c.prototype.draw = function() {
|
|
1871
1871
|
this._map && this._updatePosition();
|
|
1872
|
-
},
|
|
1872
|
+
}, c.prototype.getText = function() {
|
|
1873
1873
|
return this._text;
|
|
1874
|
-
},
|
|
1874
|
+
}, c.prototype.setText = function(o) {
|
|
1875
1875
|
o && (!this._text || this._text.toString() != o.toString()) && (this._text = o, this._updateText(), this._updateCss(), this._updatePosition());
|
|
1876
|
-
},
|
|
1876
|
+
}, c.prototype.getPosition = function() {
|
|
1877
1877
|
return this._position;
|
|
1878
|
-
},
|
|
1878
|
+
}, c.prototype.setPosition = function(o) {
|
|
1879
1879
|
o && (!this._position || !this._position.equals(o)) && (this._position = o, this._updatePosition());
|
|
1880
|
-
},
|
|
1881
|
-
var h = parseInt(o),
|
|
1882
|
-
return
|
|
1883
|
-
},
|
|
1880
|
+
}, c.prototype.getStyleByText = function(o, l) {
|
|
1881
|
+
var h = parseInt(o), d = parseInt(h / 10);
|
|
1882
|
+
return d = Math.max(0, d), d = Math.min(d, l.length - 1), l[d];
|
|
1883
|
+
}, c.prototype._updateCss = function() {
|
|
1884
1884
|
if (this._domElement) {
|
|
1885
1885
|
var o = this.getStyleByText(this._text, this._styles);
|
|
1886
1886
|
this._domElement.style.cssText = this._buildCssText(o);
|
|
1887
1887
|
}
|
|
1888
|
-
},
|
|
1888
|
+
}, c.prototype._updateText = function() {
|
|
1889
1889
|
this._domElement && (this._domElement.innerHTML = this._text);
|
|
1890
|
-
},
|
|
1890
|
+
}, c.prototype._updatePosition = function() {
|
|
1891
1891
|
if (this._domElement && this._position) {
|
|
1892
1892
|
var o = this._domElement.style, l = this._map.pointToOverlayPixel(this._position);
|
|
1893
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";
|
|
1894
1894
|
}
|
|
1895
|
-
},
|
|
1896
|
-
var l = o.url, h = o.size,
|
|
1897
|
-
if (this._zIndex &&
|
|
1898
|
-
|
|
1895
|
+
}, c.prototype._buildCssText = function(o) {
|
|
1896
|
+
var l = o.url, h = o.size, d = o.anchor, u = o.offset, _ = o.textColor || "black", b = o.textSize || 10, M = [];
|
|
1897
|
+
if (this._zIndex && M.push("z-index:" + this._zIndex + ";"), t.browser.ie < 7)
|
|
1898
|
+
M.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="' + l + '");');
|
|
1899
1899
|
else {
|
|
1900
|
-
|
|
1900
|
+
M.push("background-image:url(" + l + ");");
|
|
1901
1901
|
var g = "0 0";
|
|
1902
|
-
u instanceof BMap.Size && (g = u.width + "px " + u.height + "px"),
|
|
1902
|
+
u instanceof BMap.Size && (g = u.width + "px " + u.height + "px"), M.push("background-position:" + g + ";");
|
|
1903
1903
|
}
|
|
1904
|
-
return h instanceof BMap.Size && (
|
|
1905
|
-
},
|
|
1904
|
+
return h instanceof BMap.Size && (d instanceof BMap.Size ? (d.height > 0 && d.height < h.height && M.push("height:" + (h.height - d.height) + "px; padding-top:" + d.height + "px;"), d.width > 0 && d.width < h.width && M.push("width:" + (h.width - d.width) + "px; padding-left:" + d.width + "px;")) : (M.push("height:" + h.height + "px; line-height:" + h.height + "px;"), M.push("width:" + h.width + "px; text-align:center;"))), M.push("cursor:pointer; color:" + _ + "; position:absolute; font-size:" + b + "px; font-family:Arial,sans-serif; font-weight:bold"), M.join("");
|
|
1905
|
+
}, c.prototype._bind = function() {
|
|
1906
1906
|
if (!this._domElement)
|
|
1907
1907
|
return;
|
|
1908
1908
|
var o = this, l = this._map, h = t.lang.Event;
|
|
1909
|
-
function
|
|
1910
|
-
var b = u.srcElement || u.target,
|
|
1911
|
-
if (u &&
|
|
1909
|
+
function d(u, _) {
|
|
1910
|
+
var b = u.srcElement || u.target, M = u.clientX || u.pageX, g = u.clientY || u.pageY;
|
|
1911
|
+
if (u && _ && M && g && b) {
|
|
1912
1912
|
var m = t.dom.getPosition(l.getContainer());
|
|
1913
|
-
|
|
1913
|
+
_.pixel = new BMap.Pixel(M - m.left, g - m.top), _.point = l.pixelToPoint(_.pixel);
|
|
1914
1914
|
}
|
|
1915
|
-
return
|
|
1915
|
+
return _;
|
|
1916
1916
|
}
|
|
1917
1917
|
t.event.on(this._domElement, "mouseover", function(u) {
|
|
1918
|
-
o.dispatchEvent(
|
|
1918
|
+
o.dispatchEvent(d(u, new h("onmouseover")));
|
|
1919
1919
|
}), t.event.on(this._domElement, "mouseout", function(u) {
|
|
1920
|
-
o.dispatchEvent(
|
|
1920
|
+
o.dispatchEvent(d(u, new h("onmouseout")));
|
|
1921
1921
|
}), t.event.on(this._domElement, "click", function(u) {
|
|
1922
|
-
o.dispatchEvent(
|
|
1922
|
+
o.dispatchEvent(d(u, new h("onclick")));
|
|
1923
1923
|
});
|
|
1924
|
-
},
|
|
1924
|
+
}, c;
|
|
1925
1925
|
});
|
|
1926
|
-
})(
|
|
1927
|
-
const
|
|
1928
|
-
var
|
|
1929
|
-
e =
|
|
1926
|
+
})(Xr);
|
|
1927
|
+
const Lt = Ve;
|
|
1928
|
+
var qt = function(i, e, t) {
|
|
1929
|
+
e = Jr(e);
|
|
1930
1930
|
var r = i.pointToPixel(e.getNorthEast()), s = i.pointToPixel(e.getSouthWest());
|
|
1931
1931
|
r.x += t, r.y -= t, s.x -= t, s.y += t;
|
|
1932
1932
|
var n = i.pixelToPoint(r), a = i.pixelToPoint(s);
|
|
1933
1933
|
return new BMap.Bounds(a, n);
|
|
1934
|
-
},
|
|
1934
|
+
}, Jr = function(i) {
|
|
1935
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);
|
|
1936
1936
|
return new BMap.Bounds(new BMap.Point(t, s), new BMap.Point(e, r));
|
|
1937
1937
|
}, be = function(i, e, t) {
|
|
1938
1938
|
return e && (i = Math.max(i, e)), t && (i = Math.min(i, t)), i;
|
|
1939
|
-
},
|
|
1939
|
+
}, Xt = function(i) {
|
|
1940
1940
|
return Object.prototype.toString.call(i) === "[object Array]";
|
|
1941
|
-
},
|
|
1941
|
+
}, Jt = function(i, e) {
|
|
1942
1942
|
var t = -1;
|
|
1943
|
-
if (
|
|
1943
|
+
if (Xt(e)) {
|
|
1944
1944
|
if (e.indexOf)
|
|
1945
1945
|
t = e.indexOf(i);
|
|
1946
1946
|
else
|
|
@@ -1968,7 +1968,7 @@ var Ut = function(i, e, t) {
|
|
|
1968
1968
|
r._redraw();
|
|
1969
1969
|
});
|
|
1970
1970
|
var s = t.markers;
|
|
1971
|
-
|
|
1971
|
+
Xt(s) && this.addMarkers(s);
|
|
1972
1972
|
}
|
|
1973
1973
|
};
|
|
1974
1974
|
T.prototype.addMarkers = function(i) {
|
|
@@ -1979,7 +1979,7 @@ T.prototype.addMarkers = function(i) {
|
|
|
1979
1979
|
}
|
|
1980
1980
|
};
|
|
1981
1981
|
T.prototype._pushMarkerTo = function(i) {
|
|
1982
|
-
var e =
|
|
1982
|
+
var e = Jt(i, this._markers);
|
|
1983
1983
|
e === -1 && (i.isInCluster = !1, this._markers.push(i));
|
|
1984
1984
|
};
|
|
1985
1985
|
T.prototype.addMarker = function(i) {
|
|
@@ -1988,7 +1988,7 @@ T.prototype.addMarker = function(i) {
|
|
|
1988
1988
|
T.prototype._createClusters = function() {
|
|
1989
1989
|
var i = this._map.getBounds();
|
|
1990
1990
|
if (i.getCenter()) {
|
|
1991
|
-
for (var e =
|
|
1991
|
+
for (var e = qt(this._map, i, this._gridSize), t = 0, r; r = this._markers[t]; t++)
|
|
1992
1992
|
!r.isInCluster && e.containsPoint(r.getPosition()) && this._addToClosestCluster(r);
|
|
1993
1993
|
for (var s = this._markers.length, t = 0; t < s; t++)
|
|
1994
1994
|
this._clusters[t] && this._clusters[t].render();
|
|
@@ -2028,7 +2028,7 @@ T.prototype._removeMarkersFromMap = function() {
|
|
|
2028
2028
|
}
|
|
2029
2029
|
};
|
|
2030
2030
|
T.prototype._removeMarker = function(i) {
|
|
2031
|
-
var e =
|
|
2031
|
+
var e = Jt(i, this._markers);
|
|
2032
2032
|
return e === -1 ? !1 : (this._map.removeOverlay(i), this._markers.splice(e, 1), !0);
|
|
2033
2033
|
};
|
|
2034
2034
|
T.prototype.removeMarker = function(i) {
|
|
@@ -2104,7 +2104,7 @@ T.prototype.setStylesIndexCalculator = function(i) {
|
|
|
2104
2104
|
};
|
|
2105
2105
|
function S(i) {
|
|
2106
2106
|
var e = this;
|
|
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
|
|
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 Lt(this._center, this._markers.length, {
|
|
2108
2108
|
styles: this._markerClusterer.getStyles(),
|
|
2109
2109
|
zIndex: i._zIndex
|
|
2110
2110
|
}), this._clusterMarker.getStyleByText = function(t, r) {
|
|
@@ -2112,7 +2112,7 @@ function S(i) {
|
|
|
2112
2112
|
var s = e._markerClusterer._stylesIndexCalculator(e._markers, r.length);
|
|
2113
2113
|
return r[s];
|
|
2114
2114
|
}
|
|
2115
|
-
return
|
|
2115
|
+
return Lt.prototype.getStyleByText.call(this, t, r);
|
|
2116
2116
|
}, this._clusterMarker.addEventListener && this._clusterMarker.addEventListener("click", function(t) {
|
|
2117
2117
|
e._map.setViewport(e.getBounds());
|
|
2118
2118
|
});
|
|
@@ -2152,7 +2152,7 @@ S.prototype.isReal = function(i) {
|
|
|
2152
2152
|
};
|
|
2153
2153
|
S.prototype.updateGridBounds = function() {
|
|
2154
2154
|
var i = new BMap.Bounds(this._center, this._center);
|
|
2155
|
-
this._gridBounds =
|
|
2155
|
+
this._gridBounds = qt(this._map, i, this._markerClusterer.getGridSize());
|
|
2156
2156
|
};
|
|
2157
2157
|
S.prototype.updateClusterMarker = function() {
|
|
2158
2158
|
if (this._map.getZoom() > this._markerClusterer.getMaxZoom()) {
|
|
@@ -2208,9 +2208,9 @@ var Le;
|
|
|
2208
2208
|
}
|
|
2209
2209
|
i.toGoogle = t;
|
|
2210
2210
|
})(Le || (Le = {}));
|
|
2211
|
-
class
|
|
2211
|
+
class Qt {
|
|
2212
2212
|
constructor(e) {
|
|
2213
|
-
|
|
2213
|
+
p(this, "inner");
|
|
2214
2214
|
this.map = e;
|
|
2215
2215
|
}
|
|
2216
2216
|
/** baidu/google 拥有相同的函数名 */
|
|
@@ -2234,7 +2234,7 @@ class Kt {
|
|
|
2234
2234
|
return this.inner.removeMarkers(e.map((t) => t.innerOverlay));
|
|
2235
2235
|
}
|
|
2236
2236
|
}
|
|
2237
|
-
class
|
|
2237
|
+
class Qr extends Qt {
|
|
2238
2238
|
constructor(e, t) {
|
|
2239
2239
|
var s;
|
|
2240
2240
|
super(e), this.inner = new T(e.innerMap, {
|
|
@@ -2254,10 +2254,10 @@ class Kr extends Kt {
|
|
|
2254
2254
|
this.inner._redraw();
|
|
2255
2255
|
}
|
|
2256
2256
|
}
|
|
2257
|
-
class
|
|
2257
|
+
class ei extends Qt {
|
|
2258
2258
|
constructor(e, t) {
|
|
2259
2259
|
var s, n;
|
|
2260
|
-
super(e), this.inner = new
|
|
2260
|
+
super(e), this.inner = new Kr(
|
|
2261
2261
|
e.innerMap,
|
|
2262
2262
|
// google的构造器中的markers,不会触发重绘, 第一次绘制通过监听地图的'idle'事件触发, 可以直接设置
|
|
2263
2263
|
(s = t.markers) == null ? void 0 : s.map((a) => a.innerOverlay),
|
|
@@ -2271,24 +2271,24 @@ class Xr extends Kt {
|
|
|
2271
2271
|
}
|
|
2272
2272
|
);
|
|
2273
2273
|
const r = t.stylesIndexCalculator;
|
|
2274
|
-
r && this.inner.setCalculator((a,
|
|
2274
|
+
r && this.inner.setCalculator((a, c) => ({
|
|
2275
2275
|
text: a.length,
|
|
2276
2276
|
// google内部, 取index时, 会`-1`...故我们这里`+1`, 抵消掉它
|
|
2277
|
-
index: r(a.length,
|
|
2277
|
+
index: r(a.length, c) + 1
|
|
2278
2278
|
}));
|
|
2279
2279
|
}
|
|
2280
2280
|
recreate() {
|
|
2281
2281
|
this.inner.repaint();
|
|
2282
2282
|
}
|
|
2283
2283
|
}
|
|
2284
|
-
class
|
|
2284
|
+
class er {
|
|
2285
2285
|
constructor() {
|
|
2286
2286
|
}
|
|
2287
2287
|
}
|
|
2288
|
-
class
|
|
2288
|
+
class ti extends er {
|
|
2289
2289
|
constructor(t, r) {
|
|
2290
2290
|
super();
|
|
2291
|
-
|
|
2291
|
+
p(this, "inner");
|
|
2292
2292
|
this.map = t, this.inner = new google.maps.places.PlacesService(t.innerMap);
|
|
2293
2293
|
}
|
|
2294
2294
|
search(t, r) {
|
|
@@ -2315,27 +2315,27 @@ class Jr extends Xt {
|
|
|
2315
2315
|
// 'address_components', // TODO: 2023/04/28 ipcjs 查询请求不支持该字段...
|
|
2316
2316
|
],
|
|
2317
2317
|
locationBias: r
|
|
2318
|
-
}, (a,
|
|
2319
|
-
switch (
|
|
2318
|
+
}, (a, c) => {
|
|
2319
|
+
switch (c) {
|
|
2320
2320
|
case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:
|
|
2321
2321
|
case google.maps.places.PlacesServiceStatus.OK: {
|
|
2322
|
-
const o = (a ?? []).map((l) =>
|
|
2322
|
+
const o = (a ?? []).map((l) => Ut(l, this.map));
|
|
2323
2323
|
s(o);
|
|
2324
2324
|
break;
|
|
2325
2325
|
}
|
|
2326
2326
|
default:
|
|
2327
|
-
n(new Error(`status: ${
|
|
2327
|
+
n(new Error(`status: ${c}`));
|
|
2328
2328
|
break;
|
|
2329
2329
|
}
|
|
2330
2330
|
});
|
|
2331
2331
|
});
|
|
2332
2332
|
}
|
|
2333
2333
|
}
|
|
2334
|
-
class
|
|
2334
|
+
class ri extends er {
|
|
2335
2335
|
constructor(t, r) {
|
|
2336
2336
|
super();
|
|
2337
|
-
|
|
2338
|
-
|
|
2337
|
+
p(this, "searchRequestMap", /* @__PURE__ */ new Map());
|
|
2338
|
+
p(this, "currentSearch");
|
|
2339
2339
|
this.map = t;
|
|
2340
2340
|
}
|
|
2341
2341
|
get inner() {
|
|
@@ -2362,23 +2362,23 @@ class Qr extends Xt {
|
|
|
2362
2362
|
newSearch(t, r) {
|
|
2363
2363
|
return new Promise((s, n) => {
|
|
2364
2364
|
const a = new BMap.LocalSearch(t ?? this.map.innerMap, {
|
|
2365
|
-
onSearchComplete: (
|
|
2366
|
-
Array.isArray(
|
|
2365
|
+
onSearchComplete: (c) => {
|
|
2366
|
+
Array.isArray(c) && $t("当前只支持一次搜索一条数据");
|
|
2367
2367
|
const o = a.getStatus();
|
|
2368
2368
|
switch (o) {
|
|
2369
2369
|
case BMAP_STATUS_SUCCESS: {
|
|
2370
2370
|
const l = [];
|
|
2371
|
-
for (let h = 0; h <
|
|
2372
|
-
const
|
|
2371
|
+
for (let h = 0; h < c.getCurrentNumPois(); h++) {
|
|
2372
|
+
const d = c.getPoi(h);
|
|
2373
2373
|
l.push({
|
|
2374
|
-
id:
|
|
2375
|
-
city:
|
|
2374
|
+
id: d.uid,
|
|
2375
|
+
city: d.city,
|
|
2376
2376
|
country: "",
|
|
2377
2377
|
// 百度地图只支持中国
|
|
2378
|
-
position: y.fromBaidu(
|
|
2379
|
-
province:
|
|
2380
|
-
title:
|
|
2381
|
-
address:
|
|
2378
|
+
position: y.fromBaidu(d.point, this.map.coordType),
|
|
2379
|
+
province: d.province,
|
|
2380
|
+
title: d.title,
|
|
2381
|
+
address: d.address
|
|
2382
2382
|
});
|
|
2383
2383
|
}
|
|
2384
2384
|
s(l);
|
|
@@ -2397,10 +2397,10 @@ class Qr extends Xt {
|
|
|
2397
2397
|
});
|
|
2398
2398
|
}
|
|
2399
2399
|
}
|
|
2400
|
-
class
|
|
2400
|
+
class tr {
|
|
2401
2401
|
constructor(e, t) {
|
|
2402
|
-
|
|
2403
|
-
|
|
2402
|
+
p(this, "onData");
|
|
2403
|
+
p(this, "onError");
|
|
2404
2404
|
this.map = e, this.input = t;
|
|
2405
2405
|
}
|
|
2406
2406
|
/**
|
|
@@ -2409,30 +2409,30 @@ class Jt {
|
|
|
2409
2409
|
* @mustCallSuper 子类必须调用一次`super.setSearchListener`, 用来保存{@link onData}和{@link onError}
|
|
2410
2410
|
* */
|
|
2411
2411
|
setSearchListener(e, t) {
|
|
2412
|
-
return this.onData && C("setSearchListener只能调用一次"), this.onData = e, this.onError = t,
|
|
2412
|
+
return this.onData && C("setSearchListener只能调用一次"), this.onData = e, this.onError = t, ue;
|
|
2413
2413
|
}
|
|
2414
2414
|
}
|
|
2415
|
-
class
|
|
2415
|
+
class ii extends tr {
|
|
2416
2416
|
constructor(t, r) {
|
|
2417
2417
|
super(t, r.input);
|
|
2418
|
-
|
|
2418
|
+
p(this, "searchBox");
|
|
2419
2419
|
this.searchBox = new google.maps.places.SearchBox(r.input), this.searchBox.bindTo("bounds", t.innerMap);
|
|
2420
2420
|
}
|
|
2421
2421
|
setSearchListener(t, r) {
|
|
2422
|
-
return super.setSearchListener(t, r),
|
|
2422
|
+
return super.setSearchListener(t, r), Gt(this.searchBox, "places_changed", () => {
|
|
2423
2423
|
const s = this.searchBox.getPlaces();
|
|
2424
|
-
t((s ?? []).map((n) =>
|
|
2424
|
+
t((s ?? []).map((n) => Ut(n, this.map)));
|
|
2425
2425
|
});
|
|
2426
2426
|
}
|
|
2427
2427
|
search() {
|
|
2428
2428
|
this.input.value && (google.maps.event.trigger(this.input, "focus", {}), google.maps.event.trigger(this.input, "keydown", { keyCode: 13 }));
|
|
2429
2429
|
}
|
|
2430
2430
|
}
|
|
2431
|
-
class
|
|
2431
|
+
class si extends tr {
|
|
2432
2432
|
constructor(t, r) {
|
|
2433
2433
|
super(t, r.input);
|
|
2434
|
-
|
|
2435
|
-
|
|
2434
|
+
p(this, "autocomplete");
|
|
2435
|
+
p(this, "placeService");
|
|
2436
2436
|
this.autocomplete = t.createAutocomplete({ input: r.input, bindToMap: !0 }), this.placeService = t.createPlaceService({});
|
|
2437
2437
|
}
|
|
2438
2438
|
setSearchListener(t, r) {
|
|
@@ -2447,12 +2447,12 @@ class ti extends Jt {
|
|
|
2447
2447
|
this.placeService.search(t).then(this.onData, this.onError);
|
|
2448
2448
|
}
|
|
2449
2449
|
}
|
|
2450
|
-
var
|
|
2451
|
-
class
|
|
2450
|
+
var ni = /* @__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))(ni || {});
|
|
2451
|
+
class rt {
|
|
2452
2452
|
constructor(e) {
|
|
2453
|
-
|
|
2453
|
+
p(this, "latestInfoWindow");
|
|
2454
2454
|
/** 使用{@link setEventTargetDelegate}初始化 */
|
|
2455
|
-
|
|
2455
|
+
p(this, "delegate", void 0);
|
|
2456
2456
|
this.element = e, process.env.NODE_ENV !== "production" && setTimeout(() => {
|
|
2457
2457
|
this.delegate || console.warn(`${this.constructor.name}继承了AbstractMap, 但未调用setEventTargetDelegate(delegate)`);
|
|
2458
2458
|
});
|
|
@@ -2500,7 +2500,7 @@ class et {
|
|
|
2500
2500
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
2501
2501
|
* Released under the MIT License.
|
|
2502
2502
|
*/
|
|
2503
|
-
function
|
|
2503
|
+
function oi(i) {
|
|
2504
2504
|
return i != null && typeof i == "object" && Array.isArray(i) === !1;
|
|
2505
2505
|
}
|
|
2506
2506
|
/*!
|
|
@@ -2509,58 +2509,80 @@ function ii(i) {
|
|
|
2509
2509
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
2510
2510
|
* Released under the MIT License.
|
|
2511
2511
|
*/
|
|
2512
|
-
function
|
|
2513
|
-
return
|
|
2512
|
+
function Pt(i) {
|
|
2513
|
+
return oi(i) === !0 && Object.prototype.toString.call(i) === "[object Object]";
|
|
2514
2514
|
}
|
|
2515
|
-
function
|
|
2515
|
+
function rr(i) {
|
|
2516
2516
|
var e, t;
|
|
2517
|
-
return !(
|
|
2517
|
+
return !(Pt(i) === !1 || (e = i.constructor, typeof e != "function") || (t = e.prototype, Pt(t) === !1) || t.hasOwnProperty("isPrototypeOf") === !1);
|
|
2518
2518
|
}
|
|
2519
|
-
var
|
|
2519
|
+
var me;
|
|
2520
2520
|
((i) => {
|
|
2521
|
-
function e(
|
|
2522
|
-
return
|
|
2521
|
+
function e(c, o) {
|
|
2522
|
+
return c.reduce((l, h) => (l[o(h)] = h, l), {});
|
|
2523
2523
|
}
|
|
2524
2524
|
i.fromArray = e;
|
|
2525
|
-
function t(
|
|
2526
|
-
return
|
|
2525
|
+
function t(c) {
|
|
2526
|
+
return c.reduce((o, l) => (o[l[0]] = l[1], o), {});
|
|
2527
2527
|
}
|
|
2528
2528
|
i.fromEntries = t;
|
|
2529
|
-
function r(
|
|
2530
|
-
return JSON.stringify(
|
|
2529
|
+
function r(c) {
|
|
2530
|
+
return JSON.stringify(c, (o, l) => typeof l == "object" && Object.getPrototypeOf(l) !== Object.prototype ? l.toString !== Object.prototype.toString ? l.toString() : `[object ${Object.getPrototypeOf(l).constructor.name}]` : l);
|
|
2531
2531
|
}
|
|
2532
2532
|
i.toJsonSafely = r;
|
|
2533
|
-
function s(
|
|
2534
|
-
|
|
2535
|
-
|
|
2533
|
+
function s(c) {
|
|
2534
|
+
rr(c) && Object.keys(c).forEach((o) => {
|
|
2535
|
+
c[o] === void 0 ? delete c[o] : s(c[o]);
|
|
2536
2536
|
});
|
|
2537
2537
|
}
|
|
2538
2538
|
i.deleteUndefinedPropertyOnPlainObjectDeeply = s;
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
const
|
|
2542
|
-
|
|
2539
|
+
function n(c, ...o) {
|
|
2540
|
+
const l = kt(o), h = {};
|
|
2541
|
+
for (const d in c)
|
|
2542
|
+
l(d) || (h[d] = c[d]);
|
|
2543
|
+
return h;
|
|
2544
|
+
}
|
|
2545
|
+
i.omit = n;
|
|
2546
|
+
function a(c, ...o) {
|
|
2547
|
+
const l = kt(o), h = {};
|
|
2548
|
+
for (const d in c)
|
|
2549
|
+
l(d) && (h[d] = c[d]);
|
|
2550
|
+
return h;
|
|
2551
|
+
}
|
|
2552
|
+
i.pick = a;
|
|
2553
|
+
})(me || (me = {}));
|
|
2554
|
+
function kt(i) {
|
|
2555
|
+
if (i.length <= 4)
|
|
2556
|
+
return i.includes.bind(i);
|
|
2557
|
+
{
|
|
2558
|
+
const e = new Set(i);
|
|
2559
|
+
return e.has.bind(e);
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2562
|
+
me.toJsonSafely;
|
|
2563
|
+
const ai = ["single", "multi"];
|
|
2564
|
+
var D = /* @__PURE__ */ ((i) => (i.auto = "auto", i.none = "none", i.greedy = "greedy", i.cooperative = "cooperative", i))(D || {}), He;
|
|
2543
2565
|
((i) => {
|
|
2544
2566
|
function e(t) {
|
|
2545
|
-
|
|
2567
|
+
me.deleteUndefinedPropertyOnPlainObjectDeeply(t);
|
|
2546
2568
|
const r = { center: y.ZERO, zoom: 5 };
|
|
2547
|
-
return
|
|
2548
|
-
isMergeableObject:
|
|
2569
|
+
return zt(r, t || {}, {
|
|
2570
|
+
isMergeableObject: rr
|
|
2549
2571
|
});
|
|
2550
2572
|
}
|
|
2551
2573
|
i.create = e;
|
|
2552
|
-
})(
|
|
2553
|
-
class
|
|
2574
|
+
})(He || (He = {}));
|
|
2575
|
+
class ir {
|
|
2554
2576
|
constructor(e, t, r, s) {
|
|
2555
|
-
|
|
2556
|
-
|
|
2577
|
+
p(this, "addEventListener");
|
|
2578
|
+
p(this, "removeEventListener");
|
|
2557
2579
|
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;
|
|
2558
2580
|
}
|
|
2559
2581
|
remove() {
|
|
2560
2582
|
this.map.removeOverlay(this);
|
|
2561
2583
|
}
|
|
2562
2584
|
}
|
|
2563
|
-
class
|
|
2585
|
+
class it extends ir {
|
|
2564
2586
|
constructor(e, t, r) {
|
|
2565
2587
|
super(e, t, r, new ee(e, r));
|
|
2566
2588
|
}
|
|
@@ -2571,9 +2593,9 @@ class tt extends er {
|
|
|
2571
2593
|
this.innerOverlay.setVisible(e);
|
|
2572
2594
|
}
|
|
2573
2595
|
}
|
|
2574
|
-
class
|
|
2596
|
+
class Ae extends ir {
|
|
2575
2597
|
constructor(e, t, r) {
|
|
2576
|
-
super(e, t, r, new
|
|
2598
|
+
super(e, t, r, new ne(e, r));
|
|
2577
2599
|
}
|
|
2578
2600
|
/** 仅限内部使用; 设为private时, 生成的d.ts文件中, 方法返回值会变成any, 故改成了public */
|
|
2579
2601
|
get overlay() {
|
|
@@ -2590,7 +2612,7 @@ class Be extends er {
|
|
|
2590
2612
|
return e !== void 0 && (e || this.setVisible(!1)), this;
|
|
2591
2613
|
}
|
|
2592
2614
|
}
|
|
2593
|
-
class
|
|
2615
|
+
class st extends Ae {
|
|
2594
2616
|
constructor(e, t, r, s) {
|
|
2595
2617
|
super(e, t, r), this.state = s;
|
|
2596
2618
|
}
|
|
@@ -2616,7 +2638,7 @@ class rt extends Be {
|
|
|
2616
2638
|
this.innerOverlay.setFillOpacity(e);
|
|
2617
2639
|
}
|
|
2618
2640
|
}
|
|
2619
|
-
class
|
|
2641
|
+
class nt extends it {
|
|
2620
2642
|
isEditable() {
|
|
2621
2643
|
return this.innerOverlay.getEditable();
|
|
2622
2644
|
}
|
|
@@ -2639,7 +2661,7 @@ class it extends tt {
|
|
|
2639
2661
|
this.innerOverlay.setOptions({ fillOpacity: e });
|
|
2640
2662
|
}
|
|
2641
2663
|
}
|
|
2642
|
-
class
|
|
2664
|
+
class ot extends st {
|
|
2643
2665
|
static create(e) {
|
|
2644
2666
|
const t = this.coordType, r = new BMap.Circle(e.center.toBaidu(t), e.radius, {
|
|
2645
2667
|
enableClicking: e.clickable,
|
|
@@ -2650,7 +2672,7 @@ class st extends rt {
|
|
|
2650
2672
|
fillColor: e.fillColor,
|
|
2651
2673
|
fillOpacity: e.fillOpacity
|
|
2652
2674
|
});
|
|
2653
|
-
return new
|
|
2675
|
+
return new ot(r, t, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
2654
2676
|
}
|
|
2655
2677
|
setCenter(e) {
|
|
2656
2678
|
this.coordType = this.map.coordType, this.innerOverlay.setCenter(e.toBaidu(this.coordType));
|
|
@@ -2665,7 +2687,7 @@ class st extends rt {
|
|
|
2665
2687
|
return this.innerOverlay.getRadius();
|
|
2666
2688
|
}
|
|
2667
2689
|
}
|
|
2668
|
-
class
|
|
2690
|
+
class at extends nt {
|
|
2669
2691
|
static create(e) {
|
|
2670
2692
|
const t = this.coordType, r = new google.maps.Circle({
|
|
2671
2693
|
center: e.center.toGoogle(t),
|
|
@@ -2679,7 +2701,7 @@ class nt extends it {
|
|
|
2679
2701
|
fillOpacity: e.fillOpacity,
|
|
2680
2702
|
visible: e.visible
|
|
2681
2703
|
});
|
|
2682
|
-
return new
|
|
2704
|
+
return new at(r, t, this);
|
|
2683
2705
|
}
|
|
2684
2706
|
setCenter(e) {
|
|
2685
2707
|
this.coordType = this.map.coordType, this.innerOverlay.setCenter(e.toGoogle(this.coordType));
|
|
@@ -2694,36 +2716,36 @@ class nt extends it {
|
|
|
2694
2716
|
return this.innerOverlay.getRadius();
|
|
2695
2717
|
}
|
|
2696
2718
|
}
|
|
2697
|
-
function
|
|
2719
|
+
function sr() {
|
|
2698
2720
|
BMap.OverlayV3 || (BMap.OverlayV3 = BMap.Overlay);
|
|
2699
2721
|
}
|
|
2700
2722
|
var U;
|
|
2701
2723
|
((i) => {
|
|
2702
2724
|
i.ZERO = { x: 0, y: 0 };
|
|
2703
2725
|
})(U || (U = {}));
|
|
2704
|
-
let
|
|
2705
|
-
function
|
|
2706
|
-
return
|
|
2726
|
+
let Ne;
|
|
2727
|
+
function li(i, e, t, r, s, n) {
|
|
2728
|
+
return Ne || (Ne = hi()), new Ne(i, e, t, r, s, n);
|
|
2707
2729
|
}
|
|
2708
|
-
function
|
|
2709
|
-
|
|
2730
|
+
function hi() {
|
|
2731
|
+
sr();
|
|
2710
2732
|
const i = new BMap.Point(0, 0);
|
|
2711
2733
|
return class extends BMap.OverlayV3 {
|
|
2712
|
-
constructor(r, s = i, n = U.ZERO, a,
|
|
2734
|
+
constructor(r, s = i, n = U.ZERO, a, c = 654, o = "") {
|
|
2713
2735
|
super();
|
|
2714
2736
|
// 类表达式不能有私有成员, 故改成public
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2737
|
+
p(this, "container");
|
|
2738
|
+
p(this, "border");
|
|
2739
|
+
p(this, "inner");
|
|
2740
|
+
p(this, "map");
|
|
2741
|
+
p(this, "marker");
|
|
2720
2742
|
this.content = r, this.position = s, this.offset = n;
|
|
2721
2743
|
const l = "baidu-info-box-container";
|
|
2722
2744
|
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";
|
|
2723
2745
|
const h = document.createElement("img");
|
|
2724
2746
|
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", () => {
|
|
2725
2747
|
this.close(), this.dispatchEvent({ type: "onclickclose" });
|
|
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(
|
|
2748
|
+
}), this.inner.appendChild(r), this.border.appendChild(this.inner), this.border.appendChild(h), this.container.appendChild(this.border), a && this.setZIndex(a), this.setMaxWidth(c), this.onMarkerPositionChanged = this.onMarkerPositionChanged.bind(this);
|
|
2727
2749
|
}
|
|
2728
2750
|
/** @override */
|
|
2729
2751
|
initialize(r) {
|
|
@@ -2774,7 +2796,7 @@ function oi() {
|
|
|
2774
2796
|
}
|
|
2775
2797
|
};
|
|
2776
2798
|
}
|
|
2777
|
-
class
|
|
2799
|
+
class lt {
|
|
2778
2800
|
constructor(e) {
|
|
2779
2801
|
this.delegate = e, this.delegate.setTarget(this);
|
|
2780
2802
|
}
|
|
@@ -2785,9 +2807,9 @@ class ot {
|
|
|
2785
2807
|
this.delegate.removeEventListener(e, t);
|
|
2786
2808
|
}
|
|
2787
2809
|
}
|
|
2788
|
-
class
|
|
2810
|
+
class ht extends lt {
|
|
2789
2811
|
constructor(e, t, r) {
|
|
2790
|
-
super(new
|
|
2812
|
+
super(new ne(e, t)), this.inner = e, this.map = t, this.state = r;
|
|
2791
2813
|
}
|
|
2792
2814
|
static create(e) {
|
|
2793
2815
|
const t = e.position || y.ZERO, r = new BMap.InfoWindow(e.content, {
|
|
@@ -2795,7 +2817,7 @@ class at extends ot {
|
|
|
2795
2817
|
offset: e.offset && new BMap.Size(e.offset.x, e.offset.y),
|
|
2796
2818
|
enableAutoPan: !e.disableAutoPan
|
|
2797
2819
|
});
|
|
2798
|
-
return new
|
|
2820
|
+
return new ht(r, this, { position: t });
|
|
2799
2821
|
}
|
|
2800
2822
|
isOpen() {
|
|
2801
2823
|
return this.inner.isOpen();
|
|
@@ -2814,11 +2836,11 @@ class at extends ot {
|
|
|
2814
2836
|
this.state.position = e, this.inner.isOpen() && this.open();
|
|
2815
2837
|
}
|
|
2816
2838
|
}
|
|
2817
|
-
class
|
|
2839
|
+
class ct extends lt {
|
|
2818
2840
|
constructor(t, r) {
|
|
2819
2841
|
super(new ee(t, r));
|
|
2820
|
-
|
|
2821
|
-
|
|
2842
|
+
p(this, "eventHub", new Wr());
|
|
2843
|
+
p(this, "isOpened", !1);
|
|
2822
2844
|
this.inner = t, this.map = r, t.addListener("closeclick", () => {
|
|
2823
2845
|
this.isOpened = !1, this.eventHub.hasListener("close") && this.eventHub.notify({ type: "close", target: this });
|
|
2824
2846
|
}), t.addListener("map_changed", () => {
|
|
@@ -2834,7 +2856,7 @@ class lt extends ot {
|
|
|
2834
2856
|
position: r.toGoogle(this.coordType),
|
|
2835
2857
|
disableAutoPan: t.disableAutoPan
|
|
2836
2858
|
});
|
|
2837
|
-
return new
|
|
2859
|
+
return new ct(s, this);
|
|
2838
2860
|
}
|
|
2839
2861
|
isOpen() {
|
|
2840
2862
|
return this.isOpened;
|
|
@@ -2872,13 +2894,13 @@ class lt extends ot {
|
|
|
2872
2894
|
this.inner.setPosition(t.toGoogle(this.map.coordType));
|
|
2873
2895
|
}
|
|
2874
2896
|
}
|
|
2875
|
-
class
|
|
2897
|
+
class dt extends Ae {
|
|
2876
2898
|
constructor(e, t, r) {
|
|
2877
2899
|
super(e, t, r), this.baiduMap = r;
|
|
2878
2900
|
}
|
|
2879
2901
|
static create(e) {
|
|
2880
2902
|
var s;
|
|
2881
|
-
const t = this.coordType, r =
|
|
2903
|
+
const t = this.coordType, r = li(
|
|
2882
2904
|
e.content,
|
|
2883
2905
|
(s = e.position) == null ? void 0 : s.toBaidu(t),
|
|
2884
2906
|
e.offset,
|
|
@@ -2886,7 +2908,7 @@ class ht extends Be {
|
|
|
2886
2908
|
e.maxWidth,
|
|
2887
2909
|
e.borderClass
|
|
2888
2910
|
);
|
|
2889
|
-
return new
|
|
2911
|
+
return new dt(r, t, this);
|
|
2890
2912
|
}
|
|
2891
2913
|
open(e) {
|
|
2892
2914
|
this.innerOverlay.open(this.baiduMap.innerMap, e == null ? void 0 : e.innerOverlay);
|
|
@@ -2907,7 +2929,7 @@ class ht extends Be {
|
|
|
2907
2929
|
this.innerOverlay.setZIndex(e);
|
|
2908
2930
|
}
|
|
2909
2931
|
}
|
|
2910
|
-
class
|
|
2932
|
+
class pt extends lt {
|
|
2911
2933
|
constructor(e, t, r) {
|
|
2912
2934
|
super(new ee(e, r)), this.inner = e, this.coordType = t, this.map = r;
|
|
2913
2935
|
}
|
|
@@ -2921,10 +2943,10 @@ class ct extends ot {
|
|
|
2921
2943
|
maxWidth: e.maxWidth
|
|
2922
2944
|
}), s = e.borderClass;
|
|
2923
2945
|
return s && r.addListener("domready", () => {
|
|
2924
|
-
var
|
|
2925
|
-
const a = (
|
|
2946
|
+
var c;
|
|
2947
|
+
const a = (c = e.content.parentElement) == null ? void 0 : c.parentElement;
|
|
2926
2948
|
a && a.className.includes("gm-style-iw-c") && !a.className.includes(s) && (a.className += ` ${s}`);
|
|
2927
|
-
}), new
|
|
2949
|
+
}), new pt(r, t, this);
|
|
2928
2950
|
}
|
|
2929
2951
|
open(e) {
|
|
2930
2952
|
this.inner.open(this.map.innerMap, e == null ? void 0 : e.innerOverlay);
|
|
@@ -2952,15 +2974,40 @@ class ct extends ot {
|
|
|
2952
2974
|
this.inner.setZIndex(e);
|
|
2953
2975
|
}
|
|
2954
2976
|
}
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2977
|
+
var fe;
|
|
2978
|
+
((i) => {
|
|
2979
|
+
function e(s, n) {
|
|
2980
|
+
if (s !== void 0)
|
|
2981
|
+
return Object.values(n).includes(s) ? s : void 0;
|
|
2982
|
+
}
|
|
2983
|
+
i.toEnumOrNull = e;
|
|
2984
|
+
function t(s) {
|
|
2985
|
+
return s.split(`
|
|
2986
|
+
`).map((n) => n.trim()).join(`
|
|
2987
|
+
`);
|
|
2988
|
+
}
|
|
2989
|
+
i.trimIndent = t;
|
|
2990
|
+
function r(s) {
|
|
2991
|
+
return s.replace(/([^A-Z]?)([A-Z])/g, (n, a, c) => a ? `${a}-${c.toLowerCase()}` : c.toLowerCase());
|
|
2992
|
+
}
|
|
2993
|
+
i.pascal2kebab = r;
|
|
2994
|
+
})(fe || (fe = {}));
|
|
2995
|
+
const ci = {
|
|
2996
|
+
/** @see https://nodejs.org/docs/v10.3.0/api/path.html#path_path_basename_path_ext */
|
|
2997
|
+
basename(i, e) {
|
|
2998
|
+
const t = i.endsWith("/") ? i.slice(0, -1) : i, r = t.lastIndexOf("/"), s = r >= 0 ? t.substring(r + 1) : t;
|
|
2999
|
+
return e && s.endsWith(e) ? s.slice(0, -e.length) : s;
|
|
3000
|
+
}
|
|
3001
|
+
};
|
|
3002
|
+
let De;
|
|
3003
|
+
function di(i, e, t, r) {
|
|
3004
|
+
return De || (De = pi()), new De(i, e, t, r);
|
|
2958
3005
|
}
|
|
2959
|
-
function
|
|
3006
|
+
function pi() {
|
|
2960
3007
|
return class extends google.maps.OverlayView {
|
|
2961
3008
|
constructor(t, r, s, n) {
|
|
2962
3009
|
super();
|
|
2963
|
-
|
|
3010
|
+
p(this, "container");
|
|
2964
3011
|
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", () => {
|
|
2965
3012
|
google.maps.event.trigger(this, "click");
|
|
2966
3013
|
}), this.setElement(t);
|
|
@@ -3013,7 +3060,7 @@ function li() {
|
|
|
3013
3060
|
}
|
|
3014
3061
|
};
|
|
3015
3062
|
}
|
|
3016
|
-
var
|
|
3063
|
+
var ae;
|
|
3017
3064
|
((i) => {
|
|
3018
3065
|
function e(r) {
|
|
3019
3066
|
return typeof r == "string" ? r : r.outerHTML;
|
|
@@ -3027,18 +3074,19 @@ var oe;
|
|
|
3027
3074
|
return r;
|
|
3028
3075
|
}
|
|
3029
3076
|
i.toElement = t;
|
|
3030
|
-
})(
|
|
3031
|
-
class
|
|
3077
|
+
})(ae || (ae = {}));
|
|
3078
|
+
class ut extends Ae {
|
|
3032
3079
|
constructor(t, r, s, n) {
|
|
3033
3080
|
super(t, r, s);
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3081
|
+
p(this, "icon");
|
|
3082
|
+
p(this, "iconAnchor");
|
|
3083
|
+
p(this, "content", void 0);
|
|
3084
|
+
p(this, "contentObserver");
|
|
3037
3085
|
this.setContentInternal(n, !0);
|
|
3038
3086
|
}
|
|
3039
3087
|
static create(t) {
|
|
3040
3088
|
var a;
|
|
3041
|
-
const r = this.coordType, s = new BMap.Label(
|
|
3089
|
+
const r = this.coordType, s = new BMap.Label(ae.toString(t.content), {
|
|
3042
3090
|
position: (a = t.position) == null ? void 0 : a.toBaidu(r),
|
|
3043
3091
|
offset: t.offset && new BMap.Size(t.offset.x, t.offset.y)
|
|
3044
3092
|
});
|
|
@@ -3047,7 +3095,7 @@ class dt extends Be {
|
|
|
3047
3095
|
padding: "0px",
|
|
3048
3096
|
backgroundColor: "unset"
|
|
3049
3097
|
});
|
|
3050
|
-
const n = new
|
|
3098
|
+
const n = new ut(s, r, this, t.content);
|
|
3051
3099
|
return s.__label__ = n, n;
|
|
3052
3100
|
}
|
|
3053
3101
|
setContentInternal(t, r = !1) {
|
|
@@ -3058,7 +3106,7 @@ class dt extends Be {
|
|
|
3058
3106
|
characterData: !0,
|
|
3059
3107
|
childList: !0,
|
|
3060
3108
|
subtree: !0
|
|
3061
|
-
})), r || this.innerOverlay.setContent(
|
|
3109
|
+
})), r || this.innerOverlay.setContent(ae.toString(t)), this.content = t);
|
|
3062
3110
|
}
|
|
3063
3111
|
setZIndex(t) {
|
|
3064
3112
|
this.innerOverlay.setZIndex(t);
|
|
@@ -3072,11 +3120,11 @@ class dt extends Be {
|
|
|
3072
3120
|
getOffset() {
|
|
3073
3121
|
const t = this.innerOverlay.getOffset();
|
|
3074
3122
|
let r = 0, s = 0;
|
|
3075
|
-
return this.
|
|
3123
|
+
return this.iconAnchor && (r = this.iconAnchor.width, s = this.iconAnchor.height), { x: t.width - r, y: t.height - s };
|
|
3076
3124
|
}
|
|
3077
3125
|
setOffset(t) {
|
|
3078
3126
|
let r = 0, s = 0;
|
|
3079
|
-
this.
|
|
3127
|
+
this.iconAnchor && (r = this.iconAnchor.width, s = this.iconAnchor.height), this.innerOverlay.setOffset(new BMap.Size(t.x + r, t.y + s));
|
|
3080
3128
|
}
|
|
3081
3129
|
setContent(t) {
|
|
3082
3130
|
this.setContentInternal(t);
|
|
@@ -3086,27 +3134,63 @@ class dt extends Be {
|
|
|
3086
3134
|
* @description baidu中Label默认左上角对齐Icon的左上, 我们要将其转换为对齐marker的position
|
|
3087
3135
|
* */
|
|
3088
3136
|
attachIcon(t) {
|
|
3089
|
-
|
|
3090
|
-
let
|
|
3091
|
-
|
|
3137
|
+
var c;
|
|
3138
|
+
let r;
|
|
3139
|
+
if (t instanceof BMap.Icon)
|
|
3140
|
+
r = t.anchor;
|
|
3141
|
+
else if (t)
|
|
3142
|
+
if (t.anchor)
|
|
3143
|
+
r = t.anchor;
|
|
3144
|
+
else {
|
|
3145
|
+
const o = ((c = t.__icon__) == null ? void 0 : c.baiduLabelOffset) ?? { x: 0, y: 0 };
|
|
3146
|
+
r = {
|
|
3147
|
+
width: t.style.anchor.width + o.x,
|
|
3148
|
+
height: t.style.anchor.height + o.y
|
|
3149
|
+
}, process.env.NODE_ENV !== "production" && setTimeout(() => {
|
|
3150
|
+
var d, u;
|
|
3151
|
+
if (se(t.__icon__, `${t}必须是由'SymbolIcon.toBaidu()'创建的`), !t.anchor) {
|
|
3152
|
+
console.log("BaiduLabelOverlay.attachIcon", "Bmap.Symbol.anchor尚未计算完成");
|
|
3153
|
+
return;
|
|
3154
|
+
}
|
|
3155
|
+
const l = t.anchor.width - t.style.anchor.width, h = t.anchor.height - t.style.anchor.height;
|
|
3156
|
+
if (o.x !== l || o.y !== h) {
|
|
3157
|
+
const _ = [
|
|
3158
|
+
(d = t.__icon__.anchor) == null ? void 0 : d.x,
|
|
3159
|
+
(u = t.__icon__.anchor) == null ? void 0 : u.y,
|
|
3160
|
+
t.__icon__.rotation,
|
|
3161
|
+
t.__icon__.scale,
|
|
3162
|
+
t.__icon__.strokeWeight
|
|
3163
|
+
].map((b) => b ?? "").join(",");
|
|
3164
|
+
console.warn("BaiduLabelOverlay.attachIcon", t.__icon__, fe.trimIndent(
|
|
3165
|
+
`
|
|
3166
|
+
为了保证Label的位置正确, 请将SymbolIcon(${_})中baiduLabelOffset的值改写成:
|
|
3167
|
+
${JSON.stringify({ x: l, y: h })}
|
|
3168
|
+
`
|
|
3169
|
+
));
|
|
3170
|
+
}
|
|
3171
|
+
}, 1);
|
|
3172
|
+
}
|
|
3173
|
+
const s = this.innerOverlay.getOffset();
|
|
3174
|
+
let n = s.width, a = s.height;
|
|
3175
|
+
this.iconAnchor && (n -= this.iconAnchor.width, a -= this.iconAnchor.height), r && (n += r.width, a += r.height), this.innerOverlay.setOffset(new BMap.Size(n, a)), this.icon = t, this.iconAnchor = r;
|
|
3092
3176
|
}
|
|
3093
3177
|
}
|
|
3094
|
-
class
|
|
3178
|
+
class gt extends it {
|
|
3095
3179
|
static create(e) {
|
|
3096
3180
|
var s;
|
|
3097
|
-
const t = this.coordType, r =
|
|
3098
|
-
|
|
3181
|
+
const t = this.coordType, r = di(
|
|
3182
|
+
ae.toElement(e.content),
|
|
3099
3183
|
(s = e.position) == null ? void 0 : s.toGoogle(t),
|
|
3100
3184
|
e.offset,
|
|
3101
3185
|
e.zIndex
|
|
3102
3186
|
);
|
|
3103
|
-
return new
|
|
3187
|
+
return new gt(r, t, this);
|
|
3104
3188
|
}
|
|
3105
3189
|
setZIndex(e) {
|
|
3106
3190
|
this.innerOverlay.setZIndex(e);
|
|
3107
3191
|
}
|
|
3108
3192
|
setContent(e) {
|
|
3109
|
-
this.innerOverlay.setElement(
|
|
3193
|
+
this.innerOverlay.setElement(ae.toElement(e));
|
|
3110
3194
|
}
|
|
3111
3195
|
getPosition() {
|
|
3112
3196
|
const e = this.innerOverlay.getPosition();
|
|
@@ -3122,7 +3206,11 @@ class pt extends tt {
|
|
|
3122
3206
|
this.innerOverlay.setOffset(e);
|
|
3123
3207
|
}
|
|
3124
3208
|
}
|
|
3125
|
-
|
|
3209
|
+
const Pe = {
|
|
3210
|
+
toGoogle: (i) => "url" in i ? ke.toGoogle(i) : Ie.toGoogle(i),
|
|
3211
|
+
toBaidu: (i) => "url" in i ? ke.toBaidu(i) : Ie.toBaidu(i)
|
|
3212
|
+
};
|
|
3213
|
+
var ke;
|
|
3126
3214
|
((i) => {
|
|
3127
3215
|
function e(r) {
|
|
3128
3216
|
return {
|
|
@@ -3144,15 +3232,54 @@ var ae;
|
|
|
3144
3232
|
});
|
|
3145
3233
|
}
|
|
3146
3234
|
i.toBaidu = t;
|
|
3147
|
-
})(
|
|
3148
|
-
|
|
3235
|
+
})(ke || (ke = {}));
|
|
3236
|
+
var Ie;
|
|
3237
|
+
((i) => {
|
|
3238
|
+
function e(r) {
|
|
3239
|
+
return {
|
|
3240
|
+
path: typeof r.path == "string" ? r.path : r.path.google(),
|
|
3241
|
+
// TODO: 2023/05/17 ipcjs 检查google和baidu的锚点位置是否相同
|
|
3242
|
+
anchor: r.anchor && new google.maps.Point(r.anchor.x, r.anchor.y),
|
|
3243
|
+
fillColor: r.fillColor,
|
|
3244
|
+
fillOpacity: r.fillOpacity,
|
|
3245
|
+
scale: r.scale,
|
|
3246
|
+
rotation: r.rotation,
|
|
3247
|
+
strokeColor: r.strokeColor,
|
|
3248
|
+
strokeOpacity: r.strokeOpacity,
|
|
3249
|
+
strokeWeight: r.strokeWeight
|
|
3250
|
+
};
|
|
3251
|
+
}
|
|
3252
|
+
i.toGoogle = e;
|
|
3253
|
+
function t(r) {
|
|
3254
|
+
const s = new BMap.Symbol(typeof r.path == "string" ? r.path : r.path.baidu(), {
|
|
3255
|
+
anchor: r.anchor && new BMap.Size(r.anchor.x, r.anchor.y),
|
|
3256
|
+
fillColor: r.fillColor,
|
|
3257
|
+
fillOpacity: r.fillOpacity,
|
|
3258
|
+
scale: r.scale,
|
|
3259
|
+
rotation: r.rotation,
|
|
3260
|
+
strokeColor: r.strokeColor,
|
|
3261
|
+
strokeOpacity: r.strokeOpacity,
|
|
3262
|
+
strokeWeight: r.strokeWeight
|
|
3263
|
+
});
|
|
3264
|
+
return s.__icon__ = r, s;
|
|
3265
|
+
}
|
|
3266
|
+
i.toBaidu = t;
|
|
3267
|
+
})(Ie || (Ie = {}));
|
|
3268
|
+
const hs = {
|
|
3269
|
+
CIRCLE: { baidu: () => BMap_Symbol_SHAPE_CIRCLE, google: () => google.maps.SymbolPath.CIRCLE },
|
|
3270
|
+
BACKWARD_CLOSED_ARROW: { baidu: () => BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW, google: () => google.maps.SymbolPath.BACKWARD_CLOSED_ARROW },
|
|
3271
|
+
BACKWARD_OPEN_ARROW: { baidu: () => BMap_Symbol_SHAPE_BACKWARD_OPEN_ARROW, google: () => google.maps.SymbolPath.BACKWARD_OPEN_ARROW },
|
|
3272
|
+
FORWARD_CLOSED_ARROW: { baidu: () => BMap_Symbol_SHAPE_FORWARD_CLOSED_ARROW, google: () => google.maps.SymbolPath.FORWARD_CLOSED_ARROW },
|
|
3273
|
+
FORWARD_OPEN_ARROW: { baidu: () => BMap_Symbol_SHAPE_FORWARD_OPEN_ARROW, google: () => google.maps.SymbolPath.FORWARD_OPEN_ARROW }
|
|
3274
|
+
};
|
|
3275
|
+
class ye extends Ae {
|
|
3149
3276
|
constructor(e, t, r, s) {
|
|
3150
3277
|
super(e, t, r), this.state = s;
|
|
3151
3278
|
}
|
|
3152
3279
|
static create(e) {
|
|
3153
3280
|
const t = this.coordType, r = e.icon, s = {
|
|
3154
3281
|
title: e.title,
|
|
3155
|
-
icon: r &&
|
|
3282
|
+
icon: r && Pe.toBaidu(r),
|
|
3156
3283
|
enableClicking: e.clickable,
|
|
3157
3284
|
enableDragging: e.draggable,
|
|
3158
3285
|
// baidu的raiseOnDrag属性, 默认为false, 而我们的options.crossOnDrag默认为true, 故这里需要转换下
|
|
@@ -3160,8 +3287,8 @@ class ye extends Be {
|
|
|
3160
3287
|
draggingCursor: e.cursor
|
|
3161
3288
|
}, n = new BMap.Marker(e.position.toBaidu(t), s);
|
|
3162
3289
|
e.zIndex !== void 0 && n.setZIndex(e.zIndex);
|
|
3163
|
-
const a = e.clickable === void 0 ? !0 : e.clickable,
|
|
3164
|
-
return new ye(n, t, this, { clickable: a, draggable:
|
|
3290
|
+
const a = e.clickable === void 0 ? !0 : e.clickable, c = !!e.draggable;
|
|
3291
|
+
return new ye(n, t, this, { clickable: a, draggable: c, zIndex: e.zIndex }).visibleOptionInternal(e.visible);
|
|
3165
3292
|
}
|
|
3166
3293
|
getPosition() {
|
|
3167
3294
|
return y.fromBaidu(this.innerOverlay.getPosition(), this.coordType);
|
|
@@ -3177,7 +3304,7 @@ class ye extends Be {
|
|
|
3177
3304
|
return this.innerOverlay.getTitle();
|
|
3178
3305
|
}
|
|
3179
3306
|
setIcon(e) {
|
|
3180
|
-
const t =
|
|
3307
|
+
const t = Pe.toBaidu(e);
|
|
3181
3308
|
this.innerOverlay.setIcon(t);
|
|
3182
3309
|
const r = this.getLabel();
|
|
3183
3310
|
r && r.attachIcon(t);
|
|
@@ -3212,13 +3339,13 @@ class ye extends Be {
|
|
|
3212
3339
|
return (e = this.innerOverlay.getLabel()) == null ? void 0 : e.__label__;
|
|
3213
3340
|
}
|
|
3214
3341
|
}
|
|
3215
|
-
class
|
|
3342
|
+
class mt extends it {
|
|
3216
3343
|
constructor() {
|
|
3217
3344
|
super(...arguments);
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3345
|
+
p(this, "label");
|
|
3346
|
+
p(this, "labelPositionListener");
|
|
3347
|
+
p(this, "labelVisibleListener");
|
|
3348
|
+
p(this, "labelMapChangedListener");
|
|
3222
3349
|
}
|
|
3223
3350
|
static create(t) {
|
|
3224
3351
|
const r = this.coordType, s = t.icon, n = {
|
|
@@ -3226,7 +3353,7 @@ class ut extends tt {
|
|
|
3226
3353
|
title: t.title,
|
|
3227
3354
|
zIndex: t.zIndex,
|
|
3228
3355
|
visible: t.visible,
|
|
3229
|
-
icon: s &&
|
|
3356
|
+
icon: s && Pe.toGoogle(s),
|
|
3230
3357
|
clickable: t.clickable,
|
|
3231
3358
|
draggable: t.draggable,
|
|
3232
3359
|
// google的crossOnDrag和我们的crossOnDrag是匹配的, 不需要转换
|
|
@@ -3235,7 +3362,7 @@ class ut extends tt {
|
|
|
3235
3362
|
// InfoWindow相对marker的position的偏移量, 若不指定, 则偏移到marker的icon的上部中央
|
|
3236
3363
|
anchorPoint: new google.maps.Point(0, 0)
|
|
3237
3364
|
};
|
|
3238
|
-
return new
|
|
3365
|
+
return new mt(new google.maps.Marker(n), r, this);
|
|
3239
3366
|
}
|
|
3240
3367
|
getPosition() {
|
|
3241
3368
|
return y.fromGoogle(this.innerOverlay.getPosition(), this.coordType);
|
|
@@ -3250,7 +3377,7 @@ class ut extends tt {
|
|
|
3250
3377
|
return this.innerOverlay.getTitle() || "";
|
|
3251
3378
|
}
|
|
3252
3379
|
setIcon(t) {
|
|
3253
|
-
this.innerOverlay.setIcon(
|
|
3380
|
+
this.innerOverlay.setIcon(Pe.toGoogle(t));
|
|
3254
3381
|
}
|
|
3255
3382
|
getIcon() {
|
|
3256
3383
|
return this.innerOverlay.getIcon();
|
|
@@ -3288,7 +3415,7 @@ class ut extends tt {
|
|
|
3288
3415
|
this.label = void 0, this.labelPositionListener = void 0, this.labelVisibleListener = void 0, this.labelMapChangedListener = void 0;
|
|
3289
3416
|
}
|
|
3290
3417
|
}
|
|
3291
|
-
class
|
|
3418
|
+
class ft extends st {
|
|
3292
3419
|
static create(e) {
|
|
3293
3420
|
const t = this.coordType;
|
|
3294
3421
|
e.paths.length > 1 && console.warn("baidu不支持多path, 只会显示paths[0]");
|
|
@@ -3301,7 +3428,7 @@ class gt extends rt {
|
|
|
3301
3428
|
fillColor: e.fillColor,
|
|
3302
3429
|
fillOpacity: e.fillOpacity
|
|
3303
3430
|
});
|
|
3304
|
-
return new
|
|
3431
|
+
return new ft(s, t, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
3305
3432
|
}
|
|
3306
3433
|
getPaths() {
|
|
3307
3434
|
return [this.innerOverlay.getPath().map((e) => y.fromBaidu(e, this.coordType))];
|
|
@@ -3310,7 +3437,7 @@ class gt extends rt {
|
|
|
3310
3437
|
e.length > 1 && console.warn("baidu不支持多path, 只会显示paths[0]"), this.coordType = this.map.coordType, this.innerOverlay.setPath((e[0] || []).map((t) => t.toBaidu(this.coordType)));
|
|
3311
3438
|
}
|
|
3312
3439
|
}
|
|
3313
|
-
class
|
|
3440
|
+
class yt extends nt {
|
|
3314
3441
|
static create(e) {
|
|
3315
3442
|
const t = this.coordType, r = new google.maps.Polygon({
|
|
3316
3443
|
paths: e.paths.map((s) => s.map((n) => n.toGoogle(t))),
|
|
@@ -3323,7 +3450,7 @@ class mt extends it {
|
|
|
3323
3450
|
fillOpacity: e.fillOpacity,
|
|
3324
3451
|
visible: e.visible
|
|
3325
3452
|
});
|
|
3326
|
-
return new
|
|
3453
|
+
return new yt(r, t, this);
|
|
3327
3454
|
}
|
|
3328
3455
|
getPaths() {
|
|
3329
3456
|
const e = this.innerOverlay.getPaths(), t = [];
|
|
@@ -3338,7 +3465,7 @@ class mt extends it {
|
|
|
3338
3465
|
this.coordType = this.map.coordType, this.innerOverlay.setPaths(e.map((t) => t.map((r) => r.toGoogle(this.coordType))));
|
|
3339
3466
|
}
|
|
3340
3467
|
}
|
|
3341
|
-
class
|
|
3468
|
+
class vt extends st {
|
|
3342
3469
|
static create(e) {
|
|
3343
3470
|
const t = this.coordType, r = new BMap.Polyline(e.path.map((s) => s.toBaidu(t)), {
|
|
3344
3471
|
enableClicking: e.clickable,
|
|
@@ -3347,7 +3474,7 @@ class ft extends rt {
|
|
|
3347
3474
|
strokeOpacity: e.strokeOpacity,
|
|
3348
3475
|
strokeWeight: e.strokeWeight
|
|
3349
3476
|
});
|
|
3350
|
-
return new
|
|
3477
|
+
return new vt(r, t, this, { editable: e.editable === !0 }).visibleOptionInternal(e.visible);
|
|
3351
3478
|
}
|
|
3352
3479
|
getPath() {
|
|
3353
3480
|
return this.innerOverlay.getPath().map((e) => y.fromBaidu(e, this.coordType));
|
|
@@ -3356,7 +3483,7 @@ class ft extends rt {
|
|
|
3356
3483
|
this.coordType = this.map.coordType, this.innerOverlay.setPath(e.map((t) => t.toBaidu(this.coordType)));
|
|
3357
3484
|
}
|
|
3358
3485
|
}
|
|
3359
|
-
class
|
|
3486
|
+
class _t extends nt {
|
|
3360
3487
|
static create(e) {
|
|
3361
3488
|
const t = this.coordType, r = new google.maps.Polyline({
|
|
3362
3489
|
path: e.path.map((s) => s.toGoogle(t)),
|
|
@@ -3367,7 +3494,7 @@ class yt extends it {
|
|
|
3367
3494
|
strokeWeight: e.strokeWeight,
|
|
3368
3495
|
visible: e.visible
|
|
3369
3496
|
});
|
|
3370
|
-
return new
|
|
3497
|
+
return new _t(r, t, this);
|
|
3371
3498
|
}
|
|
3372
3499
|
getPath() {
|
|
3373
3500
|
const e = [];
|
|
@@ -3380,30 +3507,30 @@ class yt extends it {
|
|
|
3380
3507
|
}
|
|
3381
3508
|
}
|
|
3382
3509
|
const X = 1;
|
|
3383
|
-
class
|
|
3510
|
+
class ui extends rt {
|
|
3384
3511
|
constructor(t, r) {
|
|
3385
3512
|
var s;
|
|
3386
3513
|
super(t);
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3514
|
+
p(this, "buildInMapTypeId2BIMT");
|
|
3515
|
+
p(this, "baiduMapType2BIMT");
|
|
3516
|
+
p(this, "map");
|
|
3517
|
+
p(this, "createLabel", ut.create);
|
|
3518
|
+
p(this, "createCircle", ot.create);
|
|
3519
|
+
p(this, "createPolygon", ft.create);
|
|
3520
|
+
p(this, "createPolyline", vt.create);
|
|
3521
|
+
p(this, "createInfoWindow", ht.create);
|
|
3522
|
+
p(this, "createInfoBox", dt.create);
|
|
3523
|
+
p(this, "createMarker", ye.create);
|
|
3524
|
+
p(this, "createMapTypeControl", qe.create);
|
|
3525
|
+
p(this, "createZoomControl", Qe.create);
|
|
3526
|
+
p(this, "createScaleControl", Xe.create);
|
|
3400
3527
|
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, {
|
|
3401
3528
|
minZoom: r.minZoom && r.minZoom + X,
|
|
3402
3529
|
maxZoom: r.maxZoom && r.maxZoom + X,
|
|
3403
3530
|
mapType: r.buildInMapTypeId && ((s = this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId)) == null ? void 0 : s.asBaiduMapType()),
|
|
3404
3531
|
enableMapClick: !1
|
|
3405
3532
|
// 关闭底图点击功能
|
|
3406
|
-
}), this.map.centerAndZoom(r.center.toBaidu(this.coordType), r.zoom + X), this.setGestureHandling(r.gestureHandling), r.infoWindowMode === "multi" && console.warn("baidu不支持多个InfoWindow, 可能会出现未知问题"), r.mapStyle && this.map.setMapStyleV2(r.mapStyle.toBaidu()), this.setEventTargetDelegate(new
|
|
3533
|
+
}), this.map.centerAndZoom(r.center.toBaidu(this.coordType), r.zoom + X), this.setGestureHandling(r.gestureHandling), r.infoWindowMode === "multi" && console.warn("baidu不支持多个InfoWindow, 可能会出现未知问题"), r.mapStyle && this.map.setMapStyleV2(r.mapStyle.toBaidu()), this.setEventTargetDelegate(new ne(this.map, this)), this.map.addEventListener("addoverlay", (n) => {
|
|
3407
3534
|
const a = n.target.__info_box__;
|
|
3408
3535
|
a && (console.debug("add:info-box", a), this.map.addOverlay(a));
|
|
3409
3536
|
}), this.map.addEventListener("removeoverlay", (n) => {
|
|
@@ -3415,7 +3542,7 @@ class hi extends et {
|
|
|
3415
3542
|
this.innerMap.setDefaultCursor(t);
|
|
3416
3543
|
}
|
|
3417
3544
|
setGestureHandling(t = D.auto) {
|
|
3418
|
-
switch (t === D.auto && (t = this.element.parentElement &&
|
|
3545
|
+
switch (t === D.auto && (t = this.element.parentElement && We.isScrollable(this.element.parentElement) ? D.cooperative : D.greedy), t) {
|
|
3419
3546
|
case D.cooperative:
|
|
3420
3547
|
this.map.disableScrollWheelZoom(), this.map.enableDragging(), this.map.enableDoubleClickZoom();
|
|
3421
3548
|
break;
|
|
@@ -3530,8 +3657,8 @@ class hi extends et {
|
|
|
3530
3657
|
const r = class extends BMap.Control {
|
|
3531
3658
|
constructor() {
|
|
3532
3659
|
super(...arguments);
|
|
3533
|
-
|
|
3534
|
-
|
|
3660
|
+
p(this, "defaultAnchor", B.getBaidu().toValue(t.position));
|
|
3661
|
+
p(this, "defaultOffset", new BMap.Size(0, 0));
|
|
3535
3662
|
}
|
|
3536
3663
|
initialize(n) {
|
|
3537
3664
|
const a = t.onCreateElement();
|
|
@@ -3542,38 +3669,38 @@ class hi extends et {
|
|
|
3542
3669
|
}
|
|
3543
3670
|
}
|
|
3544
3671
|
removeCustomControl(t) {
|
|
3545
|
-
t.inner && (
|
|
3672
|
+
t.inner && (se(t.inner instanceof BMap.Control, `control.inner(${t.inner})需要是BMap.Control`), this.map.removeControl(t.inner));
|
|
3546
3673
|
}
|
|
3547
3674
|
createMarkerClusterer(t) {
|
|
3548
|
-
return new
|
|
3675
|
+
return new Qr(this, t);
|
|
3549
3676
|
}
|
|
3550
3677
|
createAutocomplete(t) {
|
|
3551
|
-
return new
|
|
3678
|
+
return new Yr(this, t);
|
|
3552
3679
|
}
|
|
3553
3680
|
createSearchBox(t) {
|
|
3554
|
-
return new
|
|
3681
|
+
return new si(this, t);
|
|
3555
3682
|
}
|
|
3556
3683
|
createPlaceService(t) {
|
|
3557
|
-
return new
|
|
3684
|
+
return new ri(this, t);
|
|
3558
3685
|
}
|
|
3559
3686
|
}
|
|
3560
|
-
class
|
|
3687
|
+
class gi extends rt {
|
|
3561
3688
|
constructor(t, r) {
|
|
3562
3689
|
var n;
|
|
3563
3690
|
super(t);
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3691
|
+
p(this, "buildInMapTypeId2BIMT");
|
|
3692
|
+
p(this, "googleMapTypeId2BIMT");
|
|
3693
|
+
p(this, "map");
|
|
3694
|
+
p(this, "createLabel", gt.create);
|
|
3695
|
+
p(this, "createCircle", at.create);
|
|
3696
|
+
p(this, "createPolygon", yt.create);
|
|
3697
|
+
p(this, "createPolyline", _t.create);
|
|
3698
|
+
p(this, "createInfoWindow", ct.create);
|
|
3699
|
+
p(this, "createInfoBox", pt.create);
|
|
3700
|
+
p(this, "createMarker", mt.create);
|
|
3701
|
+
p(this, "createMapTypeControl", Oe.create);
|
|
3702
|
+
p(this, "createZoomControl", et.create);
|
|
3703
|
+
p(this, "createScaleControl", Je.create);
|
|
3577
3704
|
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);
|
|
3578
3705
|
const s = r.buildInMapTypeId && this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId);
|
|
3579
3706
|
this.map = new google.maps.Map(t, {
|
|
@@ -3606,20 +3733,20 @@ class ci extends et {
|
|
|
3606
3733
|
const r = this.innerMap.getProjection(), s = this.innerMap.getBounds();
|
|
3607
3734
|
if (r == null || s == null)
|
|
3608
3735
|
return y.ZERO;
|
|
3609
|
-
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()),
|
|
3610
|
-
if (n == null || a == null ||
|
|
3736
|
+
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()), c = this.innerMap.getZoom();
|
|
3737
|
+
if (n == null || a == null || c == null)
|
|
3611
3738
|
return y.ZERO;
|
|
3612
|
-
const o = Math.pow(2,
|
|
3739
|
+
const o = Math.pow(2, c), l = new google.maps.Point(t.x / o + n.x, t.y / o + a.y);
|
|
3613
3740
|
return y.fromGoogle(r.fromPointToLatLng(l) ?? te.LATLNG_ZERO, this.coordType);
|
|
3614
3741
|
}
|
|
3615
3742
|
fromLatLngToContainerPoint(t) {
|
|
3616
3743
|
const r = this.innerMap.getProjection(), s = this.innerMap.getBounds();
|
|
3617
3744
|
if (r == null || s == null)
|
|
3618
3745
|
return U.ZERO;
|
|
3619
|
-
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()),
|
|
3620
|
-
if (n == null || a == null ||
|
|
3746
|
+
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()), c = this.innerMap.getZoom();
|
|
3747
|
+
if (n == null || a == null || c == null)
|
|
3621
3748
|
return U.ZERO;
|
|
3622
|
-
const o = Math.pow(2,
|
|
3749
|
+
const o = Math.pow(2, c), l = r.fromLatLngToPoint(t.toGoogle(this.coordType));
|
|
3623
3750
|
return l == null ? U.ZERO : { x: (l.x - n.x) * o, y: (l.y - a.y) * o };
|
|
3624
3751
|
}
|
|
3625
3752
|
setDraggable(t) {
|
|
@@ -3702,26 +3829,26 @@ class ci extends et {
|
|
|
3702
3829
|
}
|
|
3703
3830
|
}
|
|
3704
3831
|
createMarkerClusterer(t) {
|
|
3705
|
-
return new
|
|
3832
|
+
return new ei(this, t);
|
|
3706
3833
|
}
|
|
3707
3834
|
createAutocomplete(t) {
|
|
3708
|
-
return new
|
|
3835
|
+
return new Ur(this, t);
|
|
3709
3836
|
}
|
|
3710
3837
|
createSearchBox(t) {
|
|
3711
|
-
return new
|
|
3838
|
+
return new ii(this, t);
|
|
3712
3839
|
}
|
|
3713
3840
|
createPlaceService(t) {
|
|
3714
|
-
return new
|
|
3841
|
+
return new ti(this, t);
|
|
3715
3842
|
}
|
|
3716
3843
|
}
|
|
3717
|
-
class
|
|
3844
|
+
class mi extends rt {
|
|
3718
3845
|
constructor(t, r) {
|
|
3719
3846
|
var a;
|
|
3720
3847
|
super(t);
|
|
3721
|
-
|
|
3722
|
-
|
|
3848
|
+
p(this, "map");
|
|
3849
|
+
p(this, "defaultLayers");
|
|
3723
3850
|
this.mapOptions = r;
|
|
3724
|
-
const s =
|
|
3851
|
+
const s = Dt().here;
|
|
3725
3852
|
Ce.includes(s.version) || C(`不支持${s.version}, HereMap当前只支持如下版本: ${Ce}`);
|
|
3726
3853
|
const n = new H.service.Platform({
|
|
3727
3854
|
app_id: s.key.split(",")[0],
|
|
@@ -3860,34 +3987,34 @@ class di extends et {
|
|
|
3860
3987
|
throw new Error("Method not implemented.");
|
|
3861
3988
|
}
|
|
3862
3989
|
}
|
|
3863
|
-
var $ = /* @__PURE__ */ ((i) => (i.google = "google", i.baidu = "baidu", i.here = "here", i))($ || {}),
|
|
3990
|
+
var $ = /* @__PURE__ */ ((i) => (i.google = "google", i.baidu = "baidu", i.here = "here", i))($ || {}), Fe;
|
|
3864
3991
|
((i) => {
|
|
3865
3992
|
function e(t, r, s) {
|
|
3866
|
-
const n =
|
|
3993
|
+
const n = He.create(s);
|
|
3867
3994
|
switch (t) {
|
|
3868
3995
|
case "google":
|
|
3869
|
-
return new
|
|
3996
|
+
return new gi(r, n);
|
|
3870
3997
|
case "baidu":
|
|
3871
|
-
return new
|
|
3998
|
+
return new ui(r, n);
|
|
3872
3999
|
case "here":
|
|
3873
|
-
return new
|
|
4000
|
+
return new mi(r, n);
|
|
3874
4001
|
}
|
|
3875
4002
|
}
|
|
3876
4003
|
i.createMap = e;
|
|
3877
|
-
})(
|
|
3878
|
-
function
|
|
3879
|
-
const t = window, r =
|
|
4004
|
+
})(Fe || (Fe = {}));
|
|
4005
|
+
function fi({ type: i, config: e }) {
|
|
4006
|
+
const t = window, r = yi(i);
|
|
3880
4007
|
if (t[r])
|
|
3881
4008
|
return Promise.resolve();
|
|
3882
4009
|
switch (i !== $.here && !e.key && C(`请先配置${i}地图的key`), i) {
|
|
3883
4010
|
case $.google:
|
|
3884
|
-
return {}.VITE_FALSE ? (
|
|
4011
|
+
return {}.VITE_FALSE ? (Fr({
|
|
3885
4012
|
key: e.key,
|
|
3886
4013
|
v: "3.52"
|
|
3887
4014
|
// v: config.version,
|
|
3888
|
-
}), google.maps.importLibrary("core")) :
|
|
4015
|
+
}), google.maps.importLibrary("core")) : It(`https://maps.googleapis.com/maps/api/js?key=${e.key}&language=${e.language}&v=${e.version}&libraries=${e.libraries.join(",")}`);
|
|
3889
4016
|
case $.baidu:
|
|
3890
|
-
return
|
|
4017
|
+
return It(`https://api.map.baidu.com/api?v=${e.version}&ak=${e.key}`);
|
|
3891
4018
|
case $.here:
|
|
3892
4019
|
return ce(he("core", e.version)).then(() => Promise.all([
|
|
3893
4020
|
// 其他大多数模块都可以同时载入
|
|
@@ -3897,13 +4024,13 @@ function pi({ type: i, config: e }) {
|
|
|
3897
4024
|
ce(he("ui", e.version))
|
|
3898
4025
|
])).catch((s) => (delete t[r], Promise.reject(s)));
|
|
3899
4026
|
default:
|
|
3900
|
-
|
|
4027
|
+
Ze(i);
|
|
3901
4028
|
}
|
|
3902
4029
|
}
|
|
3903
4030
|
function he(i, e = Ce[0]) {
|
|
3904
4031
|
return `https://js.api.here.com/v3/${e}/mapsjs-${i}.js`;
|
|
3905
4032
|
}
|
|
3906
|
-
function
|
|
4033
|
+
function yi(i) {
|
|
3907
4034
|
switch (i) {
|
|
3908
4035
|
case $.google:
|
|
3909
4036
|
return "google";
|
|
@@ -3913,10 +4040,10 @@ function ui(i) {
|
|
|
3913
4040
|
return "H";
|
|
3914
4041
|
}
|
|
3915
4042
|
}
|
|
3916
|
-
let
|
|
3917
|
-
function
|
|
4043
|
+
let vi = 0;
|
|
4044
|
+
function It(i, e = "callback") {
|
|
3918
4045
|
return new Promise((t, r) => {
|
|
3919
|
-
const s = `__callback${
|
|
4046
|
+
const s = `__callback${vi++}`;
|
|
3920
4047
|
window[s] = t;
|
|
3921
4048
|
const n = document.createElement("script");
|
|
3922
4049
|
n.src = `${i}&${e}=${s}`, n.onerror = r, document.body.appendChild(n);
|
|
@@ -3928,31 +4055,6 @@ function ce(i) {
|
|
|
3928
4055
|
r.src = i, r.onload = e, r.onerror = t, document.body.appendChild(r);
|
|
3929
4056
|
});
|
|
3930
4057
|
}
|
|
3931
|
-
var Pe;
|
|
3932
|
-
((i) => {
|
|
3933
|
-
function e(s, n) {
|
|
3934
|
-
if (s !== void 0)
|
|
3935
|
-
return Object.values(n).includes(s) ? s : void 0;
|
|
3936
|
-
}
|
|
3937
|
-
i.toEnumOrNull = e;
|
|
3938
|
-
function t(s) {
|
|
3939
|
-
return s.split(`
|
|
3940
|
-
`).map((n) => n.trim()).join(`
|
|
3941
|
-
`);
|
|
3942
|
-
}
|
|
3943
|
-
i.trimIndent = t;
|
|
3944
|
-
function r(s) {
|
|
3945
|
-
return s.replace(/([^A-Z]?)([A-Z])/g, (n, a, d) => a ? `${a}-${d.toLowerCase()}` : d.toLowerCase());
|
|
3946
|
-
}
|
|
3947
|
-
i.pascal2kebab = r;
|
|
3948
|
-
})(Pe || (Pe = {}));
|
|
3949
|
-
const mi = {
|
|
3950
|
-
/** @see https://nodejs.org/docs/v10.3.0/api/path.html#path_path_basename_path_ext */
|
|
3951
|
-
basename(i, e) {
|
|
3952
|
-
const t = i.endsWith("/") ? i.slice(0, -1) : i, r = t.lastIndexOf("/"), s = r >= 0 ? t.substring(r + 1) : t;
|
|
3953
|
-
return e && s.endsWith(e) ? s.slice(0, -e.length) : s;
|
|
3954
|
-
}
|
|
3955
|
-
};
|
|
3956
4058
|
function G(i, e) {
|
|
3957
4059
|
return {
|
|
3958
4060
|
type: String,
|
|
@@ -3960,14 +4062,14 @@ function G(i, e) {
|
|
|
3960
4062
|
validator: (t) => Object.values(i).includes(t)
|
|
3961
4063
|
};
|
|
3962
4064
|
}
|
|
3963
|
-
function
|
|
4065
|
+
function _i(i, e) {
|
|
3964
4066
|
return {
|
|
3965
4067
|
type: String,
|
|
3966
4068
|
default: e,
|
|
3967
4069
|
validator: (t) => i.includes(t)
|
|
3968
4070
|
};
|
|
3969
4071
|
}
|
|
3970
|
-
function
|
|
4072
|
+
function z(i) {
|
|
3971
4073
|
return {
|
|
3972
4074
|
type: i,
|
|
3973
4075
|
required: !0
|
|
@@ -3979,7 +4081,7 @@ function f(i, e) {
|
|
|
3979
4081
|
default: e
|
|
3980
4082
|
};
|
|
3981
4083
|
}
|
|
3982
|
-
function
|
|
4084
|
+
function cs(i) {
|
|
3983
4085
|
const e = {};
|
|
3984
4086
|
return Object.entries(i).forEach(([t, r]) => {
|
|
3985
4087
|
const s = `__${t}`;
|
|
@@ -3999,21 +4101,21 @@ function os(i) {
|
|
|
3999
4101
|
const de = {
|
|
4000
4102
|
enumerable: !0,
|
|
4001
4103
|
configurable: !0,
|
|
4002
|
-
get:
|
|
4003
|
-
set:
|
|
4104
|
+
get: ue,
|
|
4105
|
+
set: ue
|
|
4004
4106
|
};
|
|
4005
|
-
function
|
|
4107
|
+
function Mi(i) {
|
|
4006
4108
|
return Object.keys(i).forEach((e) => {
|
|
4007
4109
|
const t = i[e];
|
|
4008
4110
|
let r = !1;
|
|
4009
|
-
typeof t == "function" ? (de.get = t, de.set =
|
|
4111
|
+
typeof t == "function" ? (de.get = t, de.set = ue, 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));
|
|
4010
4112
|
}), i;
|
|
4011
4113
|
}
|
|
4012
|
-
function
|
|
4013
|
-
return
|
|
4114
|
+
function ds(i) {
|
|
4115
|
+
return Mi(i);
|
|
4014
4116
|
}
|
|
4015
|
-
function
|
|
4016
|
-
return
|
|
4117
|
+
function nr() {
|
|
4118
|
+
return Ge();
|
|
4017
4119
|
}
|
|
4018
4120
|
function Te(i, e) {
|
|
4019
4121
|
const t = i.$options[e];
|
|
@@ -4021,12 +4123,12 @@ function Te(i, e) {
|
|
|
4021
4123
|
for (const r of t)
|
|
4022
4124
|
r.call(i);
|
|
4023
4125
|
}
|
|
4024
|
-
function
|
|
4126
|
+
function ps(i, e) {
|
|
4025
4127
|
for (const t of i)
|
|
4026
4128
|
if (t.$options.name === e.name)
|
|
4027
4129
|
return t;
|
|
4028
4130
|
}
|
|
4029
|
-
function
|
|
4131
|
+
function us(i, e) {
|
|
4030
4132
|
if (!i.default)
|
|
4031
4133
|
return;
|
|
4032
4134
|
const t = i.default();
|
|
@@ -4034,12 +4136,12 @@ function hs(i, e) {
|
|
|
4034
4136
|
if ((r == null ? void 0 : r.type).name === e.name)
|
|
4035
4137
|
return r;
|
|
4036
4138
|
}
|
|
4037
|
-
function
|
|
4139
|
+
function bi(i, e) {
|
|
4038
4140
|
const t = {}, r = {}, s = {};
|
|
4039
4141
|
return Object.keys(i).forEach((n) => {
|
|
4040
|
-
n.startsWith("on") ? t[
|
|
4142
|
+
n.startsWith("on") ? t[fe.pascal2kebab(n.substring(2))] = i[n] : r[n] = i[n];
|
|
4041
4143
|
}), e && Object.keys(e).forEach((n) => {
|
|
4042
|
-
n.startsWith("on") && (s[
|
|
4144
|
+
n.startsWith("on") && (s[fe.pascal2kebab(n.substring(2))] = e[n]);
|
|
4043
4145
|
}), {
|
|
4044
4146
|
/** class/style/未声明的属性 等 */
|
|
4045
4147
|
binds: r,
|
|
@@ -4049,13 +4151,13 @@ function vi(i, e) {
|
|
|
4049
4151
|
listenerProps: s
|
|
4050
4152
|
};
|
|
4051
4153
|
}
|
|
4052
|
-
function
|
|
4053
|
-
return
|
|
4154
|
+
function K(i, e) {
|
|
4155
|
+
return St(() => bi(i, e));
|
|
4054
4156
|
}
|
|
4055
|
-
function
|
|
4157
|
+
function N() {
|
|
4056
4158
|
return Function;
|
|
4057
4159
|
}
|
|
4058
|
-
const
|
|
4160
|
+
const gs = {
|
|
4059
4161
|
/**
|
|
4060
4162
|
* @event 一般来说传{@link Tg.Event}对象, 但传其他对象也不会报错
|
|
4061
4163
|
*/
|
|
@@ -4066,8 +4168,8 @@ const cs = {
|
|
|
4066
4168
|
eventLogLess(i) {
|
|
4067
4169
|
((i && i.type) !== this.$_prev_type || Date.now() - (this.$_prev_time ?? 0) > 1e3) && this.eventLog(i);
|
|
4068
4170
|
}
|
|
4069
|
-
},
|
|
4070
|
-
inject: [
|
|
4171
|
+
}, Mt = "$map", ve = "onCreate", _e = "onDestroy", L = x({
|
|
4172
|
+
inject: [Mt],
|
|
4071
4173
|
mounted() {
|
|
4072
4174
|
Te(this, ve);
|
|
4073
4175
|
},
|
|
@@ -4080,13 +4182,13 @@ const cs = {
|
|
|
4080
4182
|
}
|
|
4081
4183
|
},
|
|
4082
4184
|
render() {
|
|
4083
|
-
return
|
|
4185
|
+
return nr();
|
|
4084
4186
|
}
|
|
4085
|
-
}),
|
|
4187
|
+
}), Ti = x({
|
|
4086
4188
|
name: "tg-map",
|
|
4087
4189
|
provide() {
|
|
4088
4190
|
return {
|
|
4089
|
-
[
|
|
4191
|
+
[Mt]: St(() => this.map)
|
|
4090
4192
|
};
|
|
4091
4193
|
},
|
|
4092
4194
|
inheritAttrs: !1,
|
|
@@ -4101,7 +4203,7 @@ const cs = {
|
|
|
4101
4203
|
* - :last-center.sync="center": 获取tg-map销毁时的最后的center的值, 使用这种方式可以做到type切换时保留中心点位置
|
|
4102
4204
|
* @see AbstractMapEventMap.center-changed
|
|
4103
4205
|
* */
|
|
4104
|
-
center:
|
|
4206
|
+
center: z(y),
|
|
4105
4207
|
/**
|
|
4106
4208
|
* 同步center的延时
|
|
4107
4209
|
* @default 300
|
|
@@ -4118,42 +4220,42 @@ const cs = {
|
|
|
4118
4220
|
* @see center
|
|
4119
4221
|
*/
|
|
4120
4222
|
lastCenter: f(y),
|
|
4121
|
-
zoom:
|
|
4122
|
-
infoWindowMode:
|
|
4223
|
+
zoom: z(Number),
|
|
4224
|
+
infoWindowMode: _i(ai),
|
|
4123
4225
|
gestureHandling: G(D),
|
|
4124
4226
|
minZoom: f(Number),
|
|
4125
4227
|
maxZoom: f(Number),
|
|
4126
4228
|
mapStyle: f(Object),
|
|
4127
|
-
mapTypeId: G(
|
|
4229
|
+
mapTypeId: G(jt),
|
|
4128
4230
|
/** 地图类型对象, 优先级比mapTypeId高 */
|
|
4129
4231
|
mapType: f(Object),
|
|
4130
4232
|
hideLogo: f(Boolean),
|
|
4131
|
-
onLoad:
|
|
4132
|
-
"onUpdate:center":
|
|
4133
|
-
"onUpdate:current-center":
|
|
4134
|
-
"onUpdate:last-center":
|
|
4135
|
-
"onUpdate:map-type":
|
|
4136
|
-
"onUpdate:map-type-id":
|
|
4137
|
-
"onUpdate:zoom":
|
|
4138
|
-
onError:
|
|
4233
|
+
onLoad: N(),
|
|
4234
|
+
"onUpdate:center": N(),
|
|
4235
|
+
"onUpdate:current-center": N(),
|
|
4236
|
+
"onUpdate:last-center": N(),
|
|
4237
|
+
"onUpdate:map-type": N(),
|
|
4238
|
+
"onUpdate:map-type-id": N(),
|
|
4239
|
+
"onUpdate:zoom": N(),
|
|
4240
|
+
onError: N()
|
|
4139
4241
|
},
|
|
4140
4242
|
/** 声明事件的类型信息, 详见: {@link splitAttrs} */
|
|
4141
4243
|
emits: void 0,
|
|
4142
4244
|
setup(i, { attrs: e }) {
|
|
4143
4245
|
return {
|
|
4144
|
-
attrs:
|
|
4246
|
+
attrs: K(e, i),
|
|
4145
4247
|
centerSyncTimeoutId: 0
|
|
4146
4248
|
};
|
|
4147
4249
|
},
|
|
4148
4250
|
data() {
|
|
4149
4251
|
return {
|
|
4150
|
-
map:
|
|
4252
|
+
map: je(),
|
|
4151
4253
|
isDestroyed: !1
|
|
4152
4254
|
};
|
|
4153
4255
|
},
|
|
4154
4256
|
computed: {
|
|
4155
4257
|
propsJson() {
|
|
4156
|
-
return
|
|
4258
|
+
return me.toJsonSafely(this.$props);
|
|
4157
4259
|
}
|
|
4158
4260
|
},
|
|
4159
4261
|
watch: {
|
|
@@ -4192,7 +4294,7 @@ const cs = {
|
|
|
4192
4294
|
async mounted() {
|
|
4193
4295
|
const i = this.type;
|
|
4194
4296
|
try {
|
|
4195
|
-
await
|
|
4297
|
+
await fi({ type: i, config: Dt()[i] });
|
|
4196
4298
|
} catch (s) {
|
|
4197
4299
|
this.$emit("error", s);
|
|
4198
4300
|
return;
|
|
@@ -4201,7 +4303,7 @@ const cs = {
|
|
|
4201
4303
|
console.warn(`tg-map(type=${i})已销毁, 不需要继续执行`);
|
|
4202
4304
|
return;
|
|
4203
4305
|
}
|
|
4204
|
-
const e =
|
|
4306
|
+
const e = Fe.createMap(
|
|
4205
4307
|
i,
|
|
4206
4308
|
this.$refs.map,
|
|
4207
4309
|
/* options: */
|
|
@@ -4216,7 +4318,7 @@ const cs = {
|
|
|
4216
4318
|
buildInMapTypeId: this.mapTypeId
|
|
4217
4319
|
}
|
|
4218
4320
|
);
|
|
4219
|
-
if (this.map =
|
|
4321
|
+
if (this.map = pr(e), this.mapType && e.setMapType(this.mapType), "ready" in this.attrs.listeners && console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"), Y(
|
|
4220
4322
|
this.attrs.listeners,
|
|
4221
4323
|
e,
|
|
4222
4324
|
/* excludes: */
|
|
@@ -4243,28 +4345,28 @@ const cs = {
|
|
|
4243
4345
|
},
|
|
4244
4346
|
methods: {}
|
|
4245
4347
|
});
|
|
4246
|
-
const
|
|
4348
|
+
const j = (i, e) => {
|
|
4247
4349
|
const t = i.__vccOpts || i;
|
|
4248
4350
|
for (const [r, s] of e)
|
|
4249
4351
|
t[r] = s;
|
|
4250
4352
|
return t;
|
|
4251
4353
|
};
|
|
4252
|
-
function
|
|
4253
|
-
return Z(),
|
|
4254
|
-
|
|
4354
|
+
function Oi(i, e, t, r, s, n) {
|
|
4355
|
+
return Z(), W("div", le({ class: "tg-map" }, i.attrs.binds), [
|
|
4356
|
+
ur("div", {
|
|
4255
4357
|
ref: "map",
|
|
4256
|
-
class:
|
|
4358
|
+
class: Se({
|
|
4257
4359
|
"tg-map__map": !0,
|
|
4258
4360
|
[`tg-map__map--hide-logo-${i.type}`]: i.hideLogo
|
|
4259
4361
|
})
|
|
4260
4362
|
}, null, 2),
|
|
4261
|
-
|
|
4262
|
-
i.map ?
|
|
4263
|
-
|
|
4363
|
+
Ge("", !0),
|
|
4364
|
+
i.map ? R(i.$slots, "default", { key: 1 }) : Ge("", !0),
|
|
4365
|
+
R(i.$slots, "overlay")
|
|
4264
4366
|
], 16);
|
|
4265
4367
|
}
|
|
4266
|
-
const
|
|
4267
|
-
function
|
|
4368
|
+
const wi = /* @__PURE__ */ j(Ti, [["render", Oi]]);
|
|
4369
|
+
function Ci(i) {
|
|
4268
4370
|
if (i == null)
|
|
4269
4371
|
return;
|
|
4270
4372
|
let e;
|
|
@@ -4275,7 +4377,7 @@ function Ti(i) {
|
|
|
4275
4377
|
e = i;
|
|
4276
4378
|
return `${e}px`;
|
|
4277
4379
|
}
|
|
4278
|
-
const
|
|
4380
|
+
const xi = x({
|
|
4279
4381
|
name: "tg-map-widget",
|
|
4280
4382
|
props: {
|
|
4281
4383
|
left: {
|
|
@@ -4301,18 +4403,18 @@ const wi = x({
|
|
|
4301
4403
|
}
|
|
4302
4404
|
},
|
|
4303
4405
|
methods: {
|
|
4304
|
-
dimen:
|
|
4406
|
+
dimen: Ci
|
|
4305
4407
|
}
|
|
4306
4408
|
});
|
|
4307
|
-
function
|
|
4308
|
-
return Z(),
|
|
4309
|
-
class:
|
|
4310
|
-
style:
|
|
4409
|
+
function Ei(i, e, t, r, s, n) {
|
|
4410
|
+
return Z(), W("div", {
|
|
4411
|
+
class: Se(i.$options.name),
|
|
4412
|
+
style: gr({ left: i.dimen(i.left), top: i.dimen(i.topValue), right: i.dimen(i.right), bottom: i.dimen(i.bottom) })
|
|
4311
4413
|
}, [
|
|
4312
|
-
|
|
4414
|
+
R(i.$slots, "default")
|
|
4313
4415
|
], 6);
|
|
4314
4416
|
}
|
|
4315
|
-
const
|
|
4417
|
+
const ms = /* @__PURE__ */ j(xi, [["render", Ei]]), Li = x({
|
|
4316
4418
|
name: "tg-custom-control",
|
|
4317
4419
|
mixins: [L],
|
|
4318
4420
|
props: {
|
|
@@ -4329,8 +4431,8 @@ const ds = /* @__PURE__ */ W(wi, [["render", Oi]]), Ci = x({
|
|
|
4329
4431
|
}
|
|
4330
4432
|
},
|
|
4331
4433
|
onCreate() {
|
|
4332
|
-
Me(this.$parent,
|
|
4333
|
-
const { $el: i } = this, e = class extends
|
|
4434
|
+
Me(this.$parent, wi) || console.warn("请将tg-custom-control放到tg-map中");
|
|
4435
|
+
const { $el: i } = this, e = class extends Vr {
|
|
4334
4436
|
onCreateElement() {
|
|
4335
4437
|
return i;
|
|
4336
4438
|
}
|
|
@@ -4341,19 +4443,19 @@ const ds = /* @__PURE__ */ W(wi, [["render", Oi]]), Ci = x({
|
|
|
4341
4443
|
this.$map.removeCustomControl(this.control);
|
|
4342
4444
|
}
|
|
4343
4445
|
});
|
|
4344
|
-
function
|
|
4345
|
-
return Z(),
|
|
4346
|
-
class:
|
|
4446
|
+
function Pi(i, e, t, r, s, n) {
|
|
4447
|
+
return Z(), W("div", {
|
|
4448
|
+
class: Se(i.$options.name)
|
|
4347
4449
|
}, [
|
|
4348
|
-
|
|
4450
|
+
R(i.$slots, "default")
|
|
4349
4451
|
], 2);
|
|
4350
4452
|
}
|
|
4351
|
-
const
|
|
4453
|
+
const fs = /* @__PURE__ */ j(Li, [["render", Pi]]), ys = x({
|
|
4352
4454
|
name: "tg-map-type-control",
|
|
4353
4455
|
mixins: [L],
|
|
4354
4456
|
props: {
|
|
4355
4457
|
position: G(P, P.TOP_LEFT),
|
|
4356
|
-
type: G(
|
|
4458
|
+
type: G(Vt),
|
|
4357
4459
|
mapTypes: f(Array)
|
|
4358
4460
|
},
|
|
4359
4461
|
setup() {
|
|
@@ -4381,7 +4483,7 @@ const ps = /* @__PURE__ */ W(Ci, [["render", xi]]), us = x({
|
|
|
4381
4483
|
onDestroy() {
|
|
4382
4484
|
this.$map.removeControl(this.control);
|
|
4383
4485
|
}
|
|
4384
|
-
}),
|
|
4486
|
+
}), vs = x({
|
|
4385
4487
|
name: "tg-scale-control",
|
|
4386
4488
|
mixins: [L],
|
|
4387
4489
|
props: {
|
|
@@ -4404,20 +4506,20 @@ const ps = /* @__PURE__ */ W(Ci, [["render", xi]]), us = x({
|
|
|
4404
4506
|
this.$map.removeControl(this.control);
|
|
4405
4507
|
}
|
|
4406
4508
|
});
|
|
4407
|
-
function
|
|
4509
|
+
function or() {
|
|
4408
4510
|
var t;
|
|
4409
|
-
const i = (t =
|
|
4511
|
+
const i = (t = mr()) == null ? void 0 : t.type;
|
|
4410
4512
|
let e = (i == null ? void 0 : i.name) ?? (i == null ? void 0 : i.__name);
|
|
4411
4513
|
if (!e) {
|
|
4412
4514
|
const r = i == null ? void 0 : i.__file;
|
|
4413
|
-
r && (e =
|
|
4515
|
+
r && (e = ci.basename(r, ".vue"));
|
|
4414
4516
|
}
|
|
4415
4517
|
return e;
|
|
4416
4518
|
}
|
|
4417
|
-
function
|
|
4418
|
-
const i =
|
|
4519
|
+
function ki() {
|
|
4520
|
+
const i = fr(Mt);
|
|
4419
4521
|
let e, t;
|
|
4420
|
-
return i == null && C(`<${
|
|
4522
|
+
return i == null && C(`<${or() || "unknown"}>必须作为<tg-map>的子代组件`), {
|
|
4421
4523
|
mapRef: i,
|
|
4422
4524
|
/** 读取map对象, 只要放在<tg-map>里面的组件(除#overlay插槽外)都能够立即读取到map对象 */
|
|
4423
4525
|
get map() {
|
|
@@ -4425,11 +4527,11 @@ function Ei() {
|
|
|
4425
4527
|
},
|
|
4426
4528
|
/** 地图元素创建回调 */
|
|
4427
4529
|
[ve](r) {
|
|
4428
|
-
|
|
4530
|
+
yr(r), e && C(`${ve}只能调用一次`), e = r;
|
|
4429
4531
|
},
|
|
4430
4532
|
/** 地图元素销毁回调 */
|
|
4431
4533
|
[_e](r) {
|
|
4432
|
-
|
|
4534
|
+
vr(r), t && C(`${_e}只能调用一次`), t = r;
|
|
4433
4535
|
},
|
|
4434
4536
|
/** 重新创建地图元素 */
|
|
4435
4537
|
recreate() {
|
|
@@ -4437,23 +4539,23 @@ function Ei() {
|
|
|
4437
4539
|
}
|
|
4438
4540
|
};
|
|
4439
4541
|
}
|
|
4440
|
-
const
|
|
4542
|
+
const _s = x({
|
|
4441
4543
|
name: "tg-zoom-control",
|
|
4442
4544
|
props: {
|
|
4443
4545
|
position: G(P, P.RIGHT_BOTTOM)
|
|
4444
4546
|
},
|
|
4445
4547
|
setup(i) {
|
|
4446
4548
|
let e = void 0;
|
|
4447
|
-
const { map: t, onCreate: r, onDestroy: s } =
|
|
4549
|
+
const { map: t, onCreate: r, onDestroy: s } = ki();
|
|
4448
4550
|
return r(() => {
|
|
4449
4551
|
e = t.createZoomControl(i), t.addControl(e);
|
|
4450
4552
|
}), s(() => {
|
|
4451
4553
|
t.removeControl(e);
|
|
4452
|
-
}),
|
|
4554
|
+
}), _r(() => i.position, (n) => {
|
|
4453
4555
|
e.setPosition(n);
|
|
4454
|
-
}),
|
|
4556
|
+
}), nr;
|
|
4455
4557
|
}
|
|
4456
|
-
}),
|
|
4558
|
+
}), Ii = x({
|
|
4457
4559
|
name: "tg-marker-clusterer",
|
|
4458
4560
|
mixins: [L],
|
|
4459
4561
|
// markers从this.$children中读取, 故需要省略(Omit)
|
|
@@ -4517,14 +4619,14 @@ const ms = x({
|
|
|
4517
4619
|
}
|
|
4518
4620
|
}
|
|
4519
4621
|
});
|
|
4520
|
-
function
|
|
4521
|
-
return Z(),
|
|
4522
|
-
class:
|
|
4622
|
+
function Bi(i, e, t, r, s, n) {
|
|
4623
|
+
return Z(), W("div", {
|
|
4624
|
+
class: Se(i.$options.name)
|
|
4523
4625
|
}, [
|
|
4524
|
-
|
|
4626
|
+
R(i.$slots, "default")
|
|
4525
4627
|
], 2);
|
|
4526
4628
|
}
|
|
4527
|
-
const
|
|
4629
|
+
const Si = /* @__PURE__ */ j(Ii, [["render", Bi]]), Ms = x({
|
|
4528
4630
|
name: "tg-traffic-layer",
|
|
4529
4631
|
mixins: [L],
|
|
4530
4632
|
// 请直接使用v-if来控制它的显隐
|
|
@@ -4537,18 +4639,18 @@ const ki = /* @__PURE__ */ W(Li, [["render", Pi]]), fs = x({
|
|
|
4537
4639
|
},
|
|
4538
4640
|
watch: {},
|
|
4539
4641
|
onCreate() {
|
|
4540
|
-
this.layer = new
|
|
4642
|
+
this.layer = new Hr(), this.$map.addLayer(this.layer);
|
|
4541
4643
|
},
|
|
4542
4644
|
onDestroy() {
|
|
4543
4645
|
this.$map.removeLayer(this.layer);
|
|
4544
4646
|
}
|
|
4545
|
-
}),
|
|
4647
|
+
}), bs = x({
|
|
4546
4648
|
name: "tg-circle",
|
|
4547
4649
|
mixins: [L],
|
|
4548
4650
|
inheritAttrs: !1,
|
|
4549
4651
|
props: {
|
|
4550
|
-
center:
|
|
4551
|
-
radius:
|
|
4652
|
+
center: z(y),
|
|
4653
|
+
radius: z(Number),
|
|
4552
4654
|
clickable: f(Boolean),
|
|
4553
4655
|
editable: f(Boolean),
|
|
4554
4656
|
strokeColor: f(String),
|
|
@@ -4560,7 +4662,7 @@ const ki = /* @__PURE__ */ W(Li, [["render", Pi]]), fs = x({
|
|
|
4560
4662
|
},
|
|
4561
4663
|
setup(i, { attrs: e }) {
|
|
4562
4664
|
return {
|
|
4563
|
-
attrs:
|
|
4665
|
+
attrs: K(e),
|
|
4564
4666
|
overlay: void 0
|
|
4565
4667
|
};
|
|
4566
4668
|
},
|
|
@@ -4603,14 +4705,14 @@ const ki = /* @__PURE__ */ W(Li, [["render", Pi]]), fs = x({
|
|
|
4603
4705
|
this.$map.removeOverlay(this.overlay);
|
|
4604
4706
|
}
|
|
4605
4707
|
});
|
|
4606
|
-
var
|
|
4607
|
-
class
|
|
4708
|
+
var Ue = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overlayMouseTarget = "overlayMouseTarget", i.float = "float", i))(Ue || {});
|
|
4709
|
+
class Ai {
|
|
4608
4710
|
constructor(e, t) {
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4711
|
+
p(this, "baidu");
|
|
4712
|
+
p(this, "google");
|
|
4713
|
+
p(this, "projection");
|
|
4714
|
+
p(this, "element", void 0);
|
|
4715
|
+
p(this, "mapPane");
|
|
4614
4716
|
this.map = e, this.mapPane = t.mapPane;
|
|
4615
4717
|
}
|
|
4616
4718
|
create() {
|
|
@@ -4625,26 +4727,26 @@ class Ii {
|
|
|
4625
4727
|
asBaidu() {
|
|
4626
4728
|
if (!this.baidu) {
|
|
4627
4729
|
const e = this;
|
|
4628
|
-
|
|
4730
|
+
sr();
|
|
4629
4731
|
class t extends BMap.OverlayV3 {
|
|
4630
4732
|
initialize(n) {
|
|
4631
|
-
const a = e.create(),
|
|
4733
|
+
const a = e.create(), c = n.getPanes();
|
|
4632
4734
|
let o;
|
|
4633
4735
|
switch (e.mapPane) {
|
|
4634
4736
|
case "float":
|
|
4635
|
-
o =
|
|
4737
|
+
o = c.floatPane;
|
|
4636
4738
|
break;
|
|
4637
4739
|
case "overlayMouseTarget":
|
|
4638
|
-
o =
|
|
4740
|
+
o = c.markerMouseTarget;
|
|
4639
4741
|
break;
|
|
4640
4742
|
case "overlay":
|
|
4641
|
-
o =
|
|
4743
|
+
o = c.markerPane;
|
|
4642
4744
|
break;
|
|
4643
4745
|
case "map":
|
|
4644
|
-
o =
|
|
4746
|
+
o = c.mapPane;
|
|
4645
4747
|
break;
|
|
4646
4748
|
default:
|
|
4647
|
-
|
|
4749
|
+
Ze(e.mapPane);
|
|
4648
4750
|
break;
|
|
4649
4751
|
}
|
|
4650
4752
|
return o == null || o.appendChild(a), a;
|
|
@@ -4687,7 +4789,7 @@ class Ii {
|
|
|
4687
4789
|
a = n.mapPane;
|
|
4688
4790
|
break;
|
|
4689
4791
|
default:
|
|
4690
|
-
|
|
4792
|
+
Ze(e.mapPane);
|
|
4691
4793
|
break;
|
|
4692
4794
|
}
|
|
4693
4795
|
a.appendChild(s);
|
|
@@ -4712,7 +4814,7 @@ class Ii {
|
|
|
4712
4814
|
return this.google;
|
|
4713
4815
|
}
|
|
4714
4816
|
}
|
|
4715
|
-
class
|
|
4817
|
+
class $i extends Ai {
|
|
4716
4818
|
constructor(e, t, r, s) {
|
|
4717
4819
|
super(e, t), this.content = r, this.position = s;
|
|
4718
4820
|
}
|
|
@@ -4727,12 +4829,12 @@ class Bi extends Ii {
|
|
|
4727
4829
|
this.position = e, this.draw();
|
|
4728
4830
|
}
|
|
4729
4831
|
}
|
|
4730
|
-
const
|
|
4832
|
+
const Ri = x({
|
|
4731
4833
|
name: "tg-element-overlay",
|
|
4732
4834
|
mixins: [L],
|
|
4733
4835
|
props: {
|
|
4734
|
-
mapPane: G(
|
|
4735
|
-
position:
|
|
4836
|
+
mapPane: G(Ue, Ue.overlayMouseTarget),
|
|
4837
|
+
position: z(y)
|
|
4736
4838
|
},
|
|
4737
4839
|
setup() {
|
|
4738
4840
|
return {
|
|
@@ -4753,25 +4855,25 @@ const Si = x({
|
|
|
4753
4855
|
}
|
|
4754
4856
|
},
|
|
4755
4857
|
onCreate() {
|
|
4756
|
-
this.overlay = new
|
|
4858
|
+
this.overlay = new $i(this.$map, this, this.content(), this.position), this.$map.addElementOverlay(this.overlay);
|
|
4757
4859
|
},
|
|
4758
4860
|
onDestroy() {
|
|
4759
4861
|
this.$map.removeElementOverlay(this.overlay);
|
|
4760
4862
|
}
|
|
4761
4863
|
});
|
|
4762
|
-
function
|
|
4763
|
-
return Z(),
|
|
4864
|
+
function zi(i, e, t, r, s, n) {
|
|
4865
|
+
return Z(), W("div", le({
|
|
4764
4866
|
class: i.$options.name
|
|
4765
4867
|
}, i.$attrs), [
|
|
4766
|
-
|
|
4868
|
+
R(i.$slots, "default")
|
|
4767
4869
|
], 16);
|
|
4768
4870
|
}
|
|
4769
|
-
const
|
|
4871
|
+
const Ts = /* @__PURE__ */ j(Ri, [["render", zi]]), Ni = x({
|
|
4770
4872
|
name: "tg-marker",
|
|
4771
4873
|
mixins: [L],
|
|
4772
4874
|
inheritAttrs: !1,
|
|
4773
4875
|
props: {
|
|
4774
|
-
position:
|
|
4876
|
+
position: z(y),
|
|
4775
4877
|
title: f(String),
|
|
4776
4878
|
icon: f(Object),
|
|
4777
4879
|
clickable: f(Boolean),
|
|
@@ -4783,10 +4885,10 @@ const vs = /* @__PURE__ */ W(Si, [["render", Ai]]), $i = x({
|
|
|
4783
4885
|
},
|
|
4784
4886
|
setup(i, { attrs: e }) {
|
|
4785
4887
|
return {
|
|
4786
|
-
attrs:
|
|
4888
|
+
attrs: K(e),
|
|
4787
4889
|
marker: void 0,
|
|
4788
|
-
label:
|
|
4789
|
-
info:
|
|
4890
|
+
label: je(),
|
|
4891
|
+
info: je()
|
|
4790
4892
|
};
|
|
4791
4893
|
},
|
|
4792
4894
|
watch: {
|
|
@@ -4826,7 +4928,7 @@ const vs = /* @__PURE__ */ W(Si, [["render", Ai]]), $i = x({
|
|
|
4826
4928
|
},
|
|
4827
4929
|
methods: {
|
|
4828
4930
|
$clusterer() {
|
|
4829
|
-
return Me(this.$parent,
|
|
4931
|
+
return Me(this.$parent, Si);
|
|
4830
4932
|
},
|
|
4831
4933
|
onAddLabel(i) {
|
|
4832
4934
|
this.label = i, this.marker && this.marker.setLabel(i.overlay);
|
|
@@ -4845,30 +4947,30 @@ const vs = /* @__PURE__ */ W(Si, [["render", Ai]]), $i = x({
|
|
|
4845
4947
|
}
|
|
4846
4948
|
}
|
|
4847
4949
|
});
|
|
4848
|
-
function
|
|
4849
|
-
return Z(),
|
|
4950
|
+
function Di(i, e, t, r, s, n) {
|
|
4951
|
+
return Z(), W("div", le({
|
|
4850
4952
|
class: i.$options.name
|
|
4851
4953
|
}, i.attrs.binds), [
|
|
4852
|
-
|
|
4954
|
+
R(i.$slots, "default")
|
|
4853
4955
|
], 16);
|
|
4854
4956
|
}
|
|
4855
|
-
const
|
|
4957
|
+
const bt = /* @__PURE__ */ j(Ni, [["render", Di]]), Gi = x({
|
|
4856
4958
|
name: "tg-info-box",
|
|
4857
4959
|
mixins: [L],
|
|
4858
4960
|
inheritAttrs: !1,
|
|
4859
4961
|
props: {
|
|
4860
|
-
show:
|
|
4962
|
+
show: z(Boolean),
|
|
4861
4963
|
position: f(y),
|
|
4862
4964
|
offset: f(Object),
|
|
4863
4965
|
maxWidth: f(Number),
|
|
4864
4966
|
borderClass: f(String),
|
|
4865
4967
|
zIndex: f(Number),
|
|
4866
|
-
"onUpdate:show":
|
|
4968
|
+
"onUpdate:show": N()
|
|
4867
4969
|
},
|
|
4868
4970
|
emits: void 0,
|
|
4869
4971
|
setup(i, { attrs: e }) {
|
|
4870
4972
|
return {
|
|
4871
|
-
attrs:
|
|
4973
|
+
attrs: K(e, i),
|
|
4872
4974
|
overlay: void 0
|
|
4873
4975
|
};
|
|
4874
4976
|
},
|
|
@@ -4915,7 +5017,7 @@ const _t = /* @__PURE__ */ W($i, [["render", zi]]), Ni = x({
|
|
|
4915
5017
|
return this.$el;
|
|
4916
5018
|
},
|
|
4917
5019
|
$marker() {
|
|
4918
|
-
return Me(this.$parent,
|
|
5020
|
+
return Me(this.$parent, bt);
|
|
4919
5021
|
},
|
|
4920
5022
|
open(i) {
|
|
4921
5023
|
this.overlay.open(i);
|
|
@@ -4925,19 +5027,19 @@ const _t = /* @__PURE__ */ W($i, [["render", zi]]), Ni = x({
|
|
|
4925
5027
|
}
|
|
4926
5028
|
}
|
|
4927
5029
|
});
|
|
4928
|
-
function
|
|
4929
|
-
return Z(),
|
|
5030
|
+
function Zi(i, e, t, r, s, n) {
|
|
5031
|
+
return Z(), W("div", le({
|
|
4930
5032
|
class: i.$options.name
|
|
4931
5033
|
}, i.attrs.binds), [
|
|
4932
|
-
|
|
5034
|
+
R(i.$slots, "default")
|
|
4933
5035
|
], 16);
|
|
4934
5036
|
}
|
|
4935
|
-
const
|
|
5037
|
+
const Os = /* @__PURE__ */ j(Gi, [["render", Zi]]), Wi = x({
|
|
4936
5038
|
name: "tg-info-window",
|
|
4937
5039
|
mixins: [L],
|
|
4938
5040
|
inheritAttrs: !1,
|
|
4939
5041
|
props: {
|
|
4940
|
-
show:
|
|
5042
|
+
show: z(Boolean),
|
|
4941
5043
|
position: f(y),
|
|
4942
5044
|
maxWidth: f(Number),
|
|
4943
5045
|
offset: f(Object),
|
|
@@ -4945,7 +5047,7 @@ const _s = /* @__PURE__ */ W(Ni, [["render", Ri]]), Di = x({
|
|
|
4945
5047
|
},
|
|
4946
5048
|
setup(i, { attrs: e }) {
|
|
4947
5049
|
return {
|
|
4948
|
-
attrs:
|
|
5050
|
+
attrs: K(e),
|
|
4949
5051
|
overlay: void 0
|
|
4950
5052
|
};
|
|
4951
5053
|
},
|
|
@@ -4971,7 +5073,7 @@ const _s = /* @__PURE__ */ W(Ni, [["render", Ri]]), Di = x({
|
|
|
4971
5073
|
return this.$el;
|
|
4972
5074
|
},
|
|
4973
5075
|
$marker() {
|
|
4974
|
-
return Me(this.$parent,
|
|
5076
|
+
return Me(this.$parent, bt);
|
|
4975
5077
|
},
|
|
4976
5078
|
getOptions() {
|
|
4977
5079
|
return {
|
|
@@ -4994,16 +5096,16 @@ const _s = /* @__PURE__ */ W(Ni, [["render", Ri]]), Di = x({
|
|
|
4994
5096
|
this.$marker() ? this.$marker().onRemoveInfo(this) : this.overlay.close();
|
|
4995
5097
|
}
|
|
4996
5098
|
});
|
|
4997
|
-
function
|
|
4998
|
-
return
|
|
5099
|
+
function ji(i, e, t, r, s, n) {
|
|
5100
|
+
return Mr((Z(), W("div", le({
|
|
4999
5101
|
class: i.$options.name
|
|
5000
5102
|
}, i.attrs.binds), [
|
|
5001
|
-
|
|
5103
|
+
R(i.$slots, "default")
|
|
5002
5104
|
], 16)), [
|
|
5003
|
-
[
|
|
5105
|
+
[br, i.show]
|
|
5004
5106
|
]);
|
|
5005
5107
|
}
|
|
5006
|
-
const
|
|
5108
|
+
const ws = /* @__PURE__ */ j(Wi, [["render", ji]]), Vi = x({
|
|
5007
5109
|
name: "tg-label",
|
|
5008
5110
|
mixins: [L],
|
|
5009
5111
|
inheritAttrs: !1,
|
|
@@ -5014,7 +5116,7 @@ const Ms = /* @__PURE__ */ W(Di, [["render", Gi]]), Zi = x({
|
|
|
5014
5116
|
},
|
|
5015
5117
|
setup(i, { attrs: e }) {
|
|
5016
5118
|
return {
|
|
5017
|
-
attrs:
|
|
5119
|
+
attrs: K(e),
|
|
5018
5120
|
overlay: void 0
|
|
5019
5121
|
};
|
|
5020
5122
|
},
|
|
@@ -5041,7 +5143,7 @@ const Ms = /* @__PURE__ */ W(Di, [["render", Gi]]), Zi = x({
|
|
|
5041
5143
|
return (i = this.$marker()) == null ? void 0 : i.marker;
|
|
5042
5144
|
},
|
|
5043
5145
|
$marker() {
|
|
5044
|
-
return Me(this.$parent,
|
|
5146
|
+
return Me(this.$parent, bt);
|
|
5045
5147
|
},
|
|
5046
5148
|
getOptions() {
|
|
5047
5149
|
return {
|
|
@@ -5059,19 +5161,19 @@ const Ms = /* @__PURE__ */ W(Di, [["render", Gi]]), Zi = x({
|
|
|
5059
5161
|
this.$marker() ? this.$marker().onRemoveLabel(this) : this.$map.removeOverlay(this.overlay);
|
|
5060
5162
|
}
|
|
5061
5163
|
});
|
|
5062
|
-
function
|
|
5063
|
-
return Z(),
|
|
5164
|
+
function Hi(i, e, t, r, s, n) {
|
|
5165
|
+
return Z(), W("div", le({
|
|
5064
5166
|
class: i.$options.name
|
|
5065
5167
|
}, i.attrs.binds), [
|
|
5066
|
-
|
|
5168
|
+
R(i.$slots, "default")
|
|
5067
5169
|
], 16);
|
|
5068
5170
|
}
|
|
5069
|
-
const
|
|
5171
|
+
const Cs = /* @__PURE__ */ j(Vi, [["render", Hi]]), xs = x({
|
|
5070
5172
|
name: "tg-polygon",
|
|
5071
5173
|
mixins: [L],
|
|
5072
5174
|
inheritAttrs: !1,
|
|
5073
5175
|
props: {
|
|
5074
|
-
paths:
|
|
5176
|
+
paths: z(Array),
|
|
5075
5177
|
clickable: f(Boolean),
|
|
5076
5178
|
editable: f(Boolean),
|
|
5077
5179
|
strokeColor: f(String),
|
|
@@ -5083,7 +5185,7 @@ const bs = /* @__PURE__ */ W(Zi, [["render", ji]]), Ts = x({
|
|
|
5083
5185
|
},
|
|
5084
5186
|
setup(i, { attrs: e }) {
|
|
5085
5187
|
return {
|
|
5086
|
-
attrs:
|
|
5188
|
+
attrs: K(e),
|
|
5087
5189
|
polygon: void 0
|
|
5088
5190
|
};
|
|
5089
5191
|
},
|
|
@@ -5125,12 +5227,12 @@ const bs = /* @__PURE__ */ W(Zi, [["render", ji]]), Ts = x({
|
|
|
5125
5227
|
onDestroy() {
|
|
5126
5228
|
this.$map.removeOverlay(this.polygon);
|
|
5127
5229
|
}
|
|
5128
|
-
}),
|
|
5230
|
+
}), Es = x({
|
|
5129
5231
|
name: "tg-polyline",
|
|
5130
5232
|
mixins: [L],
|
|
5131
5233
|
inheritAttrs: !1,
|
|
5132
5234
|
props: {
|
|
5133
|
-
path:
|
|
5235
|
+
path: z(Array),
|
|
5134
5236
|
clickable: f(Boolean),
|
|
5135
5237
|
editable: f(Boolean),
|
|
5136
5238
|
strokeColor: f(String),
|
|
@@ -5140,7 +5242,7 @@ const bs = /* @__PURE__ */ W(Zi, [["render", ji]]), Ts = x({
|
|
|
5140
5242
|
},
|
|
5141
5243
|
setup(i, { attrs: e }) {
|
|
5142
5244
|
return {
|
|
5143
|
-
attrs:
|
|
5245
|
+
attrs: K(e),
|
|
5144
5246
|
polyline: void 0
|
|
5145
5247
|
};
|
|
5146
5248
|
},
|
|
@@ -5176,14 +5278,14 @@ const bs = /* @__PURE__ */ W(Zi, [["render", ji]]), Ts = x({
|
|
|
5176
5278
|
onDestroy() {
|
|
5177
5279
|
this.$map.removeOverlay(this.polyline);
|
|
5178
5280
|
}
|
|
5179
|
-
}),
|
|
5281
|
+
}), Fi = ["beforeUpdate", "updated"], Ls = {
|
|
5180
5282
|
install(i, e = {}) {
|
|
5181
5283
|
if (e.enable !== !1) {
|
|
5182
5284
|
const t = x({
|
|
5183
5285
|
beforeCreate() {
|
|
5184
|
-
const r =
|
|
5185
|
-
e.hookNames ? e.hookNames.includes(a) && console.debug("[lifecycle]", r, a) :
|
|
5186
|
-
} :
|
|
5286
|
+
const r = or() ?? "", n = (e.nameRegex || /^[A-Z]/).test(r) ? (a) => {
|
|
5287
|
+
e.hookNames ? e.hookNames.includes(a) && console.debug("[lifecycle]", r, a) : Fi.includes(a) || console.debug("[lifecycle]", r, a);
|
|
5288
|
+
} : ue;
|
|
5187
5289
|
n("beforeCreate"), this.__life_impl = n;
|
|
5188
5290
|
},
|
|
5189
5291
|
created() {
|
|
@@ -5222,159 +5324,164 @@ const bs = /* @__PURE__ */ W(Zi, [["render", ji]]), Ts = x({
|
|
|
5222
5324
|
i.mixin(t);
|
|
5223
5325
|
}
|
|
5224
5326
|
}
|
|
5225
|
-
},
|
|
5226
|
-
function
|
|
5327
|
+
}, Ui = 6378137;
|
|
5328
|
+
function pe(i) {
|
|
5227
5329
|
return i * Math.PI / 180;
|
|
5228
5330
|
}
|
|
5229
|
-
function
|
|
5331
|
+
function Bt(i) {
|
|
5230
5332
|
return i * 180 / Math.PI;
|
|
5231
5333
|
}
|
|
5232
|
-
function
|
|
5334
|
+
function Yi(i, e) {
|
|
5233
5335
|
if (i.lat === e.lat && i.lng === e.lng)
|
|
5234
5336
|
return 0;
|
|
5235
|
-
const t =
|
|
5236
|
-
let n = Math.sin(r), a = Math.sin(s),
|
|
5237
|
-
const o =
|
|
5238
|
-
n = n * n, a = a * a,
|
|
5239
|
-
const h = n * (1 - a) + (1 -
|
|
5240
|
-
return b * (1 + l * (
|
|
5241
|
-
}
|
|
5242
|
-
function
|
|
5243
|
-
const s = 63567523142e-4, n = 1 / 298.257223563, a =
|
|
5244
|
-
let v = 0,
|
|
5245
|
-
for (; Math.abs(
|
|
5246
|
-
v = Math.cos(2 * u +
|
|
5247
|
-
const
|
|
5248
|
-
|
|
5249
|
-
}
|
|
5250
|
-
const re =
|
|
5251
|
-
|
|
5252
|
-
(1 - n) * Math.sqrt(
|
|
5253
|
-
),
|
|
5254
|
-
return { lng: i.lng +
|
|
5255
|
-
}
|
|
5256
|
-
const
|
|
5257
|
-
getDistance:
|
|
5258
|
-
getDestination:
|
|
5259
|
-
},
|
|
5337
|
+
const t = pe((i.lat + e.lat) / 2), r = pe((i.lat - e.lat) / 2), s = pe((i.lng - e.lng) / 2);
|
|
5338
|
+
let n = Math.sin(r), a = Math.sin(s), c = Math.sin(t);
|
|
5339
|
+
const o = Ui, l = 1 / 298.257;
|
|
5340
|
+
n = n * n, a = a * a, c = c * c;
|
|
5341
|
+
const h = n * (1 - a) + (1 - c) * a, d = (1 - n) * (1 - a) + c * a, u = Math.atan(Math.sqrt(h / d)), _ = Math.sqrt(h * d) / u, b = 2 * u * o, M = (3 * _ - 1) / 2 / d, g = (3 * _ + 1) / 2 / h;
|
|
5342
|
+
return b * (1 + l * (M * c * (1 - n) - g * (1 - c) * n));
|
|
5343
|
+
}
|
|
5344
|
+
function Ki(i, e, t) {
|
|
5345
|
+
const s = 63567523142e-4, n = 1 / 298.257223563, a = pe(e), c = Math.sin(a), o = Math.cos(a), l = (1 - n) * Math.tan(pe(i.lat)), h = 1 / Math.sqrt(1 + l * l), d = l * h, u = Math.atan2(l, o), _ = h * c, b = 1 - _ * _, M = b * (6378137 * 6378137 - s * s) / (s * s), g = 1 + M / 16384 * (4096 + M * (-768 + M * (320 - 175 * M))), m = M / 1024 * (256 + M * (-128 + M * (74 - 47 * M)));
|
|
5346
|
+
let v = 0, O = 0, E = 0, w = t / (s * g), q = 2 * Math.PI;
|
|
5347
|
+
for (; Math.abs(w - q) > 1e-12; ) {
|
|
5348
|
+
v = Math.cos(2 * u + w), O = Math.sin(w), E = Math.cos(w);
|
|
5349
|
+
const hr = m * O * (v + m / 4 * (E * (-1 + 2 * v * v) - m / 6 * v * (-3 + 4 * O * O) * (-3 + 4 * v * v)));
|
|
5350
|
+
q = w, w = t / (s * g) + hr;
|
|
5351
|
+
}
|
|
5352
|
+
const re = d * O - h * E * o, $e = Math.atan2(
|
|
5353
|
+
d * E + h * O * o,
|
|
5354
|
+
(1 - n) * Math.sqrt(_ * _ + re * re)
|
|
5355
|
+
), ar = Math.atan2(O * c, h * E - d * O * o), Re = n / 16 * b * (4 + n * (4 - 3 * b)), lr = ar - (1 - Re) * n * _ * (w + Re * O * (v + Re * E * (-1 + 2 * v * v)));
|
|
5356
|
+
return { lng: i.lng + Bt(lr), lat: Bt($e) };
|
|
5357
|
+
}
|
|
5358
|
+
const Ps = {
|
|
5359
|
+
getDistance: Yi,
|
|
5360
|
+
getDestination: Ki
|
|
5361
|
+
}, ks = {
|
|
5260
5362
|
install(i, e) {
|
|
5261
|
-
|
|
5363
|
+
Dr(e), i.config.unwrapInjectedRef = !0;
|
|
5262
5364
|
const t = i.config.optionMergeStrategies;
|
|
5263
5365
|
t[ve] = t[_e] = (r, s) => r ? [...new Set([].concat(r, s))] : Array.isArray(s) ? s : [s];
|
|
5264
5366
|
}
|
|
5265
5367
|
};
|
|
5266
5368
|
export {
|
|
5267
|
-
|
|
5268
|
-
|
|
5369
|
+
Wt as AbstractControl,
|
|
5370
|
+
rt as AbstractMap,
|
|
5269
5371
|
xe as Arrays,
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5372
|
+
Yt as Autocomplete,
|
|
5373
|
+
Yr as BaiduAutocomplete,
|
|
5374
|
+
ot as BaiduCircle,
|
|
5375
|
+
Ye as BaiduControl,
|
|
5376
|
+
dt as BaiduInfoBoxOverlay,
|
|
5377
|
+
ht as BaiduInfoWindow,
|
|
5378
|
+
qe as BaiduMapTypeControl,
|
|
5277
5379
|
ye as BaiduMarker,
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5380
|
+
Qr as BaiduMarkerClusterer,
|
|
5381
|
+
Ae as BaiduOverlay,
|
|
5382
|
+
ri as BaiduPlacesService,
|
|
5383
|
+
ft as BaiduPolygon,
|
|
5384
|
+
vt as BaiduPolyline,
|
|
5385
|
+
Xe as BaiduScaleControl,
|
|
5386
|
+
si as BaiduSearchBox,
|
|
5387
|
+
Qe as BaiduZoomControl,
|
|
5388
|
+
xt as CachedValue,
|
|
5287
5389
|
P as ControlPosition,
|
|
5288
5390
|
B as ControlPositionConverter,
|
|
5289
5391
|
Q as CoordType,
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5392
|
+
Vr as CustomControl,
|
|
5393
|
+
jr as FastFindValues,
|
|
5394
|
+
Ur as GoogleAutocomplete,
|
|
5395
|
+
at as GoogleCircle,
|
|
5396
|
+
Ke as GoogleControl,
|
|
5397
|
+
pt as GoogleInfoBoxOverlay,
|
|
5398
|
+
ct as GoogleInfoWindow,
|
|
5399
|
+
Oe as GoogleMapTypeControl,
|
|
5400
|
+
mt as GoogleMarker,
|
|
5401
|
+
ei as GoogleMarkerClusterer,
|
|
5402
|
+
it as GoogleOverlay,
|
|
5403
|
+
ti as GooglePlacesService,
|
|
5404
|
+
yt as GooglePolygon,
|
|
5405
|
+
_t as GooglePolyline,
|
|
5406
|
+
Je as GoogleScaleControl,
|
|
5407
|
+
ii as GoogleSearchBox,
|
|
5408
|
+
et as GoogleZoomControl,
|
|
5409
|
+
ke as Icon,
|
|
5410
|
+
lt as InfoWindow,
|
|
5411
|
+
Ct as KeyValue,
|
|
5310
5412
|
y as LatLng,
|
|
5311
5413
|
F as LatLngBounds,
|
|
5312
|
-
|
|
5414
|
+
Ls as LifecycleLogPlugin,
|
|
5313
5415
|
ve as MIXIN_HOOK_CREATE,
|
|
5314
5416
|
_e as MIXIN_HOOK_DESTROY,
|
|
5315
|
-
|
|
5417
|
+
Mt as MIXIN_MAP_NAME,
|
|
5316
5418
|
Ee as MVCArrays,
|
|
5317
5419
|
L as MapMixin,
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5420
|
+
Vt as MapTypeControlType,
|
|
5421
|
+
ni as MapZoom,
|
|
5422
|
+
Qt as MarkerClusterer,
|
|
5423
|
+
me as Objects,
|
|
5424
|
+
ir as Overlay,
|
|
5425
|
+
er as PlacesService,
|
|
5324
5426
|
U as Point,
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5427
|
+
tr as SearchBox,
|
|
5428
|
+
Ps as SphericalUtils,
|
|
5429
|
+
fe as Strings,
|
|
5430
|
+
Ie as SymbolIcon,
|
|
5431
|
+
hs as SymbolPath,
|
|
5432
|
+
bs as TgCircle,
|
|
5433
|
+
fs as TgCustomControl,
|
|
5434
|
+
Ts as TgElementOverlay,
|
|
5435
|
+
Os as TgInfoBox,
|
|
5436
|
+
ws as TgInfoWindow,
|
|
5437
|
+
Cs as TgLabel,
|
|
5438
|
+
wi as TgMap,
|
|
5439
|
+
Fe as TgMapFactory,
|
|
5336
5440
|
$ as TgMapType,
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5441
|
+
ys as TgMapTypeControl,
|
|
5442
|
+
ms as TgMapWidget,
|
|
5443
|
+
bt as TgMarker,
|
|
5444
|
+
Si as TgMarkerClusterer,
|
|
5445
|
+
xs as TgPolygon,
|
|
5446
|
+
Es as TgPolyline,
|
|
5447
|
+
vs as TgScaleControl,
|
|
5448
|
+
Ms as TgTrafficLayer,
|
|
5449
|
+
_s as TgZoomControl,
|
|
5450
|
+
Pe as UnionIcon,
|
|
5451
|
+
se as assert,
|
|
5452
|
+
Ze as assertNever,
|
|
5346
5453
|
Te as callHook,
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5454
|
+
cs as computedSaveOnThis,
|
|
5455
|
+
nr as createEmptyVNode,
|
|
5456
|
+
Mi as createPropertyObject,
|
|
5457
|
+
ds as createPropertyObjectTyped,
|
|
5458
|
+
es as debug,
|
|
5459
|
+
ks as default,
|
|
5460
|
+
gs as eventLogMethods,
|
|
5461
|
+
N as eventProp,
|
|
5462
|
+
us as extractVNodeFromSlotsByComponent,
|
|
5463
|
+
ps as findByComponentType,
|
|
5464
|
+
Ki as getDestination,
|
|
5465
|
+
Dt as getTgMapConfig,
|
|
5466
|
+
ts as isDef,
|
|
5467
|
+
is as isInstanceOf,
|
|
5468
|
+
rs as lateinit,
|
|
5469
|
+
ue as noop,
|
|
5363
5470
|
f as optionalProp,
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5471
|
+
ci as path,
|
|
5472
|
+
z as requiredProp,
|
|
5473
|
+
ss as safeAs,
|
|
5367
5474
|
Me as safeAsComponent,
|
|
5368
|
-
|
|
5369
|
-
|
|
5475
|
+
Dr as setTgMapConfig,
|
|
5476
|
+
bi as splitAttrs,
|
|
5370
5477
|
G as stringEnumProp,
|
|
5371
|
-
|
|
5478
|
+
_i as stringUnionPropFromValues,
|
|
5372
5479
|
C as throwError,
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5480
|
+
$t as throwUnsupported,
|
|
5481
|
+
Qi as todo,
|
|
5482
|
+
je as typed,
|
|
5483
|
+
ns as unwrapStringEnumValue,
|
|
5484
|
+
K as useSplittedAttrs,
|
|
5485
|
+
ki as useTgMap
|
|
5379
5486
|
};
|
|
5380
5487
|
//# sourceMappingURL=tg-map.js.map
|