tg-map-vue3 3.1.9 → 3.2.1
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/event-target.d.ts +2 -0
- package/dist/src/map/map/baidu-map.d.ts +2 -0
- package/dist/src/map/map/extra/autocomplete.d.ts +9 -3
- package/dist/src/map/map/extra/places-service.d.ts +12 -7
- package/dist/src/map/map/extra/search-box.d.ts +38 -0
- package/dist/src/map/map/google-map.d.ts +2 -0
- package/dist/src/map/map/here-map.d.ts +2 -0
- package/dist/src/map/map/map.d.ts +2 -0
- package/dist/src/map/map/overlay/icon.d.ts +72 -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 +3 -2
- package/dist/src/utils/google-utils.d.ts +3 -0
- package/dist/src/utils/objects.d.ts +4 -0
- package/dist/tg-map.js +1020 -833
- 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,7 +26,7 @@ var Pt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
26
26
|
(function(i) {
|
|
27
27
|
(function(e, t) {
|
|
28
28
|
i.exports ? i.exports = t() : e.coordtransform = t();
|
|
29
|
-
})(
|
|
29
|
+
})(At, function() {
|
|
30
30
|
var e = 52.35987755982988, t = 3.141592653589793, r = 6378245, s = 0.006693421622965943;
|
|
31
31
|
function n(g, m, v, O) {
|
|
32
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);
|
|
@@ -61,35 +61,35 @@ var Pt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
61
61
|
return !1;
|
|
62
62
|
}
|
|
63
63
|
function l(g, m) {
|
|
64
|
-
var v = g - 65e-4, O = m - 6e-3, E = Math.sqrt(v * v + O * O) - 2e-5 * Math.sin(O * e), w = Math.atan2(O, v) - 3e-6 * Math.cos(v * e),
|
|
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
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
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
|
-
function
|
|
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), O =
|
|
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
82
|
w = 1 - s * w * w;
|
|
83
|
-
var
|
|
84
|
-
v = v * 180 / (r * (1 - s) / (w *
|
|
85
|
-
var re = m + v,
|
|
86
|
-
return [
|
|
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,54 +97,54 @@ var Pt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
97
97
|
// 向前兼容
|
|
98
98
|
bd09togcj02: l,
|
|
99
99
|
gcj02tobd09: h,
|
|
100
|
-
wgs84togcj02:
|
|
101
|
-
gcj02towgs84:
|
|
100
|
+
wgs84togcj02: d,
|
|
101
|
+
gcj02towgs84: u,
|
|
102
102
|
// 小驼峰命名风格
|
|
103
103
|
bd09ToGcj02: l,
|
|
104
104
|
gcj02ToBd09: h,
|
|
105
|
-
wgs84ToGcj02:
|
|
106
|
-
gcj02ToWgs84:
|
|
105
|
+
wgs84ToGcj02: d,
|
|
106
|
+
gcj02ToWgs84: u,
|
|
107
107
|
bd09ToWgs84: function(g, m) {
|
|
108
108
|
if (!o(g, m))
|
|
109
109
|
return [g, m];
|
|
110
110
|
var v = l(g, m);
|
|
111
|
-
return
|
|
111
|
+
return u(v[0], v[1]);
|
|
112
112
|
},
|
|
113
113
|
wgs84ToBd09: function(g, m) {
|
|
114
114
|
if (!o(g, m))
|
|
115
115
|
return [g, m];
|
|
116
|
-
var v =
|
|
116
|
+
var v = 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
|
-
function
|
|
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;
|
|
@@ -236,7 +236,7 @@ const J = class {
|
|
|
236
236
|
return t.build();
|
|
237
237
|
}
|
|
238
238
|
static from(...e) {
|
|
239
|
-
return this.fromArray(e) ??
|
|
239
|
+
return this.fromArray(e) ?? C("positions中没有点");
|
|
240
240
|
}
|
|
241
241
|
static fromGoogle(e, t) {
|
|
242
242
|
return new J(
|
|
@@ -281,15 +281,15 @@ const J = class {
|
|
|
281
281
|
}
|
|
282
282
|
};
|
|
283
283
|
let F = J;
|
|
284
|
-
|
|
284
|
+
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 @@ d(F, "EMPTY", new J(y.ZERO, y.ZERO));
|
|
|
310
310
|
}
|
|
311
311
|
i.Builder = e;
|
|
312
312
|
})(F || (F = {}));
|
|
313
|
-
var
|
|
314
|
-
return
|
|
313
|
+
var 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
330
|
function ge(i, e) {
|
|
331
|
-
return e.clone !== !1 && e.isMergeableObject(i) ?
|
|
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
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) &&
|
|
364
|
+
return t.isMergeableObject(i) && Ot(i).forEach(function(s) {
|
|
365
365
|
r[s] = ge(i[s], t);
|
|
366
|
-
}),
|
|
367
|
-
|
|
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"], Ir = {
|
|
|
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,52 +445,55 @@ 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
|
}
|
|
460
|
-
function
|
|
460
|
+
function Me(i, e) {
|
|
461
461
|
if ((i == null ? void 0 : i.$options.name) === e.name)
|
|
462
462
|
return i;
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function 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
|
-
|
|
476
|
+
function wt(i, e, t) {
|
|
477
|
+
return i.addEventListener(e, t), () => i.removeEventListener(e, t);
|
|
478
|
+
}
|
|
479
|
+
class Zt {
|
|
477
480
|
constructor(e, t) {
|
|
478
|
-
|
|
479
|
-
|
|
481
|
+
p(this, "eventMap", /* @__PURE__ */ new Map());
|
|
482
|
+
p(this, "target", void 0);
|
|
480
483
|
this.inner = e, this.coordTypeSupplier = t, this.addEventListener = this.addEventListener.bind(this), this.removeEventListener = this.removeEventListener.bind(this);
|
|
481
484
|
}
|
|
482
485
|
setTarget(e) {
|
|
483
486
|
return this.target = e, this;
|
|
484
487
|
}
|
|
485
488
|
}
|
|
486
|
-
const
|
|
489
|
+
const Tt = class extends Zt {
|
|
487
490
|
addEventListener(e, t) {
|
|
488
|
-
const r =
|
|
491
|
+
const r = we(e, t);
|
|
489
492
|
if (this.eventMap.get(r)) {
|
|
490
493
|
console.warn("listener已经添加过了", r, t);
|
|
491
494
|
return;
|
|
492
495
|
}
|
|
493
|
-
const s = this.inner.addListener(
|
|
496
|
+
const s = this.inner.addListener(Tt.EVENT_TYPE_MAP[e] || e, (n) => {
|
|
494
497
|
const a = {
|
|
495
498
|
type: e,
|
|
496
499
|
target: this.target,
|
|
@@ -501,13 +504,13 @@ const Mt = class extends zt {
|
|
|
501
504
|
this.eventMap.set(r, s);
|
|
502
505
|
}
|
|
503
506
|
removeEventListener(e, t) {
|
|
504
|
-
const r =
|
|
507
|
+
const r = we(e, t), s = this.eventMap.get(r);
|
|
505
508
|
s ? (s.remove(), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, t);
|
|
506
509
|
}
|
|
507
510
|
};
|
|
508
|
-
let ee =
|
|
511
|
+
let ee = Tt;
|
|
509
512
|
// 事件类型映射: tg => google
|
|
510
|
-
|
|
513
|
+
p(ee, "EVENT_TYPE_MAP", {
|
|
511
514
|
"center-changed": "center_changed",
|
|
512
515
|
"zoom-changed": "zoom_changed",
|
|
513
516
|
"map-type-changed": "maptypeid_changed",
|
|
@@ -518,9 +521,9 @@ d(ee, "EVENT_TYPE_MAP", {
|
|
|
518
521
|
"map-mouseup": "mouseup",
|
|
519
522
|
"map-dblclick": "dblclick"
|
|
520
523
|
});
|
|
521
|
-
const
|
|
524
|
+
const Be = class extends Zt {
|
|
522
525
|
addEventListener(e, t) {
|
|
523
|
-
const r =
|
|
526
|
+
const r = we(e, t);
|
|
524
527
|
if (this.eventMap.get(r)) {
|
|
525
528
|
console.warn("listener已经添加过了", r, t);
|
|
526
529
|
return;
|
|
@@ -533,25 +536,25 @@ const Pe = class extends zt {
|
|
|
533
536
|
};
|
|
534
537
|
n.point && (a.position = y.fromBaidu(n.point, this.coordTypeSupplier.coordType)), t.call(this.target, a);
|
|
535
538
|
};
|
|
536
|
-
this.inner.addEventListener(
|
|
539
|
+
this.inner.addEventListener(Be.EVENT_TYPE_MAP[e] || e, s), this.eventMap.set(r, s);
|
|
537
540
|
}
|
|
538
541
|
removeEventListener(e, t) {
|
|
539
|
-
const r =
|
|
540
|
-
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);
|
|
541
544
|
}
|
|
542
545
|
};
|
|
543
|
-
let
|
|
546
|
+
let ne = Be;
|
|
544
547
|
// cSpell:words clickclose
|
|
545
548
|
// 事件类型映射, tg => baidu
|
|
546
|
-
|
|
549
|
+
p(ne, "EVENT_TYPE_MAP", {
|
|
547
550
|
drag: "dragging",
|
|
548
551
|
closeclick: "clickclose",
|
|
549
552
|
"zoom-changed": "zoomend",
|
|
550
553
|
"map-type-changed": "maptypechange"
|
|
551
554
|
});
|
|
552
|
-
class
|
|
555
|
+
class Wr {
|
|
553
556
|
constructor() {
|
|
554
|
-
|
|
557
|
+
p(this, "typeMap", /* @__PURE__ */ new Map());
|
|
555
558
|
}
|
|
556
559
|
addEventListener(e, t) {
|
|
557
560
|
let r = this.typeMap.get(e);
|
|
@@ -570,27 +573,27 @@ class zr {
|
|
|
570
573
|
t && t.forEach((r) => r.call(e.target, e));
|
|
571
574
|
}
|
|
572
575
|
}
|
|
573
|
-
class
|
|
576
|
+
class Ct {
|
|
574
577
|
/**
|
|
575
578
|
* `keys`和`values`数组中可以有相同的值, 若存在相同值, 则index越小的优先级越高
|
|
576
579
|
*/
|
|
577
580
|
constructor(e, t) {
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
+
p(this, "keyToValue", /* @__PURE__ */ new Map());
|
|
582
|
+
p(this, "valueToKey", /* @__PURE__ */ new Map());
|
|
583
|
+
se(e.length === t.length);
|
|
581
584
|
for (let r = e.length - 1; r >= 0; r--)
|
|
582
585
|
this.keyToValue.set(e[r], t[r]), this.valueToKey.set(t[r], e[r]);
|
|
583
586
|
}
|
|
584
587
|
toKey(e) {
|
|
585
|
-
return this.valueToKey.get(e) ??
|
|
588
|
+
return this.valueToKey.get(e) ?? C();
|
|
586
589
|
}
|
|
587
590
|
toValue(e) {
|
|
588
|
-
return this.keyToValue.get(e) ??
|
|
591
|
+
return this.keyToValue.get(e) ?? C();
|
|
589
592
|
}
|
|
590
593
|
}
|
|
591
|
-
class
|
|
594
|
+
class jr {
|
|
592
595
|
constructor(e, t = 10) {
|
|
593
|
-
|
|
596
|
+
p(this, "map", /* @__PURE__ */ new Map());
|
|
594
597
|
this.values = e, this.maxSize4Debug = t;
|
|
595
598
|
}
|
|
596
599
|
/** 获取保存key-value映射的Map */
|
|
@@ -614,19 +617,19 @@ class Nr {
|
|
|
614
617
|
return this.getValueMap(e).get(t);
|
|
615
618
|
}
|
|
616
619
|
get(e, t) {
|
|
617
|
-
return this.getOrNull(e, t) ??
|
|
620
|
+
return this.getOrNull(e, t) ?? C(`key(${t})不存在与valueMap(${this.getValueMap(e)})中`);
|
|
618
621
|
}
|
|
619
622
|
}
|
|
620
|
-
class
|
|
623
|
+
class xt {
|
|
621
624
|
constructor(e) {
|
|
622
|
-
|
|
625
|
+
p(this, "value");
|
|
623
626
|
this.creator = e;
|
|
624
627
|
}
|
|
625
628
|
get() {
|
|
626
629
|
return this.value === void 0 && (this.value = this.creator()), this.value;
|
|
627
630
|
}
|
|
628
631
|
}
|
|
629
|
-
var
|
|
632
|
+
var P = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-center", i.TOP_RIGHT = "top-right", i.BOTTOM_LEFT = "bottom-left", i.BOTTOM_CENTER = "bottom-center", i.BOTTOM_RIGHT = "bottom-right", i.LEFT_TOP = "left-top", i.LEFT_CENTER = "left-center", i.LEFT_BOTTOM = "left-bottom", i.RIGHT_TOP = "right-top", i.RIGHT_CENTER = "right-center", i.RIGHT_BOTTOM = "right-bottom", i))(P || {}), B;
|
|
630
633
|
((i) => {
|
|
631
634
|
let e, t;
|
|
632
635
|
const r = [
|
|
@@ -645,7 +648,7 @@ var k = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
645
648
|
/* RIGHT_BOTTOM */
|
|
646
649
|
];
|
|
647
650
|
function s() {
|
|
648
|
-
return e || (e = new
|
|
651
|
+
return e || (e = new Ct(r, [
|
|
649
652
|
/* | @tg/map |名字相同| baidu | */
|
|
650
653
|
/* TOP_LEFT = */
|
|
651
654
|
BMAP_ANCHOR_TOP_LEFT,
|
|
@@ -675,7 +678,7 @@ var k = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
675
678
|
}
|
|
676
679
|
i.getBaidu = s;
|
|
677
680
|
function n() {
|
|
678
|
-
return t || (t = new
|
|
681
|
+
return t || (t = new Ct(r, [
|
|
679
682
|
google.maps.ControlPosition.TOP_LEFT,
|
|
680
683
|
google.maps.ControlPosition.TOP_CENTER,
|
|
681
684
|
google.maps.ControlPosition.TOP_RIGHT,
|
|
@@ -692,16 +695,16 @@ var k = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
692
695
|
}
|
|
693
696
|
i.getGoogle = n;
|
|
694
697
|
})(B || (B = {}));
|
|
695
|
-
class
|
|
698
|
+
class Vr {
|
|
696
699
|
constructor(e) {
|
|
697
700
|
/** 实际添加到地图中的control对象 */
|
|
698
|
-
|
|
701
|
+
p(this, "inner");
|
|
699
702
|
this.position = e;
|
|
700
703
|
}
|
|
701
704
|
}
|
|
702
|
-
class
|
|
705
|
+
class Wt {
|
|
703
706
|
}
|
|
704
|
-
class
|
|
707
|
+
class Ye extends Wt {
|
|
705
708
|
constructor(e, t) {
|
|
706
709
|
super(), this.inner = e, this.position = t;
|
|
707
710
|
}
|
|
@@ -724,11 +727,11 @@ class Fe extends Nt {
|
|
|
724
727
|
e.innerMap.removeControl(this.inner);
|
|
725
728
|
}
|
|
726
729
|
}
|
|
727
|
-
class
|
|
730
|
+
class Ke extends Wt {
|
|
728
731
|
constructor(t, r) {
|
|
729
732
|
super();
|
|
730
|
-
|
|
731
|
-
|
|
733
|
+
p(this, "visible", !1);
|
|
734
|
+
p(this, "map");
|
|
732
735
|
this._type = t, this.position = r;
|
|
733
736
|
}
|
|
734
737
|
isVisible() {
|
|
@@ -761,8 +764,8 @@ class Ue extends Nt {
|
|
|
761
764
|
});
|
|
762
765
|
}
|
|
763
766
|
}
|
|
764
|
-
var
|
|
765
|
-
class
|
|
767
|
+
var jt = /* @__PURE__ */ ((i) => (i.normal = "normal", i.satellite = "satellite", i.hybrid = "hybrid", i))(jt || {});
|
|
768
|
+
class k {
|
|
766
769
|
constructor(e, t, r, s) {
|
|
767
770
|
this.id = e, this.baidu = t, this.google = r, this.googleCoordType = s;
|
|
768
771
|
}
|
|
@@ -783,13 +786,13 @@ class P {
|
|
|
783
786
|
return this.google();
|
|
784
787
|
}
|
|
785
788
|
asGoogleMapType() {
|
|
786
|
-
|
|
789
|
+
$t("google的内置地图没有对应的实例");
|
|
787
790
|
}
|
|
788
791
|
}
|
|
789
|
-
class
|
|
792
|
+
class Hr {
|
|
790
793
|
constructor() {
|
|
791
|
-
|
|
792
|
-
|
|
794
|
+
p(this, "baiduCache", new xt(() => new BMap.TrafficLayer()));
|
|
795
|
+
p(this, "googleCache", new xt(() => new google.maps.TrafficLayer()));
|
|
793
796
|
}
|
|
794
797
|
asBaiduLayer() {
|
|
795
798
|
return this.baiduCache.get();
|
|
@@ -800,19 +803,19 @@ class Dr {
|
|
|
800
803
|
}
|
|
801
804
|
var I;
|
|
802
805
|
((i) => {
|
|
803
|
-
i.NORMAL = new
|
|
806
|
+
i.NORMAL = new k("normal", () => BMAP_NORMAL_MAP, () => google.maps.MapTypeId.ROADMAP, Q.gcj02), i.SATELLITE = new k("satellite", () => BMAP_SATELLITE_MAP, () => google.maps.MapTypeId.SATELLITE, Q.wgs84), i.HYBRID = new k("hybrid", () => BMAP_HYBRID_MAP, () => google.maps.MapTypeId.HYBRID, Q.gcj02), i.TERRAIN = new k("terrain", () => (
|
|
804
807
|
/* 三维 */
|
|
805
808
|
BMAP_PERSPECTIVE_MAP
|
|
806
809
|
), () => (
|
|
807
810
|
/* 地形 */
|
|
808
811
|
google.maps.MapTypeId.TERRAIN
|
|
809
|
-
), Q.wgs84), i.BUILD_IN_MAP_TYPES = new
|
|
812
|
+
), Q.wgs84), i.BUILD_IN_MAP_TYPES = new jr([i.NORMAL, i.SATELLITE, i.HYBRID, i.TERRAIN]);
|
|
810
813
|
})(I || (I = {}));
|
|
811
|
-
var
|
|
812
|
-
const
|
|
813
|
-
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 {
|
|
814
817
|
static create(e) {
|
|
815
|
-
const t = e.mapTypes ??
|
|
818
|
+
const t = e.mapTypes ?? Ht, r = {
|
|
816
819
|
default: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
817
820
|
horizontal: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
818
821
|
dropdown: BMAP_MAPTYPE_CONTROL_DROPDOWN
|
|
@@ -820,11 +823,11 @@ class Ye extends Fe {
|
|
|
820
823
|
type: e.type && r[e.type],
|
|
821
824
|
mapTypes: t.map((n) => n.asBaiduMapType())
|
|
822
825
|
});
|
|
823
|
-
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);
|
|
824
827
|
}
|
|
825
828
|
}
|
|
826
|
-
const ie = class extends
|
|
827
|
-
constructor(e = "default", t =
|
|
829
|
+
const ie = class extends Ke {
|
|
830
|
+
constructor(e = "default", t = P.TOP_LEFT, r = Ht) {
|
|
828
831
|
super("mapType", t), this.type = e, this.mapTypes = r, ie.type2google || (ie.type2google = {
|
|
829
832
|
default: google.maps.MapTypeControlStyle.DEFAULT,
|
|
830
833
|
horizontal: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
|
|
@@ -836,69 +839,69 @@ const ie = class extends Ue {
|
|
|
836
839
|
}
|
|
837
840
|
onCreateOptions() {
|
|
838
841
|
const e = super.onCreateOptions();
|
|
839
|
-
return e.style = ie.type2google[this.type], e.mapTypeIds = this.mapTypes.map((t) => t instanceof
|
|
842
|
+
return e.style = ie.type2google[this.type], e.mapTypeIds = this.mapTypes.map((t) => t instanceof k ? t.getGoogleMapTypeId() : t.id), e;
|
|
840
843
|
}
|
|
841
844
|
addTo(e) {
|
|
842
845
|
super.addTo(e), this.mapTypes.forEach((t) => {
|
|
843
|
-
t instanceof
|
|
846
|
+
t instanceof k || e.innerMap.mapTypes.set(t.id, t.asGoogleMapType());
|
|
844
847
|
});
|
|
845
848
|
}
|
|
846
849
|
};
|
|
847
|
-
let
|
|
848
|
-
|
|
849
|
-
class
|
|
850
|
+
let Oe = ie;
|
|
851
|
+
p(Oe, "type2google");
|
|
852
|
+
class Xe extends Ye {
|
|
850
853
|
static create(e) {
|
|
851
854
|
const t = new BMap.ScaleControl({
|
|
852
855
|
anchor: e.position && B.getBaidu().toValue(e.position)
|
|
853
856
|
});
|
|
854
|
-
return new
|
|
857
|
+
return new Xe(t, e.position);
|
|
855
858
|
}
|
|
856
859
|
}
|
|
857
|
-
class
|
|
860
|
+
class Je extends Ke {
|
|
858
861
|
static create(e) {
|
|
859
|
-
return new
|
|
862
|
+
return new Je(e.position);
|
|
860
863
|
}
|
|
861
|
-
constructor(e =
|
|
864
|
+
constructor(e = P.BOTTOM_RIGHT) {
|
|
862
865
|
super("scale", e);
|
|
863
866
|
}
|
|
864
867
|
}
|
|
865
|
-
class
|
|
868
|
+
class Qe extends Ye {
|
|
866
869
|
static create(e) {
|
|
867
870
|
const t = new BMap.NavigationControl({
|
|
868
871
|
type: BMAP_NAVIGATION_CONTROL_ZOOM,
|
|
869
872
|
// enableGeolocation: true,
|
|
870
873
|
anchor: e.position && B.getBaidu().toValue(e.position)
|
|
871
874
|
});
|
|
872
|
-
return new
|
|
875
|
+
return new Qe(t, e.position);
|
|
873
876
|
}
|
|
874
877
|
}
|
|
875
|
-
class
|
|
878
|
+
class et extends Ke {
|
|
876
879
|
static create(e) {
|
|
877
|
-
return new
|
|
880
|
+
return new et(e.position);
|
|
878
881
|
}
|
|
879
|
-
constructor(e =
|
|
882
|
+
constructor(e = P.RIGHT_BOTTOM) {
|
|
880
883
|
super("zoom", e);
|
|
881
884
|
}
|
|
882
885
|
}
|
|
883
|
-
function
|
|
886
|
+
function Fr(i) {
|
|
884
887
|
let e, t, r;
|
|
885
|
-
const s = "The Google Maps JavaScript API", n = "google", a = "importLibrary", c = "__ib__", o = document, l = window, h = l[n] || (l[n] = {}),
|
|
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) => {
|
|
886
889
|
var m;
|
|
887
|
-
await (t = o.createElement("script")),
|
|
890
|
+
await (t = o.createElement("script")), _.set("libraries", [...u] + "");
|
|
888
891
|
for (r in i)
|
|
889
|
-
|
|
890
|
-
|
|
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);
|
|
891
894
|
}));
|
|
892
|
-
|
|
895
|
+
d[a] ? console.warn(s + " only loads once. Ignoring:", i) : d[a] = (M, ...g) => u.add(M) && b().then(() => d[a](M, ...g));
|
|
893
896
|
}
|
|
894
|
-
let
|
|
897
|
+
let Et;
|
|
895
898
|
const te = {
|
|
896
899
|
/** Google的坐标0点 */
|
|
897
900
|
get LATLNG_ZERO() {
|
|
898
|
-
return
|
|
901
|
+
return Et ?? (Et = new google.maps.LatLng({ lat: 0, lng: 0 }));
|
|
899
902
|
}
|
|
900
903
|
};
|
|
901
|
-
function
|
|
904
|
+
function Ft(i, e = { country: "", province: "", city: "", district: "", street: "", streetNumber: "" }) {
|
|
902
905
|
for (const t of i)
|
|
903
906
|
for (const r of t.types)
|
|
904
907
|
switch (r) {
|
|
@@ -923,16 +926,26 @@ function Gt(i, e = { country: "", province: "", city: "", district: "", street:
|
|
|
923
926
|
}
|
|
924
927
|
return e;
|
|
925
928
|
}
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
929
|
+
function Ut(i, e) {
|
|
930
|
+
var r;
|
|
931
|
+
const t = i.address_components && Ft(i.address_components);
|
|
932
|
+
return {
|
|
933
|
+
country: (t == null ? void 0 : t.country) ?? "",
|
|
934
|
+
province: (t == null ? void 0 : t.province) ?? "",
|
|
935
|
+
city: (t == null ? void 0 : t.city) ?? "",
|
|
936
|
+
id: i.place_id ?? "",
|
|
937
|
+
address: i.formatted_address ?? "",
|
|
938
|
+
position: y.fromGoogle(((r = i.geometry) == null ? void 0 : r.location) ?? te.LATLNG_ZERO, e.coordType),
|
|
939
|
+
title: i.name ?? ""
|
|
940
|
+
};
|
|
930
941
|
}
|
|
931
|
-
class
|
|
942
|
+
class Yt {
|
|
943
|
+
}
|
|
944
|
+
class Ur extends Yt {
|
|
932
945
|
constructor(t, r) {
|
|
933
|
-
super(
|
|
934
|
-
|
|
935
|
-
this.inner = new google.maps.places.Autocomplete(r.input, {
|
|
946
|
+
super();
|
|
947
|
+
p(this, "inner");
|
|
948
|
+
this.map = t, this.inner = new google.maps.places.Autocomplete(r.input, {
|
|
936
949
|
fields: [
|
|
937
950
|
"address_components",
|
|
938
951
|
// 'formatted_address',
|
|
@@ -940,8 +953,11 @@ class Gr extends jt {
|
|
|
940
953
|
]
|
|
941
954
|
}), r.bindToMap && this.inner.bindTo("bounds", t.innerMap);
|
|
942
955
|
}
|
|
956
|
+
setBounds(t) {
|
|
957
|
+
this.inner.setBounds(t.toGoogle(this.map.coordType));
|
|
958
|
+
}
|
|
943
959
|
addResultListener(t) {
|
|
944
|
-
return
|
|
960
|
+
return Gt(this.inner, "place_changed", () => {
|
|
945
961
|
const r = this.inner.getPlace(), s = {
|
|
946
962
|
title: r.name ?? "",
|
|
947
963
|
province: "",
|
|
@@ -951,30 +967,40 @@ class Gr extends jt {
|
|
|
951
967
|
streetNumber: "",
|
|
952
968
|
country: ""
|
|
953
969
|
};
|
|
954
|
-
r.address_components &&
|
|
970
|
+
r.address_components && Ft(r.address_components, s), t(s);
|
|
955
971
|
});
|
|
956
972
|
}
|
|
957
973
|
}
|
|
958
|
-
class
|
|
974
|
+
class Yr extends Yt {
|
|
959
975
|
constructor(t, r) {
|
|
960
|
-
super(
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
976
|
+
super();
|
|
977
|
+
p(this, "inner");
|
|
978
|
+
p(this, "input");
|
|
979
|
+
// TODO: 要不要添加个移除监听的方法?
|
|
980
|
+
p(this, "removeableArray", []);
|
|
981
|
+
if (this.map = t, this.input = r.input, this.inner = new BMap.Autocomplete({
|
|
964
982
|
input: r.input,
|
|
965
983
|
location: r.bindToMap ? t.innerMap : void 0
|
|
966
|
-
})
|
|
984
|
+
}), r.bindToMap) {
|
|
985
|
+
const s = () => {
|
|
986
|
+
this.inner.setLocation(this.map.innerMap);
|
|
987
|
+
};
|
|
988
|
+
this.removeableArray.push(wt(this.map, "center-changed", s)), this.removeableArray.push(wt(this.map, "zoom-changed", s));
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
setBounds(t) {
|
|
992
|
+
this.inner.setLocation(t.getCenter().toBaidu(this.map.coordType));
|
|
967
993
|
}
|
|
968
994
|
addResultListener(t) {
|
|
969
995
|
let r = 0;
|
|
970
|
-
const s =
|
|
996
|
+
const s = Gr(this.inner, "confirm", (a) => {
|
|
971
997
|
const c = a.item.value;
|
|
972
998
|
r = Date.now(), t(Object.assign({
|
|
973
999
|
title: c.business,
|
|
974
1000
|
country: ""
|
|
975
1001
|
// Baidu的自动完成只支持中国
|
|
976
1002
|
}, c));
|
|
977
|
-
}), n =
|
|
1003
|
+
}), n = Zr(this.input, "keyup", (a) => {
|
|
978
1004
|
a.key === "Enter" && Date.now() - r > 100 && t({
|
|
979
1005
|
title: this.input.value,
|
|
980
1006
|
country: "",
|
|
@@ -990,9 +1016,9 @@ class jr extends jt {
|
|
|
990
1016
|
};
|
|
991
1017
|
}
|
|
992
1018
|
}
|
|
993
|
-
let
|
|
1019
|
+
let Kr = class Kt {
|
|
994
1020
|
constructor(e, t, r) {
|
|
995
|
-
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;
|
|
996
1022
|
var s = r || {};
|
|
997
1023
|
this.zIndex_ = s.zIndex || google.maps.Marker.MAX_ZINDEX + 1, this.gridSize_ = s.gridSize || 60, this.minClusterSize_ = s.minimumClusterSize || 2, this.maxZoom_ = s.maxZoom || null, this.styles_ = s.styles || [], this.imagePath_ = s.imagePath || this.MARKER_CLUSTER_IMAGE_PATH_, this.imageExtension_ = s.imageExtension || this.MARKER_CLUSTER_IMAGE_EXTENSION_, this.zoomOnClick_ = !0, s.zoomOnClick != null && (this.zoomOnClick_ = s.zoomOnClick), this.averageCenter_ = !1, s.averageCenter != null && (this.averageCenter_ = s.averageCenter), this.setupStyles_(), this.setMap(e), this.prevZoom_ = this.map_.getZoom();
|
|
998
1024
|
var n = this;
|
|
@@ -1411,7 +1437,7 @@ let Wr = class Wt {
|
|
|
1411
1437
|
if (r && r.isMarkerInClusterBounds(e))
|
|
1412
1438
|
r.addMarker(e);
|
|
1413
1439
|
else {
|
|
1414
|
-
var o = new
|
|
1440
|
+
var o = new qr(this);
|
|
1415
1441
|
o.addMarker(e), this.clusters_.push(o);
|
|
1416
1442
|
}
|
|
1417
1443
|
}
|
|
@@ -1428,9 +1454,9 @@ let Wr = class Wt {
|
|
|
1428
1454
|
), t = this.getExtendedBounds(e), r = 0, s; s = this.markers_[r]; r++)
|
|
1429
1455
|
!s.isAdded && this.isMarkerInBounds_(s, t) && this.addToClosestCluster_(s);
|
|
1430
1456
|
}
|
|
1431
|
-
},
|
|
1457
|
+
}, qr = class {
|
|
1432
1458
|
constructor(e) {
|
|
1433
|
-
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(
|
|
1434
1460
|
this,
|
|
1435
1461
|
e.getStyles(),
|
|
1436
1462
|
e.getGridSize()
|
|
@@ -1564,9 +1590,9 @@ let Wr = class Wt {
|
|
|
1564
1590
|
this.clusterIcon_.setCenter(this.center_), this.clusterIcon_.setSums(a), this.clusterIcon_.show();
|
|
1565
1591
|
}
|
|
1566
1592
|
};
|
|
1567
|
-
class
|
|
1593
|
+
class tt {
|
|
1568
1594
|
constructor(e, t, r) {
|
|
1569
|
-
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_);
|
|
1570
1596
|
}
|
|
1571
1597
|
/**
|
|
1572
1598
|
* Triggers the clusterclick event and zoom's if the option is set.
|
|
@@ -1697,18 +1723,18 @@ class Qe {
|
|
|
1697
1723
|
), t.join("");
|
|
1698
1724
|
}
|
|
1699
1725
|
}
|
|
1700
|
-
var
|
|
1726
|
+
var Ve = {}, Xr = {
|
|
1701
1727
|
get exports() {
|
|
1702
|
-
return
|
|
1728
|
+
return Ve;
|
|
1703
1729
|
},
|
|
1704
1730
|
set exports(i) {
|
|
1705
|
-
|
|
1731
|
+
Ve = i;
|
|
1706
1732
|
}
|
|
1707
1733
|
};
|
|
1708
1734
|
(function(i, e) {
|
|
1709
1735
|
(function(t, r) {
|
|
1710
1736
|
i.exports = r();
|
|
1711
|
-
})(
|
|
1737
|
+
})(At, function() {
|
|
1712
1738
|
var t, r = t = r || { version: "1.3.8" }, s = {};
|
|
1713
1739
|
r.guid = "$BAIDU$", s[r.guid] = s[r.guid] || {}, r.dom = r.dom || {}, r.dom.g = function(o) {
|
|
1714
1740
|
return typeof o == "string" || o instanceof String ? document.getElementById(o) : o && o.nodeName && (o.nodeType == 1 || o.nodeType == 9) ? o : null;
|
|
@@ -1720,11 +1746,11 @@ var je = {}, Hr = {
|
|
|
1720
1746
|
return r.lang.isString(o) ? document.getElementById(o) : o;
|
|
1721
1747
|
}, r._g = r.dom._g, r.browser = r.browser || {}, /msie (\d+\.\d)/i.test(navigator.userAgent) && (r.browser.ie = r.ie = document.documentMode || +RegExp.$1), r.dom.getComputedStyle = function(o, l) {
|
|
1722
1748
|
o = r.dom._g(o);
|
|
1723
|
-
var h = r.dom.getDocument(o),
|
|
1724
|
-
return h.defaultView && h.defaultView.getComputedStyle && (
|
|
1749
|
+
var h = r.dom.getDocument(o), d;
|
|
1750
|
+
return h.defaultView && h.defaultView.getComputedStyle && (d = h.defaultView.getComputedStyle(o, null), d) ? d[l] || d.getPropertyValue(l) : "";
|
|
1725
1751
|
}, r.dom._styleFixer = r.dom._styleFixer || {}, r.dom._styleFilter = r.dom._styleFilter || [], r.dom._styleFilter.filter = function(o, l, h) {
|
|
1726
|
-
for (var
|
|
1727
|
-
(
|
|
1752
|
+
for (var d = 0, u = r.dom._styleFilter, _; _ = u[d]; d++)
|
|
1753
|
+
(_ = _[h]) && (l = _(o, l));
|
|
1728
1754
|
return l;
|
|
1729
1755
|
}, r.string = r.string || {}, r.string.toCamelCase = function(o) {
|
|
1730
1756
|
return o.indexOf("-") < 0 && o.indexOf("_") < 0 ? o : o.replace(/[-_][^-_]/g, function(l) {
|
|
@@ -1733,42 +1759,42 @@ var je = {}, Hr = {
|
|
|
1733
1759
|
}, r.dom.getStyle = function(o, l) {
|
|
1734
1760
|
var h = r.dom;
|
|
1735
1761
|
o = h.g(o), l = r.string.toCamelCase(l);
|
|
1736
|
-
var
|
|
1737
|
-
if (!
|
|
1738
|
-
var
|
|
1739
|
-
|
|
1762
|
+
var d = o.style[l] || (o.currentStyle ? o.currentStyle[l] : "") || h.getComputedStyle(o, l);
|
|
1763
|
+
if (!d) {
|
|
1764
|
+
var u = h._styleFixer[l];
|
|
1765
|
+
u && (d = u.get ? u.get(o) : r.dom.getStyle(o, u));
|
|
1740
1766
|
}
|
|
1741
|
-
return (
|
|
1767
|
+
return (u = h._styleFilter) && (d = u.filter(l, d, "get")), d;
|
|
1742
1768
|
}, r.getStyle = r.dom.getStyle, /opera\/(\d+\.\d)/i.test(navigator.userAgent) && (r.browser.opera = +RegExp.$1), r.browser.isWebkit = /webkit/i.test(navigator.userAgent), r.browser.isGecko = /gecko/i.test(navigator.userAgent) && !/like gecko/i.test(navigator.userAgent), r.browser.isStrict = document.compatMode == "CSS1Compat", r.dom.getPosition = function(o) {
|
|
1743
1769
|
o = r.dom.g(o);
|
|
1744
|
-
var l = r.dom.getDocument(o), h = r.browser,
|
|
1745
|
-
h.isGecko > 0 && l.getBoxObjectFor &&
|
|
1746
|
-
var
|
|
1747
|
-
if (o ==
|
|
1748
|
-
return
|
|
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
|
+
return u;
|
|
1749
1775
|
if (o.getBoundingClientRect) {
|
|
1750
|
-
|
|
1751
|
-
var g = l.body, m = parseInt(
|
|
1752
|
-
h.ie && !h.isStrict && (
|
|
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
|
+
h.ie && !h.isStrict && (u.left -= isNaN(m) ? 2 : m, u.top -= isNaN(v) ? 2 : v);
|
|
1753
1779
|
} else {
|
|
1754
1780
|
b = o;
|
|
1755
1781
|
do {
|
|
1756
|
-
if (
|
|
1757
|
-
|
|
1782
|
+
if (u.left += b.offsetLeft, u.top += b.offsetTop, h.isWebkit > 0 && d(b, "position") == "fixed") {
|
|
1783
|
+
u.left += l.body.scrollLeft, u.top += l.body.scrollTop;
|
|
1758
1784
|
break;
|
|
1759
1785
|
}
|
|
1760
1786
|
b = b.offsetParent;
|
|
1761
1787
|
} while (b && b != o);
|
|
1762
|
-
for ((h.opera > 0 || h.isWebkit > 0 &&
|
|
1763
|
-
|
|
1788
|
+
for ((h.opera > 0 || h.isWebkit > 0 && d(o, "position") == "absolute") && (u.top -= l.body.offsetTop), b = o.offsetParent; b && b != l.body; )
|
|
1789
|
+
u.left -= b.scrollLeft, (!h.opera || b.tagName != "TR") && (u.top -= b.scrollTop), b = b.offsetParent;
|
|
1764
1790
|
}
|
|
1765
|
-
return
|
|
1791
|
+
return u;
|
|
1766
1792
|
}, r.event = r.event || {}, r.event._listeners = r.event._listeners || [], r.event.on = function(o, l, h) {
|
|
1767
1793
|
l = l.replace(/^on/i, ""), o = r.dom._g(o);
|
|
1768
|
-
var
|
|
1794
|
+
var d = function(g) {
|
|
1769
1795
|
h.call(o, g);
|
|
1770
|
-
},
|
|
1771
|
-
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;
|
|
1772
1798
|
}, r.on = r.event.on, function() {
|
|
1773
1799
|
var o = s[r.guid];
|
|
1774
1800
|
r.lang.guid = function() {
|
|
@@ -1790,13 +1816,13 @@ var je = {}, Hr = {
|
|
|
1790
1816
|
}, r.lang.Class.prototype.addEventListener = function(o, l, h) {
|
|
1791
1817
|
if (r.lang.isFunction(l)) {
|
|
1792
1818
|
!this.__listeners && (this.__listeners = {});
|
|
1793
|
-
var
|
|
1819
|
+
var d = this.__listeners, u;
|
|
1794
1820
|
if (typeof h == "string" && h) {
|
|
1795
1821
|
if (/[^\w\-]/.test(h))
|
|
1796
1822
|
throw "nonstandard key:" + h;
|
|
1797
|
-
l.hashCode = h,
|
|
1823
|
+
l.hashCode = h, u = h;
|
|
1798
1824
|
}
|
|
1799
|
-
o.indexOf("on") != 0 && (o = "on" + o), typeof
|
|
1825
|
+
o.indexOf("on") != 0 && (o = "on" + o), typeof d[o] != "object" && (d[o] = {}), u = u || r.lang.guid(), l.hashCode = u, d[o][u] = l;
|
|
1800
1826
|
}
|
|
1801
1827
|
}, r.lang.Class.prototype.removeEventListener = function(o, l) {
|
|
1802
1828
|
if (!(typeof l < "u" && (r.lang.isFunction(l) && !(l = l.hashCode) || !r.lang.isString(l)))) {
|
|
@@ -1806,24 +1832,24 @@ var je = {}, Hr = {
|
|
|
1806
1832
|
if (typeof l < "u")
|
|
1807
1833
|
h[o][l] && delete h[o][l];
|
|
1808
1834
|
else
|
|
1809
|
-
for (var
|
|
1810
|
-
delete h[o][
|
|
1835
|
+
for (var d in h[o])
|
|
1836
|
+
delete h[o][d];
|
|
1811
1837
|
}
|
|
1812
1838
|
}, r.lang.Class.prototype.dispatchEvent = function(o, l) {
|
|
1813
1839
|
r.lang.isString(o) && (o = new r.lang.Event(o)), !this.__listeners && (this.__listeners = {}), l = l || {};
|
|
1814
1840
|
for (var h in l)
|
|
1815
1841
|
o[h] = l[h];
|
|
1816
|
-
var h,
|
|
1817
|
-
if (o.target = o.target || this, o.currentTarget = this,
|
|
1818
|
-
for (h in u
|
|
1819
|
-
u
|
|
1842
|
+
var h, 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);
|
|
1820
1846
|
return o.returnValue;
|
|
1821
1847
|
}, r.lang.inherits = function(o, l, h) {
|
|
1822
|
-
var
|
|
1823
|
-
b.prototype = l.prototype,
|
|
1824
|
-
for (
|
|
1825
|
-
|
|
1826
|
-
o.prototype.constructor = o, o.superClass = l.prototype, typeof h == "string" && (
|
|
1848
|
+
var d, u, _ = o.prototype, b = new Function();
|
|
1849
|
+
b.prototype = l.prototype, u = o.prototype = new b();
|
|
1850
|
+
for (d in _)
|
|
1851
|
+
u[d] = _[d];
|
|
1852
|
+
o.prototype.constructor = o, o.superClass = l.prototype, typeof h == "string" && (u._className = h);
|
|
1827
1853
|
}, r.inherits = r.lang.inherits;
|
|
1828
1854
|
var n = "http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m", a = "png", c = function(o, l, h) {
|
|
1829
1855
|
try {
|
|
@@ -1852,8 +1878,8 @@ var je = {}, Hr = {
|
|
|
1852
1878
|
}, c.prototype.setPosition = function(o) {
|
|
1853
1879
|
o && (!this._position || !this._position.equals(o)) && (this._position = o, this._updatePosition());
|
|
1854
1880
|
}, c.prototype.getStyleByText = function(o, l) {
|
|
1855
|
-
var h = parseInt(o),
|
|
1856
|
-
return
|
|
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];
|
|
1857
1883
|
}, c.prototype._updateCss = function() {
|
|
1858
1884
|
if (this._domElement) {
|
|
1859
1885
|
var o = this.getStyleByText(this._text, this._styles);
|
|
@@ -1867,54 +1893,54 @@ var je = {}, Hr = {
|
|
|
1867
1893
|
l.x -= Math.ceil(parseInt(o.width) / 2), l.y -= Math.ceil(parseInt(o.height) / 2), o.left = l.x + "px", o.top = l.y + "px";
|
|
1868
1894
|
}
|
|
1869
1895
|
}, c.prototype._buildCssText = function(o) {
|
|
1870
|
-
var l = o.url, h = o.size,
|
|
1871
|
-
if (this._zIndex &&
|
|
1872
|
-
|
|
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 + '");');
|
|
1873
1899
|
else {
|
|
1874
|
-
|
|
1900
|
+
M.push("background-image:url(" + l + ");");
|
|
1875
1901
|
var g = "0 0";
|
|
1876
|
-
|
|
1902
|
+
u instanceof BMap.Size && (g = u.width + "px " + u.height + "px"), M.push("background-position:" + g + ";");
|
|
1877
1903
|
}
|
|
1878
|
-
return h instanceof BMap.Size && (
|
|
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("");
|
|
1879
1905
|
}, c.prototype._bind = function() {
|
|
1880
1906
|
if (!this._domElement)
|
|
1881
1907
|
return;
|
|
1882
1908
|
var o = this, l = this._map, h = t.lang.Event;
|
|
1883
|
-
function u
|
|
1884
|
-
var b =
|
|
1885
|
-
if (
|
|
1909
|
+
function 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) {
|
|
1886
1912
|
var m = t.dom.getPosition(l.getContainer());
|
|
1887
|
-
|
|
1913
|
+
_.pixel = new BMap.Pixel(M - m.left, g - m.top), _.point = l.pixelToPoint(_.pixel);
|
|
1888
1914
|
}
|
|
1889
|
-
return
|
|
1915
|
+
return _;
|
|
1890
1916
|
}
|
|
1891
|
-
t.event.on(this._domElement, "mouseover", function(
|
|
1892
|
-
o.dispatchEvent(u
|
|
1893
|
-
}), t.event.on(this._domElement, "mouseout", function(
|
|
1894
|
-
o.dispatchEvent(u
|
|
1895
|
-
}), t.event.on(this._domElement, "click", function(
|
|
1896
|
-
o.dispatchEvent(u
|
|
1917
|
+
t.event.on(this._domElement, "mouseover", function(u) {
|
|
1918
|
+
o.dispatchEvent(d(u, new h("onmouseover")));
|
|
1919
|
+
}), t.event.on(this._domElement, "mouseout", function(u) {
|
|
1920
|
+
o.dispatchEvent(d(u, new h("onmouseout")));
|
|
1921
|
+
}), t.event.on(this._domElement, "click", function(u) {
|
|
1922
|
+
o.dispatchEvent(d(u, new h("onclick")));
|
|
1897
1923
|
});
|
|
1898
1924
|
}, c;
|
|
1899
1925
|
});
|
|
1900
|
-
})(
|
|
1901
|
-
const
|
|
1902
|
-
var
|
|
1903
|
-
e =
|
|
1926
|
+
})(Xr);
|
|
1927
|
+
const Lt = Ve;
|
|
1928
|
+
var qt = function(i, e, t) {
|
|
1929
|
+
e = Jr(e);
|
|
1904
1930
|
var r = i.pointToPixel(e.getNorthEast()), s = i.pointToPixel(e.getSouthWest());
|
|
1905
1931
|
r.x += t, r.y -= t, s.x -= t, s.y += t;
|
|
1906
1932
|
var n = i.pixelToPoint(r), a = i.pixelToPoint(s);
|
|
1907
1933
|
return new BMap.Bounds(a, n);
|
|
1908
|
-
},
|
|
1909
|
-
var e =
|
|
1934
|
+
}, Jr = function(i) {
|
|
1935
|
+
var e = be(i.getNorthEast().lng, -180, 180), t = be(i.getSouthWest().lng, -180, 180), r = be(i.getNorthEast().lat, -74, 74), s = be(i.getSouthWest().lat, -74, 74);
|
|
1910
1936
|
return new BMap.Bounds(new BMap.Point(t, s), new BMap.Point(e, r));
|
|
1911
|
-
},
|
|
1937
|
+
}, be = function(i, e, t) {
|
|
1912
1938
|
return e && (i = Math.max(i, e)), t && (i = Math.min(i, t)), i;
|
|
1913
|
-
},
|
|
1939
|
+
}, Xt = function(i) {
|
|
1914
1940
|
return Object.prototype.toString.call(i) === "[object Array]";
|
|
1915
|
-
},
|
|
1941
|
+
}, Jt = function(i, e) {
|
|
1916
1942
|
var t = -1;
|
|
1917
|
-
if (
|
|
1943
|
+
if (Xt(e)) {
|
|
1918
1944
|
if (e.indexOf)
|
|
1919
1945
|
t = e.indexOf(i);
|
|
1920
1946
|
else
|
|
@@ -1942,7 +1968,7 @@ var Vt = function(i, e, t) {
|
|
|
1942
1968
|
r._redraw();
|
|
1943
1969
|
});
|
|
1944
1970
|
var s = t.markers;
|
|
1945
|
-
|
|
1971
|
+
Xt(s) && this.addMarkers(s);
|
|
1946
1972
|
}
|
|
1947
1973
|
};
|
|
1948
1974
|
T.prototype.addMarkers = function(i) {
|
|
@@ -1953,7 +1979,7 @@ T.prototype.addMarkers = function(i) {
|
|
|
1953
1979
|
}
|
|
1954
1980
|
};
|
|
1955
1981
|
T.prototype._pushMarkerTo = function(i) {
|
|
1956
|
-
var e =
|
|
1982
|
+
var e = Jt(i, this._markers);
|
|
1957
1983
|
e === -1 && (i.isInCluster = !1, this._markers.push(i));
|
|
1958
1984
|
};
|
|
1959
1985
|
T.prototype.addMarker = function(i) {
|
|
@@ -1962,7 +1988,7 @@ T.prototype.addMarker = function(i) {
|
|
|
1962
1988
|
T.prototype._createClusters = function() {
|
|
1963
1989
|
var i = this._map.getBounds();
|
|
1964
1990
|
if (i.getCenter()) {
|
|
1965
|
-
for (var e =
|
|
1991
|
+
for (var e = qt(this._map, i, this._gridSize), t = 0, r; r = this._markers[t]; t++)
|
|
1966
1992
|
!r.isInCluster && e.containsPoint(r.getPosition()) && this._addToClosestCluster(r);
|
|
1967
1993
|
for (var s = this._markers.length, t = 0; t < s; t++)
|
|
1968
1994
|
this._clusters[t] && this._clusters[t].render();
|
|
@@ -2002,7 +2028,7 @@ T.prototype._removeMarkersFromMap = function() {
|
|
|
2002
2028
|
}
|
|
2003
2029
|
};
|
|
2004
2030
|
T.prototype._removeMarker = function(i) {
|
|
2005
|
-
var e =
|
|
2031
|
+
var e = Jt(i, this._markers);
|
|
2006
2032
|
return e === -1 ? !1 : (this._map.removeOverlay(i), this._markers.splice(e, 1), !0);
|
|
2007
2033
|
};
|
|
2008
2034
|
T.prototype.removeMarker = function(i) {
|
|
@@ -2078,7 +2104,7 @@ T.prototype.setStylesIndexCalculator = function(i) {
|
|
|
2078
2104
|
};
|
|
2079
2105
|
function S(i) {
|
|
2080
2106
|
var e = this;
|
|
2081
|
-
this._markerClusterer = i, this._map = i.getMap(), this._minClusterSize = i.getMinClusterSize(), this._isAverageCenter = i.isAverageCenter(), this._center = null, this._markers = [], this._gridBounds = null, this._isReal = !1, this._clusterMarker = new
|
|
2107
|
+
this._markerClusterer = i, this._map = i.getMap(), this._minClusterSize = i.getMinClusterSize(), this._isAverageCenter = i.isAverageCenter(), this._center = null, this._markers = [], this._gridBounds = null, this._isReal = !1, this._clusterMarker = new Lt(this._center, this._markers.length, {
|
|
2082
2108
|
styles: this._markerClusterer.getStyles(),
|
|
2083
2109
|
zIndex: i._zIndex
|
|
2084
2110
|
}), this._clusterMarker.getStyleByText = function(t, r) {
|
|
@@ -2086,7 +2112,7 @@ function S(i) {
|
|
|
2086
2112
|
var s = e._markerClusterer._stylesIndexCalculator(e._markers, r.length);
|
|
2087
2113
|
return r[s];
|
|
2088
2114
|
}
|
|
2089
|
-
return
|
|
2115
|
+
return Lt.prototype.getStyleByText.call(this, t, r);
|
|
2090
2116
|
}, this._clusterMarker.addEventListener && this._clusterMarker.addEventListener("click", function(t) {
|
|
2091
2117
|
e._map.setViewport(e.getBounds());
|
|
2092
2118
|
});
|
|
@@ -2126,7 +2152,7 @@ S.prototype.isReal = function(i) {
|
|
|
2126
2152
|
};
|
|
2127
2153
|
S.prototype.updateGridBounds = function() {
|
|
2128
2154
|
var i = new BMap.Bounds(this._center, this._center);
|
|
2129
|
-
this._gridBounds =
|
|
2155
|
+
this._gridBounds = qt(this._map, i, this._markerClusterer.getGridSize());
|
|
2130
2156
|
};
|
|
2131
2157
|
S.prototype.updateClusterMarker = function() {
|
|
2132
2158
|
if (this._map.getZoom() > this._markerClusterer.getMaxZoom()) {
|
|
@@ -2182,9 +2208,9 @@ var Le;
|
|
|
2182
2208
|
}
|
|
2183
2209
|
i.toGoogle = t;
|
|
2184
2210
|
})(Le || (Le = {}));
|
|
2185
|
-
class
|
|
2211
|
+
class Qt {
|
|
2186
2212
|
constructor(e) {
|
|
2187
|
-
|
|
2213
|
+
p(this, "inner");
|
|
2188
2214
|
this.map = e;
|
|
2189
2215
|
}
|
|
2190
2216
|
/** baidu/google 拥有相同的函数名 */
|
|
@@ -2208,7 +2234,7 @@ class Ut {
|
|
|
2208
2234
|
return this.inner.removeMarkers(e.map((t) => t.innerOverlay));
|
|
2209
2235
|
}
|
|
2210
2236
|
}
|
|
2211
|
-
class
|
|
2237
|
+
class Qr extends Qt {
|
|
2212
2238
|
constructor(e, t) {
|
|
2213
2239
|
var s;
|
|
2214
2240
|
super(e), this.inner = new T(e.innerMap, {
|
|
@@ -2228,10 +2254,10 @@ class Ur extends Ut {
|
|
|
2228
2254
|
this.inner._redraw();
|
|
2229
2255
|
}
|
|
2230
2256
|
}
|
|
2231
|
-
class
|
|
2257
|
+
class ei extends Qt {
|
|
2232
2258
|
constructor(e, t) {
|
|
2233
2259
|
var s, n;
|
|
2234
|
-
super(e), this.inner = new
|
|
2260
|
+
super(e), this.inner = new Kr(
|
|
2235
2261
|
e.innerMap,
|
|
2236
2262
|
// google的构造器中的markers,不会触发重绘, 第一次绘制通过监听地图的'idle'事件触发, 可以直接设置
|
|
2237
2263
|
(s = t.markers) == null ? void 0 : s.map((a) => a.innerOverlay),
|
|
@@ -2255,19 +2281,21 @@ class Yr extends Ut {
|
|
|
2255
2281
|
this.inner.repaint();
|
|
2256
2282
|
}
|
|
2257
2283
|
}
|
|
2258
|
-
class
|
|
2259
|
-
constructor(
|
|
2260
|
-
this.map = e;
|
|
2284
|
+
class er {
|
|
2285
|
+
constructor() {
|
|
2261
2286
|
}
|
|
2262
2287
|
}
|
|
2263
|
-
class
|
|
2288
|
+
class ti extends er {
|
|
2264
2289
|
constructor(t, r) {
|
|
2265
|
-
super(
|
|
2266
|
-
|
|
2267
|
-
this.inner = new google.maps.places.PlacesService(t.innerMap);
|
|
2290
|
+
super();
|
|
2291
|
+
p(this, "inner");
|
|
2292
|
+
this.map = t, this.inner = new google.maps.places.PlacesService(t.innerMap);
|
|
2268
2293
|
}
|
|
2269
|
-
search(t) {
|
|
2270
|
-
return this.searchImpl(
|
|
2294
|
+
search(t, r) {
|
|
2295
|
+
return this.searchImpl(
|
|
2296
|
+
t,
|
|
2297
|
+
r instanceof y ? r.toGoogle(this.map.coordType) : r ?? this.map.innerMap.getCenter()
|
|
2298
|
+
);
|
|
2271
2299
|
}
|
|
2272
2300
|
searchInBounds(t, r) {
|
|
2273
2301
|
return this.searchImpl(t, r.toGoogle(this.map.coordType));
|
|
@@ -2284,26 +2312,14 @@ class qr extends Yt {
|
|
|
2284
2312
|
"geometry",
|
|
2285
2313
|
"name",
|
|
2286
2314
|
"place_id"
|
|
2287
|
-
// 'address_components', // 查询请求不支持该字段...
|
|
2315
|
+
// 'address_components', // TODO: 2023/04/28 ipcjs 查询请求不支持该字段...
|
|
2288
2316
|
],
|
|
2289
2317
|
locationBias: r
|
|
2290
2318
|
}, (a, c) => {
|
|
2291
2319
|
switch (c) {
|
|
2292
2320
|
case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:
|
|
2293
2321
|
case google.maps.places.PlacesServiceStatus.OK: {
|
|
2294
|
-
const o = (a ?? []).map((l) =>
|
|
2295
|
-
var p;
|
|
2296
|
-
const h = l.address_components && Gt(l.address_components);
|
|
2297
|
-
return {
|
|
2298
|
-
country: (h == null ? void 0 : h.country) ?? "",
|
|
2299
|
-
province: (h == null ? void 0 : h.province) ?? "",
|
|
2300
|
-
city: (h == null ? void 0 : h.city) ?? "",
|
|
2301
|
-
id: l.place_id ?? "",
|
|
2302
|
-
address: l.formatted_address ?? "",
|
|
2303
|
-
position: y.fromGoogle(((p = l.geometry) == null ? void 0 : p.location) ?? te.LATLNG_ZERO, this.map.coordType),
|
|
2304
|
-
title: l.name ?? ""
|
|
2305
|
-
};
|
|
2306
|
-
});
|
|
2322
|
+
const o = (a ?? []).map((l) => Ut(l, this.map));
|
|
2307
2323
|
s(o);
|
|
2308
2324
|
break;
|
|
2309
2325
|
}
|
|
@@ -2315,74 +2331,128 @@ class qr extends Yt {
|
|
|
2315
2331
|
});
|
|
2316
2332
|
}
|
|
2317
2333
|
}
|
|
2318
|
-
class
|
|
2334
|
+
class ri extends er {
|
|
2319
2335
|
constructor(t, r) {
|
|
2320
|
-
super(
|
|
2321
|
-
|
|
2322
|
-
|
|
2336
|
+
super();
|
|
2337
|
+
p(this, "searchRequestMap", /* @__PURE__ */ new Map());
|
|
2338
|
+
p(this, "currentSearch");
|
|
2339
|
+
this.map = t;
|
|
2323
2340
|
}
|
|
2324
2341
|
get inner() {
|
|
2325
2342
|
return this.currentSearch;
|
|
2326
2343
|
}
|
|
2327
|
-
search(t) {
|
|
2328
|
-
return this.newSearch(
|
|
2329
|
-
r.
|
|
2330
|
-
|
|
2344
|
+
search(t, r) {
|
|
2345
|
+
return this.newSearch(
|
|
2346
|
+
r instanceof y ? r.toBaidu(this.map.coordType) : r ?? this.map.innerMap.getCenter(),
|
|
2347
|
+
(s) => {
|
|
2348
|
+
s.search(t);
|
|
2349
|
+
}
|
|
2350
|
+
);
|
|
2331
2351
|
}
|
|
2332
2352
|
searchInBounds(t, r) {
|
|
2333
|
-
return this.newSearch((s) => {
|
|
2353
|
+
return this.newSearch(void 0, (s) => {
|
|
2334
2354
|
s.searchInBounds(t, r.toBaidu(this.map.coordType));
|
|
2335
2355
|
});
|
|
2336
2356
|
}
|
|
2337
2357
|
searchNearBy(t, r, s) {
|
|
2338
|
-
return this.newSearch((n) => {
|
|
2358
|
+
return this.newSearch(void 0, (n) => {
|
|
2339
2359
|
n.searchNearby(t, r.toBaidu(this.map.coordType), s);
|
|
2340
2360
|
});
|
|
2341
2361
|
}
|
|
2342
|
-
newSearch(t) {
|
|
2343
|
-
return new Promise((
|
|
2344
|
-
const
|
|
2345
|
-
onSearchComplete: (
|
|
2346
|
-
Array.isArray(
|
|
2347
|
-
const
|
|
2348
|
-
switch (
|
|
2362
|
+
newSearch(t, r) {
|
|
2363
|
+
return new Promise((s, n) => {
|
|
2364
|
+
const a = new BMap.LocalSearch(t ?? this.map.innerMap, {
|
|
2365
|
+
onSearchComplete: (c) => {
|
|
2366
|
+
Array.isArray(c) && $t("当前只支持一次搜索一条数据");
|
|
2367
|
+
const o = a.getStatus();
|
|
2368
|
+
switch (o) {
|
|
2349
2369
|
case BMAP_STATUS_SUCCESS: {
|
|
2350
|
-
const
|
|
2351
|
-
for (let
|
|
2352
|
-
const
|
|
2353
|
-
|
|
2354
|
-
id:
|
|
2355
|
-
city:
|
|
2370
|
+
const l = [];
|
|
2371
|
+
for (let h = 0; h < c.getCurrentNumPois(); h++) {
|
|
2372
|
+
const d = c.getPoi(h);
|
|
2373
|
+
l.push({
|
|
2374
|
+
id: d.uid,
|
|
2375
|
+
city: d.city,
|
|
2356
2376
|
country: "",
|
|
2357
2377
|
// 百度地图只支持中国
|
|
2358
|
-
position: y.fromBaidu(
|
|
2359
|
-
province:
|
|
2360
|
-
title:
|
|
2361
|
-
address:
|
|
2378
|
+
position: y.fromBaidu(d.point, this.map.coordType),
|
|
2379
|
+
province: d.province,
|
|
2380
|
+
title: d.title,
|
|
2381
|
+
address: d.address
|
|
2362
2382
|
});
|
|
2363
2383
|
}
|
|
2364
|
-
|
|
2384
|
+
s(l);
|
|
2365
2385
|
break;
|
|
2366
2386
|
}
|
|
2367
2387
|
case BMAP_STATUS_UNKNOWN_LOCATION:
|
|
2368
|
-
|
|
2388
|
+
s([]);
|
|
2369
2389
|
break;
|
|
2370
2390
|
default:
|
|
2371
|
-
|
|
2391
|
+
n(new Error(`status: ${o}`));
|
|
2372
2392
|
break;
|
|
2373
2393
|
}
|
|
2374
2394
|
}
|
|
2375
2395
|
});
|
|
2376
|
-
|
|
2396
|
+
r(a);
|
|
2397
|
+
});
|
|
2398
|
+
}
|
|
2399
|
+
}
|
|
2400
|
+
class tr {
|
|
2401
|
+
constructor(e, t) {
|
|
2402
|
+
p(this, "onData");
|
|
2403
|
+
p(this, "onError");
|
|
2404
|
+
this.map = e, this.input = t;
|
|
2405
|
+
}
|
|
2406
|
+
/**
|
|
2407
|
+
* 设置搜索结果监听
|
|
2408
|
+
*
|
|
2409
|
+
* @mustCallSuper 子类必须调用一次`super.setSearchListener`, 用来保存{@link onData}和{@link onError}
|
|
2410
|
+
* */
|
|
2411
|
+
setSearchListener(e, t) {
|
|
2412
|
+
return this.onData && C("setSearchListener只能调用一次"), this.onData = e, this.onError = t, ue;
|
|
2413
|
+
}
|
|
2414
|
+
}
|
|
2415
|
+
class ii extends tr {
|
|
2416
|
+
constructor(t, r) {
|
|
2417
|
+
super(t, r.input);
|
|
2418
|
+
p(this, "searchBox");
|
|
2419
|
+
this.searchBox = new google.maps.places.SearchBox(r.input), this.searchBox.bindTo("bounds", t.innerMap);
|
|
2420
|
+
}
|
|
2421
|
+
setSearchListener(t, r) {
|
|
2422
|
+
return super.setSearchListener(t, r), Gt(this.searchBox, "places_changed", () => {
|
|
2423
|
+
const s = this.searchBox.getPlaces();
|
|
2424
|
+
t((s ?? []).map((n) => Ut(n, this.map)));
|
|
2425
|
+
});
|
|
2426
|
+
}
|
|
2427
|
+
search() {
|
|
2428
|
+
this.input.value && (google.maps.event.trigger(this.input, "focus", {}), google.maps.event.trigger(this.input, "keydown", { keyCode: 13 }));
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
class si extends tr {
|
|
2432
|
+
constructor(t, r) {
|
|
2433
|
+
super(t, r.input);
|
|
2434
|
+
p(this, "autocomplete");
|
|
2435
|
+
p(this, "placeService");
|
|
2436
|
+
this.autocomplete = t.createAutocomplete({ input: r.input, bindToMap: !0 }), this.placeService = t.createPlaceService({});
|
|
2437
|
+
}
|
|
2438
|
+
setSearchListener(t, r) {
|
|
2439
|
+
return super.setSearchListener(t, r), this.autocomplete.addResultListener((s) => {
|
|
2440
|
+
this.searchImpl(s.country + s.province + s.city + s.district + s.street + s.streetNumber + s.title);
|
|
2377
2441
|
});
|
|
2378
2442
|
}
|
|
2443
|
+
search() {
|
|
2444
|
+
this.input.value && this.searchImpl(this.input.value);
|
|
2445
|
+
}
|
|
2446
|
+
searchImpl(t) {
|
|
2447
|
+
this.placeService.search(t).then(this.onData, this.onError);
|
|
2448
|
+
}
|
|
2379
2449
|
}
|
|
2380
|
-
var
|
|
2381
|
-
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 {
|
|
2382
2452
|
constructor(e) {
|
|
2383
|
-
|
|
2453
|
+
p(this, "latestInfoWindow");
|
|
2384
2454
|
/** 使用{@link setEventTargetDelegate}初始化 */
|
|
2385
|
-
|
|
2455
|
+
p(this, "delegate", void 0);
|
|
2386
2456
|
this.element = e, process.env.NODE_ENV !== "production" && setTimeout(() => {
|
|
2387
2457
|
this.delegate || console.warn(`${this.constructor.name}继承了AbstractMap, 但未调用setEventTargetDelegate(delegate)`);
|
|
2388
2458
|
});
|
|
@@ -2430,7 +2500,7 @@ class et {
|
|
|
2430
2500
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
2431
2501
|
* Released under the MIT License.
|
|
2432
2502
|
*/
|
|
2433
|
-
function
|
|
2503
|
+
function oi(i) {
|
|
2434
2504
|
return i != null && typeof i == "object" && Array.isArray(i) === !1;
|
|
2435
2505
|
}
|
|
2436
2506
|
/*!
|
|
@@ -2439,58 +2509,80 @@ function Jr(i) {
|
|
|
2439
2509
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
2440
2510
|
* Released under the MIT License.
|
|
2441
2511
|
*/
|
|
2442
|
-
function
|
|
2443
|
-
return
|
|
2512
|
+
function Pt(i) {
|
|
2513
|
+
return oi(i) === !0 && Object.prototype.toString.call(i) === "[object Object]";
|
|
2444
2514
|
}
|
|
2445
|
-
function
|
|
2515
|
+
function rr(i) {
|
|
2446
2516
|
var e, t;
|
|
2447
|
-
return !(
|
|
2517
|
+
return !(Pt(i) === !1 || (e = i.constructor, typeof e != "function") || (t = e.prototype, Pt(t) === !1) || t.hasOwnProperty("isPrototypeOf") === !1);
|
|
2448
2518
|
}
|
|
2449
2519
|
var me;
|
|
2450
2520
|
((i) => {
|
|
2451
|
-
function e(
|
|
2452
|
-
return
|
|
2521
|
+
function e(c, o) {
|
|
2522
|
+
return c.reduce((l, h) => (l[o(h)] = h, l), {});
|
|
2453
2523
|
}
|
|
2454
2524
|
i.fromArray = e;
|
|
2455
|
-
function t(
|
|
2456
|
-
return
|
|
2525
|
+
function t(c) {
|
|
2526
|
+
return c.reduce((o, l) => (o[l[0]] = l[1], o), {});
|
|
2457
2527
|
}
|
|
2458
2528
|
i.fromEntries = t;
|
|
2459
|
-
function r(
|
|
2460
|
-
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);
|
|
2461
2531
|
}
|
|
2462
2532
|
i.toJsonSafely = r;
|
|
2463
|
-
function s(
|
|
2464
|
-
|
|
2465
|
-
|
|
2533
|
+
function s(c) {
|
|
2534
|
+
rr(c) && Object.keys(c).forEach((o) => {
|
|
2535
|
+
c[o] === void 0 ? delete c[o] : s(c[o]);
|
|
2466
2536
|
});
|
|
2467
2537
|
}
|
|
2468
2538
|
i.deleteUndefinedPropertyOnPlainObjectDeeply = s;
|
|
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;
|
|
2469
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
|
+
}
|
|
2470
2562
|
me.toJsonSafely;
|
|
2471
|
-
const
|
|
2472
|
-
var D = /* @__PURE__ */ ((i) => (i.auto = "auto", i.none = "none", i.greedy = "greedy", i.cooperative = "cooperative", i))(D || {}),
|
|
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;
|
|
2473
2565
|
((i) => {
|
|
2474
2566
|
function e(t) {
|
|
2475
2567
|
me.deleteUndefinedPropertyOnPlainObjectDeeply(t);
|
|
2476
2568
|
const r = { center: y.ZERO, zoom: 5 };
|
|
2477
|
-
return
|
|
2478
|
-
isMergeableObject:
|
|
2569
|
+
return zt(r, t || {}, {
|
|
2570
|
+
isMergeableObject: rr
|
|
2479
2571
|
});
|
|
2480
2572
|
}
|
|
2481
2573
|
i.create = e;
|
|
2482
|
-
})(
|
|
2483
|
-
class
|
|
2574
|
+
})(He || (He = {}));
|
|
2575
|
+
class ir {
|
|
2484
2576
|
constructor(e, t, r, s) {
|
|
2485
|
-
|
|
2486
|
-
|
|
2577
|
+
p(this, "addEventListener");
|
|
2578
|
+
p(this, "removeEventListener");
|
|
2487
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;
|
|
2488
2580
|
}
|
|
2489
2581
|
remove() {
|
|
2490
2582
|
this.map.removeOverlay(this);
|
|
2491
2583
|
}
|
|
2492
2584
|
}
|
|
2493
|
-
class
|
|
2585
|
+
class it extends ir {
|
|
2494
2586
|
constructor(e, t, r) {
|
|
2495
2587
|
super(e, t, r, new ee(e, r));
|
|
2496
2588
|
}
|
|
@@ -2501,9 +2593,9 @@ class tt extends Kt {
|
|
|
2501
2593
|
this.innerOverlay.setVisible(e);
|
|
2502
2594
|
}
|
|
2503
2595
|
}
|
|
2504
|
-
class
|
|
2596
|
+
class Ae extends ir {
|
|
2505
2597
|
constructor(e, t, r) {
|
|
2506
|
-
super(e, t, r, new
|
|
2598
|
+
super(e, t, r, new ne(e, r));
|
|
2507
2599
|
}
|
|
2508
2600
|
/** 仅限内部使用; 设为private时, 生成的d.ts文件中, 方法返回值会变成any, 故改成了public */
|
|
2509
2601
|
get overlay() {
|
|
@@ -2520,7 +2612,7 @@ class Be extends Kt {
|
|
|
2520
2612
|
return e !== void 0 && (e || this.setVisible(!1)), this;
|
|
2521
2613
|
}
|
|
2522
2614
|
}
|
|
2523
|
-
class
|
|
2615
|
+
class st extends Ae {
|
|
2524
2616
|
constructor(e, t, r, s) {
|
|
2525
2617
|
super(e, t, r), this.state = s;
|
|
2526
2618
|
}
|
|
@@ -2546,7 +2638,7 @@ class rt extends Be {
|
|
|
2546
2638
|
this.innerOverlay.setFillOpacity(e);
|
|
2547
2639
|
}
|
|
2548
2640
|
}
|
|
2549
|
-
class
|
|
2641
|
+
class nt extends it {
|
|
2550
2642
|
isEditable() {
|
|
2551
2643
|
return this.innerOverlay.getEditable();
|
|
2552
2644
|
}
|
|
@@ -2569,7 +2661,7 @@ class it extends tt {
|
|
|
2569
2661
|
this.innerOverlay.setOptions({ fillOpacity: e });
|
|
2570
2662
|
}
|
|
2571
2663
|
}
|
|
2572
|
-
class
|
|
2664
|
+
class ot extends st {
|
|
2573
2665
|
static create(e) {
|
|
2574
2666
|
const t = this.coordType, r = new BMap.Circle(e.center.toBaidu(t), e.radius, {
|
|
2575
2667
|
enableClicking: e.clickable,
|
|
@@ -2580,7 +2672,7 @@ class st extends rt {
|
|
|
2580
2672
|
fillColor: e.fillColor,
|
|
2581
2673
|
fillOpacity: e.fillOpacity
|
|
2582
2674
|
});
|
|
2583
|
-
return new
|
|
2675
|
+
return new ot(r, t, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
2584
2676
|
}
|
|
2585
2677
|
setCenter(e) {
|
|
2586
2678
|
this.coordType = this.map.coordType, this.innerOverlay.setCenter(e.toBaidu(this.coordType));
|
|
@@ -2595,7 +2687,7 @@ class st extends rt {
|
|
|
2595
2687
|
return this.innerOverlay.getRadius();
|
|
2596
2688
|
}
|
|
2597
2689
|
}
|
|
2598
|
-
class
|
|
2690
|
+
class at extends nt {
|
|
2599
2691
|
static create(e) {
|
|
2600
2692
|
const t = this.coordType, r = new google.maps.Circle({
|
|
2601
2693
|
center: e.center.toGoogle(t),
|
|
@@ -2609,7 +2701,7 @@ class nt extends it {
|
|
|
2609
2701
|
fillOpacity: e.fillOpacity,
|
|
2610
2702
|
visible: e.visible
|
|
2611
2703
|
});
|
|
2612
|
-
return new
|
|
2704
|
+
return new at(r, t, this);
|
|
2613
2705
|
}
|
|
2614
2706
|
setCenter(e) {
|
|
2615
2707
|
this.coordType = this.map.coordType, this.innerOverlay.setCenter(e.toGoogle(this.coordType));
|
|
@@ -2624,29 +2716,29 @@ class nt extends it {
|
|
|
2624
2716
|
return this.innerOverlay.getRadius();
|
|
2625
2717
|
}
|
|
2626
2718
|
}
|
|
2627
|
-
function
|
|
2719
|
+
function sr() {
|
|
2628
2720
|
BMap.OverlayV3 || (BMap.OverlayV3 = BMap.Overlay);
|
|
2629
2721
|
}
|
|
2630
2722
|
var U;
|
|
2631
2723
|
((i) => {
|
|
2632
2724
|
i.ZERO = { x: 0, y: 0 };
|
|
2633
2725
|
})(U || (U = {}));
|
|
2634
|
-
let
|
|
2635
|
-
function
|
|
2636
|
-
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);
|
|
2637
2729
|
}
|
|
2638
|
-
function
|
|
2639
|
-
|
|
2730
|
+
function hi() {
|
|
2731
|
+
sr();
|
|
2640
2732
|
const i = new BMap.Point(0, 0);
|
|
2641
2733
|
return class extends BMap.OverlayV3 {
|
|
2642
2734
|
constructor(r, s = i, n = U.ZERO, a, c = 654, o = "") {
|
|
2643
2735
|
super();
|
|
2644
2736
|
// 类表达式不能有私有成员, 故改成public
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2737
|
+
p(this, "container");
|
|
2738
|
+
p(this, "border");
|
|
2739
|
+
p(this, "inner");
|
|
2740
|
+
p(this, "map");
|
|
2741
|
+
p(this, "marker");
|
|
2650
2742
|
this.content = r, this.position = s, this.offset = n;
|
|
2651
2743
|
const l = "baidu-info-box-container";
|
|
2652
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";
|
|
@@ -2704,7 +2796,7 @@ function ti() {
|
|
|
2704
2796
|
}
|
|
2705
2797
|
};
|
|
2706
2798
|
}
|
|
2707
|
-
class
|
|
2799
|
+
class lt {
|
|
2708
2800
|
constructor(e) {
|
|
2709
2801
|
this.delegate = e, this.delegate.setTarget(this);
|
|
2710
2802
|
}
|
|
@@ -2715,9 +2807,9 @@ class ot {
|
|
|
2715
2807
|
this.delegate.removeEventListener(e, t);
|
|
2716
2808
|
}
|
|
2717
2809
|
}
|
|
2718
|
-
class
|
|
2810
|
+
class ht extends lt {
|
|
2719
2811
|
constructor(e, t, r) {
|
|
2720
|
-
super(new
|
|
2812
|
+
super(new ne(e, t)), this.inner = e, this.map = t, this.state = r;
|
|
2721
2813
|
}
|
|
2722
2814
|
static create(e) {
|
|
2723
2815
|
const t = e.position || y.ZERO, r = new BMap.InfoWindow(e.content, {
|
|
@@ -2725,7 +2817,7 @@ class at extends ot {
|
|
|
2725
2817
|
offset: e.offset && new BMap.Size(e.offset.x, e.offset.y),
|
|
2726
2818
|
enableAutoPan: !e.disableAutoPan
|
|
2727
2819
|
});
|
|
2728
|
-
return new
|
|
2820
|
+
return new ht(r, this, { position: t });
|
|
2729
2821
|
}
|
|
2730
2822
|
isOpen() {
|
|
2731
2823
|
return this.inner.isOpen();
|
|
@@ -2744,11 +2836,11 @@ class at extends ot {
|
|
|
2744
2836
|
this.state.position = e, this.inner.isOpen() && this.open();
|
|
2745
2837
|
}
|
|
2746
2838
|
}
|
|
2747
|
-
class
|
|
2839
|
+
class ct extends lt {
|
|
2748
2840
|
constructor(t, r) {
|
|
2749
2841
|
super(new ee(t, r));
|
|
2750
|
-
|
|
2751
|
-
|
|
2842
|
+
p(this, "eventHub", new Wr());
|
|
2843
|
+
p(this, "isOpened", !1);
|
|
2752
2844
|
this.inner = t, this.map = r, t.addListener("closeclick", () => {
|
|
2753
2845
|
this.isOpened = !1, this.eventHub.hasListener("close") && this.eventHub.notify({ type: "close", target: this });
|
|
2754
2846
|
}), t.addListener("map_changed", () => {
|
|
@@ -2764,7 +2856,7 @@ class lt extends ot {
|
|
|
2764
2856
|
position: r.toGoogle(this.coordType),
|
|
2765
2857
|
disableAutoPan: t.disableAutoPan
|
|
2766
2858
|
});
|
|
2767
|
-
return new
|
|
2859
|
+
return new ct(s, this);
|
|
2768
2860
|
}
|
|
2769
2861
|
isOpen() {
|
|
2770
2862
|
return this.isOpened;
|
|
@@ -2802,13 +2894,13 @@ class lt extends ot {
|
|
|
2802
2894
|
this.inner.setPosition(t.toGoogle(this.map.coordType));
|
|
2803
2895
|
}
|
|
2804
2896
|
}
|
|
2805
|
-
class
|
|
2897
|
+
class dt extends Ae {
|
|
2806
2898
|
constructor(e, t, r) {
|
|
2807
2899
|
super(e, t, r), this.baiduMap = r;
|
|
2808
2900
|
}
|
|
2809
2901
|
static create(e) {
|
|
2810
2902
|
var s;
|
|
2811
|
-
const t = this.coordType, r =
|
|
2903
|
+
const t = this.coordType, r = li(
|
|
2812
2904
|
e.content,
|
|
2813
2905
|
(s = e.position) == null ? void 0 : s.toBaidu(t),
|
|
2814
2906
|
e.offset,
|
|
@@ -2816,7 +2908,7 @@ class ht extends Be {
|
|
|
2816
2908
|
e.maxWidth,
|
|
2817
2909
|
e.borderClass
|
|
2818
2910
|
);
|
|
2819
|
-
return new
|
|
2911
|
+
return new dt(r, t, this);
|
|
2820
2912
|
}
|
|
2821
2913
|
open(e) {
|
|
2822
2914
|
this.innerOverlay.open(this.baiduMap.innerMap, e == null ? void 0 : e.innerOverlay);
|
|
@@ -2837,7 +2929,7 @@ class ht extends Be {
|
|
|
2837
2929
|
this.innerOverlay.setZIndex(e);
|
|
2838
2930
|
}
|
|
2839
2931
|
}
|
|
2840
|
-
class
|
|
2932
|
+
class pt extends lt {
|
|
2841
2933
|
constructor(e, t, r) {
|
|
2842
2934
|
super(new ee(e, r)), this.inner = e, this.coordType = t, this.map = r;
|
|
2843
2935
|
}
|
|
@@ -2854,7 +2946,7 @@ class ct extends ot {
|
|
|
2854
2946
|
var c;
|
|
2855
2947
|
const a = (c = e.content.parentElement) == null ? void 0 : c.parentElement;
|
|
2856
2948
|
a && a.className.includes("gm-style-iw-c") && !a.className.includes(s) && (a.className += ` ${s}`);
|
|
2857
|
-
}), new
|
|
2949
|
+
}), new pt(r, t, this);
|
|
2858
2950
|
}
|
|
2859
2951
|
open(e) {
|
|
2860
2952
|
this.inner.open(this.map.innerMap, e == null ? void 0 : e.innerOverlay);
|
|
@@ -2882,15 +2974,40 @@ class ct extends ot {
|
|
|
2882
2974
|
this.inner.setZIndex(e);
|
|
2883
2975
|
}
|
|
2884
2976
|
}
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
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);
|
|
2888
3005
|
}
|
|
2889
|
-
function
|
|
3006
|
+
function pi() {
|
|
2890
3007
|
return class extends google.maps.OverlayView {
|
|
2891
3008
|
constructor(t, r, s, n) {
|
|
2892
3009
|
super();
|
|
2893
|
-
|
|
3010
|
+
p(this, "container");
|
|
2894
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", () => {
|
|
2895
3012
|
google.maps.event.trigger(this, "click");
|
|
2896
3013
|
}), this.setElement(t);
|
|
@@ -2904,7 +3021,7 @@ function ii() {
|
|
|
2904
3021
|
}
|
|
2905
3022
|
/** @override */
|
|
2906
3023
|
onAdd() {
|
|
2907
|
-
const t = this.getPanes() ??
|
|
3024
|
+
const t = this.getPanes() ?? C("onAdd回调中一定能够获取panes");
|
|
2908
3025
|
this.zIndex ? t.overlayMouseTarget.appendChild(this.container) : t.overlayLayer.appendChild(this.container);
|
|
2909
3026
|
}
|
|
2910
3027
|
/** @override */
|
|
@@ -2943,7 +3060,7 @@ function ii() {
|
|
|
2943
3060
|
}
|
|
2944
3061
|
};
|
|
2945
3062
|
}
|
|
2946
|
-
var
|
|
3063
|
+
var ae;
|
|
2947
3064
|
((i) => {
|
|
2948
3065
|
function e(r) {
|
|
2949
3066
|
return typeof r == "string" ? r : r.outerHTML;
|
|
@@ -2957,18 +3074,19 @@ var oe;
|
|
|
2957
3074
|
return r;
|
|
2958
3075
|
}
|
|
2959
3076
|
i.toElement = t;
|
|
2960
|
-
})(
|
|
2961
|
-
class
|
|
3077
|
+
})(ae || (ae = {}));
|
|
3078
|
+
class ut extends Ae {
|
|
2962
3079
|
constructor(t, r, s, n) {
|
|
2963
3080
|
super(t, r, s);
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
3081
|
+
p(this, "icon");
|
|
3082
|
+
p(this, "iconAnchor");
|
|
3083
|
+
p(this, "content", void 0);
|
|
3084
|
+
p(this, "contentObserver");
|
|
2967
3085
|
this.setContentInternal(n, !0);
|
|
2968
3086
|
}
|
|
2969
3087
|
static create(t) {
|
|
2970
3088
|
var a;
|
|
2971
|
-
const r = this.coordType, s = new BMap.Label(
|
|
3089
|
+
const r = this.coordType, s = new BMap.Label(ae.toString(t.content), {
|
|
2972
3090
|
position: (a = t.position) == null ? void 0 : a.toBaidu(r),
|
|
2973
3091
|
offset: t.offset && new BMap.Size(t.offset.x, t.offset.y)
|
|
2974
3092
|
});
|
|
@@ -2977,7 +3095,7 @@ class dt extends Be {
|
|
|
2977
3095
|
padding: "0px",
|
|
2978
3096
|
backgroundColor: "unset"
|
|
2979
3097
|
});
|
|
2980
|
-
const n = new
|
|
3098
|
+
const n = new ut(s, r, this, t.content);
|
|
2981
3099
|
return s.__label__ = n, n;
|
|
2982
3100
|
}
|
|
2983
3101
|
setContentInternal(t, r = !1) {
|
|
@@ -2988,7 +3106,7 @@ class dt extends Be {
|
|
|
2988
3106
|
characterData: !0,
|
|
2989
3107
|
childList: !0,
|
|
2990
3108
|
subtree: !0
|
|
2991
|
-
})), r || this.innerOverlay.setContent(
|
|
3109
|
+
})), r || this.innerOverlay.setContent(ae.toString(t)), this.content = t);
|
|
2992
3110
|
}
|
|
2993
3111
|
setZIndex(t) {
|
|
2994
3112
|
this.innerOverlay.setZIndex(t);
|
|
@@ -3002,11 +3120,11 @@ class dt extends Be {
|
|
|
3002
3120
|
getOffset() {
|
|
3003
3121
|
const t = this.innerOverlay.getOffset();
|
|
3004
3122
|
let r = 0, s = 0;
|
|
3005
|
-
return this.
|
|
3123
|
+
return this.iconAnchor && (r = this.iconAnchor.width, s = this.iconAnchor.height), { x: t.width - r, y: t.height - s };
|
|
3006
3124
|
}
|
|
3007
3125
|
setOffset(t) {
|
|
3008
3126
|
let r = 0, s = 0;
|
|
3009
|
-
this.
|
|
3127
|
+
this.iconAnchor && (r = this.iconAnchor.width, s = this.iconAnchor.height), this.innerOverlay.setOffset(new BMap.Size(t.x + r, t.y + s));
|
|
3010
3128
|
}
|
|
3011
3129
|
setContent(t) {
|
|
3012
3130
|
this.setContentInternal(t);
|
|
@@ -3016,27 +3134,63 @@ class dt extends Be {
|
|
|
3016
3134
|
* @description baidu中Label默认左上角对齐Icon的左上, 我们要将其转换为对齐marker的position
|
|
3017
3135
|
* */
|
|
3018
3136
|
attachIcon(t) {
|
|
3019
|
-
|
|
3020
|
-
let
|
|
3021
|
-
|
|
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;
|
|
3022
3176
|
}
|
|
3023
3177
|
}
|
|
3024
|
-
class
|
|
3178
|
+
class gt extends it {
|
|
3025
3179
|
static create(e) {
|
|
3026
3180
|
var s;
|
|
3027
|
-
const t = this.coordType, r =
|
|
3028
|
-
|
|
3181
|
+
const t = this.coordType, r = di(
|
|
3182
|
+
ae.toElement(e.content),
|
|
3029
3183
|
(s = e.position) == null ? void 0 : s.toGoogle(t),
|
|
3030
3184
|
e.offset,
|
|
3031
3185
|
e.zIndex
|
|
3032
3186
|
);
|
|
3033
|
-
return new
|
|
3187
|
+
return new gt(r, t, this);
|
|
3034
3188
|
}
|
|
3035
3189
|
setZIndex(e) {
|
|
3036
3190
|
this.innerOverlay.setZIndex(e);
|
|
3037
3191
|
}
|
|
3038
3192
|
setContent(e) {
|
|
3039
|
-
this.innerOverlay.setElement(
|
|
3193
|
+
this.innerOverlay.setElement(ae.toElement(e));
|
|
3040
3194
|
}
|
|
3041
3195
|
getPosition() {
|
|
3042
3196
|
const e = this.innerOverlay.getPosition();
|
|
@@ -3052,7 +3206,11 @@ class pt extends tt {
|
|
|
3052
3206
|
this.innerOverlay.setOffset(e);
|
|
3053
3207
|
}
|
|
3054
3208
|
}
|
|
3055
|
-
|
|
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;
|
|
3056
3214
|
((i) => {
|
|
3057
3215
|
function e(r) {
|
|
3058
3216
|
return {
|
|
@@ -3074,15 +3232,54 @@ var ae;
|
|
|
3074
3232
|
});
|
|
3075
3233
|
}
|
|
3076
3234
|
i.toBaidu = t;
|
|
3077
|
-
})(
|
|
3078
|
-
|
|
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 {
|
|
3079
3276
|
constructor(e, t, r, s) {
|
|
3080
3277
|
super(e, t, r), this.state = s;
|
|
3081
3278
|
}
|
|
3082
3279
|
static create(e) {
|
|
3083
3280
|
const t = this.coordType, r = e.icon, s = {
|
|
3084
3281
|
title: e.title,
|
|
3085
|
-
icon: r &&
|
|
3282
|
+
icon: r && Pe.toBaidu(r),
|
|
3086
3283
|
enableClicking: e.clickable,
|
|
3087
3284
|
enableDragging: e.draggable,
|
|
3088
3285
|
// baidu的raiseOnDrag属性, 默认为false, 而我们的options.crossOnDrag默认为true, 故这里需要转换下
|
|
@@ -3091,7 +3288,7 @@ class fe extends Be {
|
|
|
3091
3288
|
}, n = new BMap.Marker(e.position.toBaidu(t), s);
|
|
3092
3289
|
e.zIndex !== void 0 && n.setZIndex(e.zIndex);
|
|
3093
3290
|
const a = e.clickable === void 0 ? !0 : e.clickable, c = !!e.draggable;
|
|
3094
|
-
return new
|
|
3291
|
+
return new ye(n, t, this, { clickable: a, draggable: c, zIndex: e.zIndex }).visibleOptionInternal(e.visible);
|
|
3095
3292
|
}
|
|
3096
3293
|
getPosition() {
|
|
3097
3294
|
return y.fromBaidu(this.innerOverlay.getPosition(), this.coordType);
|
|
@@ -3107,7 +3304,7 @@ class fe extends Be {
|
|
|
3107
3304
|
return this.innerOverlay.getTitle();
|
|
3108
3305
|
}
|
|
3109
3306
|
setIcon(e) {
|
|
3110
|
-
const t =
|
|
3307
|
+
const t = Pe.toBaidu(e);
|
|
3111
3308
|
this.innerOverlay.setIcon(t);
|
|
3112
3309
|
const r = this.getLabel();
|
|
3113
3310
|
r && r.attachIcon(t);
|
|
@@ -3142,13 +3339,13 @@ class fe extends Be {
|
|
|
3142
3339
|
return (e = this.innerOverlay.getLabel()) == null ? void 0 : e.__label__;
|
|
3143
3340
|
}
|
|
3144
3341
|
}
|
|
3145
|
-
class
|
|
3342
|
+
class mt extends it {
|
|
3146
3343
|
constructor() {
|
|
3147
3344
|
super(...arguments);
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3345
|
+
p(this, "label");
|
|
3346
|
+
p(this, "labelPositionListener");
|
|
3347
|
+
p(this, "labelVisibleListener");
|
|
3348
|
+
p(this, "labelMapChangedListener");
|
|
3152
3349
|
}
|
|
3153
3350
|
static create(t) {
|
|
3154
3351
|
const r = this.coordType, s = t.icon, n = {
|
|
@@ -3156,7 +3353,7 @@ class ut extends tt {
|
|
|
3156
3353
|
title: t.title,
|
|
3157
3354
|
zIndex: t.zIndex,
|
|
3158
3355
|
visible: t.visible,
|
|
3159
|
-
icon: s &&
|
|
3356
|
+
icon: s && Pe.toGoogle(s),
|
|
3160
3357
|
clickable: t.clickable,
|
|
3161
3358
|
draggable: t.draggable,
|
|
3162
3359
|
// google的crossOnDrag和我们的crossOnDrag是匹配的, 不需要转换
|
|
@@ -3165,7 +3362,7 @@ class ut extends tt {
|
|
|
3165
3362
|
// InfoWindow相对marker的position的偏移量, 若不指定, 则偏移到marker的icon的上部中央
|
|
3166
3363
|
anchorPoint: new google.maps.Point(0, 0)
|
|
3167
3364
|
};
|
|
3168
|
-
return new
|
|
3365
|
+
return new mt(new google.maps.Marker(n), r, this);
|
|
3169
3366
|
}
|
|
3170
3367
|
getPosition() {
|
|
3171
3368
|
return y.fromGoogle(this.innerOverlay.getPosition(), this.coordType);
|
|
@@ -3180,7 +3377,7 @@ class ut extends tt {
|
|
|
3180
3377
|
return this.innerOverlay.getTitle() || "";
|
|
3181
3378
|
}
|
|
3182
3379
|
setIcon(t) {
|
|
3183
|
-
this.innerOverlay.setIcon(
|
|
3380
|
+
this.innerOverlay.setIcon(Pe.toGoogle(t));
|
|
3184
3381
|
}
|
|
3185
3382
|
getIcon() {
|
|
3186
3383
|
return this.innerOverlay.getIcon();
|
|
@@ -3218,7 +3415,7 @@ class ut extends tt {
|
|
|
3218
3415
|
this.label = void 0, this.labelPositionListener = void 0, this.labelVisibleListener = void 0, this.labelMapChangedListener = void 0;
|
|
3219
3416
|
}
|
|
3220
3417
|
}
|
|
3221
|
-
class
|
|
3418
|
+
class ft extends st {
|
|
3222
3419
|
static create(e) {
|
|
3223
3420
|
const t = this.coordType;
|
|
3224
3421
|
e.paths.length > 1 && console.warn("baidu不支持多path, 只会显示paths[0]");
|
|
@@ -3231,7 +3428,7 @@ class gt extends rt {
|
|
|
3231
3428
|
fillColor: e.fillColor,
|
|
3232
3429
|
fillOpacity: e.fillOpacity
|
|
3233
3430
|
});
|
|
3234
|
-
return new
|
|
3431
|
+
return new ft(s, t, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
3235
3432
|
}
|
|
3236
3433
|
getPaths() {
|
|
3237
3434
|
return [this.innerOverlay.getPath().map((e) => y.fromBaidu(e, this.coordType))];
|
|
@@ -3240,7 +3437,7 @@ class gt extends rt {
|
|
|
3240
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)));
|
|
3241
3438
|
}
|
|
3242
3439
|
}
|
|
3243
|
-
class
|
|
3440
|
+
class yt extends nt {
|
|
3244
3441
|
static create(e) {
|
|
3245
3442
|
const t = this.coordType, r = new google.maps.Polygon({
|
|
3246
3443
|
paths: e.paths.map((s) => s.map((n) => n.toGoogle(t))),
|
|
@@ -3253,7 +3450,7 @@ class mt extends it {
|
|
|
3253
3450
|
fillOpacity: e.fillOpacity,
|
|
3254
3451
|
visible: e.visible
|
|
3255
3452
|
});
|
|
3256
|
-
return new
|
|
3453
|
+
return new yt(r, t, this);
|
|
3257
3454
|
}
|
|
3258
3455
|
getPaths() {
|
|
3259
3456
|
const e = this.innerOverlay.getPaths(), t = [];
|
|
@@ -3268,7 +3465,7 @@ class mt extends it {
|
|
|
3268
3465
|
this.coordType = this.map.coordType, this.innerOverlay.setPaths(e.map((t) => t.map((r) => r.toGoogle(this.coordType))));
|
|
3269
3466
|
}
|
|
3270
3467
|
}
|
|
3271
|
-
class
|
|
3468
|
+
class vt extends st {
|
|
3272
3469
|
static create(e) {
|
|
3273
3470
|
const t = this.coordType, r = new BMap.Polyline(e.path.map((s) => s.toBaidu(t)), {
|
|
3274
3471
|
enableClicking: e.clickable,
|
|
@@ -3277,7 +3474,7 @@ class ft extends rt {
|
|
|
3277
3474
|
strokeOpacity: e.strokeOpacity,
|
|
3278
3475
|
strokeWeight: e.strokeWeight
|
|
3279
3476
|
});
|
|
3280
|
-
return new
|
|
3477
|
+
return new vt(r, t, this, { editable: e.editable === !0 }).visibleOptionInternal(e.visible);
|
|
3281
3478
|
}
|
|
3282
3479
|
getPath() {
|
|
3283
3480
|
return this.innerOverlay.getPath().map((e) => y.fromBaidu(e, this.coordType));
|
|
@@ -3286,7 +3483,7 @@ class ft extends rt {
|
|
|
3286
3483
|
this.coordType = this.map.coordType, this.innerOverlay.setPath(e.map((t) => t.toBaidu(this.coordType)));
|
|
3287
3484
|
}
|
|
3288
3485
|
}
|
|
3289
|
-
class
|
|
3486
|
+
class _t extends nt {
|
|
3290
3487
|
static create(e) {
|
|
3291
3488
|
const t = this.coordType, r = new google.maps.Polyline({
|
|
3292
3489
|
path: e.path.map((s) => s.toGoogle(t)),
|
|
@@ -3297,7 +3494,7 @@ class yt extends it {
|
|
|
3297
3494
|
strokeWeight: e.strokeWeight,
|
|
3298
3495
|
visible: e.visible
|
|
3299
3496
|
});
|
|
3300
|
-
return new
|
|
3497
|
+
return new _t(r, t, this);
|
|
3301
3498
|
}
|
|
3302
3499
|
getPath() {
|
|
3303
3500
|
const e = [];
|
|
@@ -3310,30 +3507,30 @@ class yt extends it {
|
|
|
3310
3507
|
}
|
|
3311
3508
|
}
|
|
3312
3509
|
const X = 1;
|
|
3313
|
-
class
|
|
3510
|
+
class ui extends rt {
|
|
3314
3511
|
constructor(t, r) {
|
|
3315
3512
|
var s;
|
|
3316
3513
|
super(t);
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
this.buildInMapTypeId2BIMT = I.BUILD_IN_MAP_TYPES.getValueMap(
|
|
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);
|
|
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, {
|
|
3331
3528
|
minZoom: r.minZoom && r.minZoom + X,
|
|
3332
3529
|
maxZoom: r.maxZoom && r.maxZoom + X,
|
|
3333
3530
|
mapType: r.buildInMapTypeId && ((s = this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId)) == null ? void 0 : s.asBaiduMapType()),
|
|
3334
3531
|
enableMapClick: !1
|
|
3335
3532
|
// 关闭底图点击功能
|
|
3336
|
-
}), 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) => {
|
|
3337
3534
|
const a = n.target.__info_box__;
|
|
3338
3535
|
a && (console.debug("add:info-box", a), this.map.addOverlay(a));
|
|
3339
3536
|
}), this.map.addEventListener("removeoverlay", (n) => {
|
|
@@ -3345,7 +3542,7 @@ class si extends et {
|
|
|
3345
3542
|
this.innerMap.setDefaultCursor(t);
|
|
3346
3543
|
}
|
|
3347
3544
|
setGestureHandling(t = D.auto) {
|
|
3348
|
-
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) {
|
|
3349
3546
|
case D.cooperative:
|
|
3350
3547
|
this.map.disableScrollWheelZoom(), this.map.enableDragging(), this.map.enableDoubleClickZoom();
|
|
3351
3548
|
break;
|
|
@@ -3413,14 +3610,14 @@ class si extends et {
|
|
|
3413
3610
|
setBuildInMapTypeId(t) {
|
|
3414
3611
|
var s;
|
|
3415
3612
|
const r = (s = this.buildInMapTypeId2BIMT.get(t)) == null ? void 0 : s.asBaiduMapType();
|
|
3416
|
-
this.map.setMapType(r ??
|
|
3613
|
+
this.map.setMapType(r ?? C("理论上来说不可能为空"));
|
|
3417
3614
|
}
|
|
3418
3615
|
setMapType(t) {
|
|
3419
3616
|
this.map.setMapType(t.asBaiduMapType());
|
|
3420
3617
|
}
|
|
3421
3618
|
getMapType() {
|
|
3422
3619
|
const t = this.map.getMapType(), r = this.baiduMapType2BIMT.get(t);
|
|
3423
|
-
return r || (t.__baidu_map_type__ ??
|
|
3620
|
+
return r || (t.__baidu_map_type__ ?? C("实现asBaiduMapType()时, 忘了给实例设置__baidu_map_type__?"));
|
|
3424
3621
|
}
|
|
3425
3622
|
addLayer(t) {
|
|
3426
3623
|
this.map.addTileLayer(t.asBaiduLayer());
|
|
@@ -3460,8 +3657,8 @@ class si extends et {
|
|
|
3460
3657
|
const r = class extends BMap.Control {
|
|
3461
3658
|
constructor() {
|
|
3462
3659
|
super(...arguments);
|
|
3463
|
-
|
|
3464
|
-
|
|
3660
|
+
p(this, "defaultAnchor", B.getBaidu().toValue(t.position));
|
|
3661
|
+
p(this, "defaultOffset", new BMap.Size(0, 0));
|
|
3465
3662
|
}
|
|
3466
3663
|
initialize(n) {
|
|
3467
3664
|
const a = t.onCreateElement();
|
|
@@ -3472,36 +3669,39 @@ class si extends et {
|
|
|
3472
3669
|
}
|
|
3473
3670
|
}
|
|
3474
3671
|
removeCustomControl(t) {
|
|
3475
|
-
t.inner && (
|
|
3672
|
+
t.inner && (se(t.inner instanceof BMap.Control, `control.inner(${t.inner})需要是BMap.Control`), this.map.removeControl(t.inner));
|
|
3476
3673
|
}
|
|
3477
3674
|
createMarkerClusterer(t) {
|
|
3478
|
-
return new
|
|
3675
|
+
return new Qr(this, t);
|
|
3479
3676
|
}
|
|
3480
3677
|
createAutocomplete(t) {
|
|
3481
|
-
return new
|
|
3678
|
+
return new Yr(this, t);
|
|
3679
|
+
}
|
|
3680
|
+
createSearchBox(t) {
|
|
3681
|
+
return new si(this, t);
|
|
3482
3682
|
}
|
|
3483
3683
|
createPlaceService(t) {
|
|
3484
|
-
return new
|
|
3684
|
+
return new ri(this, t);
|
|
3485
3685
|
}
|
|
3486
3686
|
}
|
|
3487
|
-
class
|
|
3687
|
+
class gi extends rt {
|
|
3488
3688
|
constructor(t, r) {
|
|
3489
3689
|
var n;
|
|
3490
3690
|
super(t);
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
this.mapOptions = r, this.buildInMapTypeId2BIMT = I.BUILD_IN_MAP_TYPES.getValueMap(
|
|
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);
|
|
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);
|
|
3505
3705
|
const s = r.buildInMapTypeId && this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId);
|
|
3506
3706
|
this.map = new google.maps.Map(t, {
|
|
3507
3707
|
center: r.center.toGoogle((s ?? I.NORMAL).getGoogleCoordType()),
|
|
@@ -3573,14 +3773,14 @@ class ni extends et {
|
|
|
3573
3773
|
setBuildInMapTypeId(t) {
|
|
3574
3774
|
var s;
|
|
3575
3775
|
const r = (s = this.buildInMapTypeId2BIMT.get(t)) == null ? void 0 : s.getGoogleMapTypeId();
|
|
3576
|
-
this.map.setMapTypeId(r ??
|
|
3776
|
+
this.map.setMapTypeId(r ?? C("理论上来说不可能为空"));
|
|
3577
3777
|
}
|
|
3578
3778
|
setMapType(t) {
|
|
3579
|
-
t instanceof
|
|
3779
|
+
t instanceof k ? this.map.setMapTypeId(t.getGoogleMapTypeId()) : (this.map.mapTypes.set(t.id, t.asGoogleMapType()), this.map.setMapTypeId(t.id));
|
|
3580
3780
|
}
|
|
3581
3781
|
getMapType() {
|
|
3582
3782
|
const t = this.map.getMapTypeId() ?? google.maps.MapTypeId.ROADMAP, r = this.googleMapTypeId2BIMT.get(t);
|
|
3583
|
-
return r || (this.map.mapTypes.get(t).__google_map_type__ ??
|
|
3783
|
+
return r || (this.map.mapTypes.get(t).__google_map_type__ ?? C(`实现${t}的asGoogleMapType()时, 忘了给实例设置__google_map_type__?`));
|
|
3584
3784
|
}
|
|
3585
3785
|
addOverlayMapType(t) {
|
|
3586
3786
|
this.map.overlayMapTypes.push(t.asGoogleMapType());
|
|
@@ -3629,24 +3829,27 @@ class ni extends et {
|
|
|
3629
3829
|
}
|
|
3630
3830
|
}
|
|
3631
3831
|
createMarkerClusterer(t) {
|
|
3632
|
-
return new
|
|
3832
|
+
return new ei(this, t);
|
|
3633
3833
|
}
|
|
3634
3834
|
createAutocomplete(t) {
|
|
3635
|
-
return new
|
|
3835
|
+
return new Ur(this, t);
|
|
3836
|
+
}
|
|
3837
|
+
createSearchBox(t) {
|
|
3838
|
+
return new ii(this, t);
|
|
3636
3839
|
}
|
|
3637
3840
|
createPlaceService(t) {
|
|
3638
|
-
return new
|
|
3841
|
+
return new ti(this, t);
|
|
3639
3842
|
}
|
|
3640
3843
|
}
|
|
3641
|
-
class
|
|
3844
|
+
class mi extends rt {
|
|
3642
3845
|
constructor(t, r) {
|
|
3643
3846
|
var a;
|
|
3644
3847
|
super(t);
|
|
3645
|
-
|
|
3646
|
-
|
|
3848
|
+
p(this, "map");
|
|
3849
|
+
p(this, "defaultLayers");
|
|
3647
3850
|
this.mapOptions = r;
|
|
3648
|
-
const s =
|
|
3649
|
-
Ce.includes(s.version) ||
|
|
3851
|
+
const s = Dt().here;
|
|
3852
|
+
Ce.includes(s.version) || C(`不支持${s.version}, HereMap当前只支持如下版本: ${Ce}`);
|
|
3650
3853
|
const n = new H.service.Platform({
|
|
3651
3854
|
app_id: s.key.split(",")[0],
|
|
3652
3855
|
app_code: s.key.split(",")[1]
|
|
@@ -3777,38 +3980,41 @@ class oi extends et {
|
|
|
3777
3980
|
createAutocomplete(t) {
|
|
3778
3981
|
throw new Error("Method not implemented.");
|
|
3779
3982
|
}
|
|
3983
|
+
createSearchBox(t) {
|
|
3984
|
+
throw new Error("Method not implemented.");
|
|
3985
|
+
}
|
|
3780
3986
|
createPlaceService(t) {
|
|
3781
3987
|
throw new Error("Method not implemented.");
|
|
3782
3988
|
}
|
|
3783
3989
|
}
|
|
3784
|
-
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;
|
|
3785
3991
|
((i) => {
|
|
3786
3992
|
function e(t, r, s) {
|
|
3787
|
-
const n =
|
|
3993
|
+
const n = He.create(s);
|
|
3788
3994
|
switch (t) {
|
|
3789
3995
|
case "google":
|
|
3790
|
-
return new
|
|
3996
|
+
return new gi(r, n);
|
|
3791
3997
|
case "baidu":
|
|
3792
|
-
return new
|
|
3998
|
+
return new ui(r, n);
|
|
3793
3999
|
case "here":
|
|
3794
|
-
return new
|
|
4000
|
+
return new mi(r, n);
|
|
3795
4001
|
}
|
|
3796
4002
|
}
|
|
3797
4003
|
i.createMap = e;
|
|
3798
|
-
})(
|
|
3799
|
-
function
|
|
3800
|
-
const t = window, r =
|
|
4004
|
+
})(Fe || (Fe = {}));
|
|
4005
|
+
function fi({ type: i, config: e }) {
|
|
4006
|
+
const t = window, r = yi(i);
|
|
3801
4007
|
if (t[r])
|
|
3802
4008
|
return Promise.resolve();
|
|
3803
|
-
switch (i !== $.here && !e.key &&
|
|
4009
|
+
switch (i !== $.here && !e.key && C(`请先配置${i}地图的key`), i) {
|
|
3804
4010
|
case $.google:
|
|
3805
|
-
return {}.VITE_FALSE ? (
|
|
4011
|
+
return {}.VITE_FALSE ? (Fr({
|
|
3806
4012
|
key: e.key,
|
|
3807
4013
|
v: "3.52"
|
|
3808
4014
|
// v: config.version,
|
|
3809
|
-
}), 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(",")}`);
|
|
3810
4016
|
case $.baidu:
|
|
3811
|
-
return
|
|
4017
|
+
return It(`https://api.map.baidu.com/api?v=${e.version}&ak=${e.key}`);
|
|
3812
4018
|
case $.here:
|
|
3813
4019
|
return ce(he("core", e.version)).then(() => Promise.all([
|
|
3814
4020
|
// 其他大多数模块都可以同时载入
|
|
@@ -3818,13 +4024,13 @@ function ai({ type: i, config: e }) {
|
|
|
3818
4024
|
ce(he("ui", e.version))
|
|
3819
4025
|
])).catch((s) => (delete t[r], Promise.reject(s)));
|
|
3820
4026
|
default:
|
|
3821
|
-
|
|
4027
|
+
Ze(i);
|
|
3822
4028
|
}
|
|
3823
4029
|
}
|
|
3824
4030
|
function he(i, e = Ce[0]) {
|
|
3825
4031
|
return `https://js.api.here.com/v3/${e}/mapsjs-${i}.js`;
|
|
3826
4032
|
}
|
|
3827
|
-
function
|
|
4033
|
+
function yi(i) {
|
|
3828
4034
|
switch (i) {
|
|
3829
4035
|
case $.google:
|
|
3830
4036
|
return "google";
|
|
@@ -3834,10 +4040,10 @@ function li(i) {
|
|
|
3834
4040
|
return "H";
|
|
3835
4041
|
}
|
|
3836
4042
|
}
|
|
3837
|
-
let
|
|
3838
|
-
function
|
|
4043
|
+
let vi = 0;
|
|
4044
|
+
function It(i, e = "callback") {
|
|
3839
4045
|
return new Promise((t, r) => {
|
|
3840
|
-
const s = `__callback${
|
|
4046
|
+
const s = `__callback${vi++}`;
|
|
3841
4047
|
window[s] = t;
|
|
3842
4048
|
const n = document.createElement("script");
|
|
3843
4049
|
n.src = `${i}&${e}=${s}`, n.onerror = r, document.body.appendChild(n);
|
|
@@ -3849,46 +4055,21 @@ function ce(i) {
|
|
|
3849
4055
|
r.src = i, r.onload = e, r.onerror = t, document.body.appendChild(r);
|
|
3850
4056
|
});
|
|
3851
4057
|
}
|
|
3852
|
-
|
|
3853
|
-
((i) => {
|
|
3854
|
-
function e(s, n) {
|
|
3855
|
-
if (s !== void 0)
|
|
3856
|
-
return Object.values(n).includes(s) ? s : void 0;
|
|
3857
|
-
}
|
|
3858
|
-
i.toEnumOrNull = e;
|
|
3859
|
-
function t(s) {
|
|
3860
|
-
return s.split(`
|
|
3861
|
-
`).map((n) => n.trim()).join(`
|
|
3862
|
-
`);
|
|
3863
|
-
}
|
|
3864
|
-
i.trimIndent = t;
|
|
3865
|
-
function r(s) {
|
|
3866
|
-
return s.replace(/([^A-Z]?)([A-Z])/g, (n, a, c) => a ? `${a}-${c.toLowerCase()}` : c.toLowerCase());
|
|
3867
|
-
}
|
|
3868
|
-
i.pascal2kebab = r;
|
|
3869
|
-
})(ke || (ke = {}));
|
|
3870
|
-
const ci = {
|
|
3871
|
-
/** @see https://nodejs.org/docs/v10.3.0/api/path.html#path_path_basename_path_ext */
|
|
3872
|
-
basename(i, e) {
|
|
3873
|
-
const t = i.endsWith("/") ? i.slice(0, -1) : i, r = t.lastIndexOf("/"), s = r >= 0 ? t.substring(r + 1) : t;
|
|
3874
|
-
return e && s.endsWith(e) ? s.slice(0, -e.length) : s;
|
|
3875
|
-
}
|
|
3876
|
-
};
|
|
3877
|
-
function Z(i, e) {
|
|
4058
|
+
function G(i, e) {
|
|
3878
4059
|
return {
|
|
3879
4060
|
type: String,
|
|
3880
4061
|
default: e,
|
|
3881
4062
|
validator: (t) => Object.values(i).includes(t)
|
|
3882
4063
|
};
|
|
3883
4064
|
}
|
|
3884
|
-
function
|
|
4065
|
+
function _i(i, e) {
|
|
3885
4066
|
return {
|
|
3886
4067
|
type: String,
|
|
3887
4068
|
default: e,
|
|
3888
4069
|
validator: (t) => i.includes(t)
|
|
3889
4070
|
};
|
|
3890
4071
|
}
|
|
3891
|
-
function
|
|
4072
|
+
function z(i) {
|
|
3892
4073
|
return {
|
|
3893
4074
|
type: i,
|
|
3894
4075
|
required: !0
|
|
@@ -3900,7 +4081,7 @@ function f(i, e) {
|
|
|
3900
4081
|
default: e
|
|
3901
4082
|
};
|
|
3902
4083
|
}
|
|
3903
|
-
function
|
|
4084
|
+
function cs(i) {
|
|
3904
4085
|
const e = {};
|
|
3905
4086
|
return Object.entries(i).forEach(([t, r]) => {
|
|
3906
4087
|
const s = `__${t}`;
|
|
@@ -3920,34 +4101,34 @@ function ts(i) {
|
|
|
3920
4101
|
const de = {
|
|
3921
4102
|
enumerable: !0,
|
|
3922
4103
|
configurable: !0,
|
|
3923
|
-
get:
|
|
3924
|
-
set:
|
|
4104
|
+
get: ue,
|
|
4105
|
+
set: ue
|
|
3925
4106
|
};
|
|
3926
|
-
function
|
|
4107
|
+
function Mi(i) {
|
|
3927
4108
|
return Object.keys(i).forEach((e) => {
|
|
3928
4109
|
const t = i[e];
|
|
3929
4110
|
let r = !1;
|
|
3930
|
-
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));
|
|
3931
4112
|
}), i;
|
|
3932
4113
|
}
|
|
3933
|
-
function
|
|
3934
|
-
return
|
|
4114
|
+
function ds(i) {
|
|
4115
|
+
return Mi(i);
|
|
3935
4116
|
}
|
|
3936
|
-
function
|
|
3937
|
-
return
|
|
4117
|
+
function nr() {
|
|
4118
|
+
return Ge();
|
|
3938
4119
|
}
|
|
3939
|
-
function
|
|
4120
|
+
function Te(i, e) {
|
|
3940
4121
|
const t = i.$options[e];
|
|
3941
4122
|
if (t)
|
|
3942
4123
|
for (const r of t)
|
|
3943
4124
|
r.call(i);
|
|
3944
4125
|
}
|
|
3945
|
-
function
|
|
4126
|
+
function ps(i, e) {
|
|
3946
4127
|
for (const t of i)
|
|
3947
4128
|
if (t.$options.name === e.name)
|
|
3948
4129
|
return t;
|
|
3949
4130
|
}
|
|
3950
|
-
function
|
|
4131
|
+
function us(i, e) {
|
|
3951
4132
|
if (!i.default)
|
|
3952
4133
|
return;
|
|
3953
4134
|
const t = i.default();
|
|
@@ -3955,12 +4136,12 @@ function ss(i, e) {
|
|
|
3955
4136
|
if ((r == null ? void 0 : r.type).name === e.name)
|
|
3956
4137
|
return r;
|
|
3957
4138
|
}
|
|
3958
|
-
function
|
|
4139
|
+
function bi(i, e) {
|
|
3959
4140
|
const t = {}, r = {}, s = {};
|
|
3960
4141
|
return Object.keys(i).forEach((n) => {
|
|
3961
|
-
n.startsWith("on") ? t[
|
|
4142
|
+
n.startsWith("on") ? t[fe.pascal2kebab(n.substring(2))] = i[n] : r[n] = i[n];
|
|
3962
4143
|
}), e && Object.keys(e).forEach((n) => {
|
|
3963
|
-
n.startsWith("on") && (s[
|
|
4144
|
+
n.startsWith("on") && (s[fe.pascal2kebab(n.substring(2))] = e[n]);
|
|
3964
4145
|
}), {
|
|
3965
4146
|
/** class/style/未声明的属性 等 */
|
|
3966
4147
|
binds: r,
|
|
@@ -3970,13 +4151,13 @@ function ui(i, e) {
|
|
|
3970
4151
|
listenerProps: s
|
|
3971
4152
|
};
|
|
3972
4153
|
}
|
|
3973
|
-
function
|
|
3974
|
-
return
|
|
4154
|
+
function K(i, e) {
|
|
4155
|
+
return St(() => bi(i, e));
|
|
3975
4156
|
}
|
|
3976
|
-
function
|
|
4157
|
+
function N() {
|
|
3977
4158
|
return Function;
|
|
3978
4159
|
}
|
|
3979
|
-
const
|
|
4160
|
+
const gs = {
|
|
3980
4161
|
/**
|
|
3981
4162
|
* @event 一般来说传{@link Tg.Event}对象, 但传其他对象也不会报错
|
|
3982
4163
|
*/
|
|
@@ -3987,33 +4168,33 @@ const ns = {
|
|
|
3987
4168
|
eventLogLess(i) {
|
|
3988
4169
|
((i && i.type) !== this.$_prev_type || Date.now() - (this.$_prev_time ?? 0) > 1e3) && this.eventLog(i);
|
|
3989
4170
|
}
|
|
3990
|
-
},
|
|
3991
|
-
inject: [
|
|
4171
|
+
}, Mt = "$map", ve = "onCreate", _e = "onDestroy", L = x({
|
|
4172
|
+
inject: [Mt],
|
|
3992
4173
|
mounted() {
|
|
3993
|
-
|
|
4174
|
+
Te(this, ve);
|
|
3994
4175
|
},
|
|
3995
4176
|
beforeUnmount() {
|
|
3996
|
-
|
|
4177
|
+
Te(this, _e);
|
|
3997
4178
|
},
|
|
3998
4179
|
methods: {
|
|
3999
4180
|
recreate() {
|
|
4000
|
-
|
|
4181
|
+
Te(this, _e), Te(this, ve);
|
|
4001
4182
|
}
|
|
4002
4183
|
},
|
|
4003
4184
|
render() {
|
|
4004
|
-
return
|
|
4185
|
+
return nr();
|
|
4005
4186
|
}
|
|
4006
|
-
}),
|
|
4187
|
+
}), Ti = x({
|
|
4007
4188
|
name: "tg-map",
|
|
4008
4189
|
provide() {
|
|
4009
4190
|
return {
|
|
4010
|
-
[
|
|
4191
|
+
[Mt]: St(() => this.map)
|
|
4011
4192
|
};
|
|
4012
4193
|
},
|
|
4013
4194
|
inheritAttrs: !1,
|
|
4014
4195
|
props: {
|
|
4015
4196
|
/** type没做响应式, 但外部可以把type作为tg-map的key, 让type修改时完全重建tg-map */
|
|
4016
|
-
type:
|
|
4197
|
+
type: G($, $.google),
|
|
4017
4198
|
/**
|
|
4018
4199
|
* 当对该属性使用双向绑定时, 改变center将触发update:center又反过来触发center改变, 最终导致无限循环...
|
|
4019
4200
|
* 当前通过setCenter()时判断center是否有改变来避免该问题, 但为了避免可能存在的问题, 另外设计了如下机制:
|
|
@@ -4022,7 +4203,7 @@ const ns = {
|
|
|
4022
4203
|
* - :last-center.sync="center": 获取tg-map销毁时的最后的center的值, 使用这种方式可以做到type切换时保留中心点位置
|
|
4023
4204
|
* @see AbstractMapEventMap.center-changed
|
|
4024
4205
|
* */
|
|
4025
|
-
center:
|
|
4206
|
+
center: z(y),
|
|
4026
4207
|
/**
|
|
4027
4208
|
* 同步center的延时
|
|
4028
4209
|
* @default 300
|
|
@@ -4039,36 +4220,36 @@ const ns = {
|
|
|
4039
4220
|
* @see center
|
|
4040
4221
|
*/
|
|
4041
4222
|
lastCenter: f(y),
|
|
4042
|
-
zoom:
|
|
4043
|
-
infoWindowMode:
|
|
4044
|
-
gestureHandling:
|
|
4223
|
+
zoom: z(Number),
|
|
4224
|
+
infoWindowMode: _i(ai),
|
|
4225
|
+
gestureHandling: G(D),
|
|
4045
4226
|
minZoom: f(Number),
|
|
4046
4227
|
maxZoom: f(Number),
|
|
4047
4228
|
mapStyle: f(Object),
|
|
4048
|
-
mapTypeId:
|
|
4229
|
+
mapTypeId: G(jt),
|
|
4049
4230
|
/** 地图类型对象, 优先级比mapTypeId高 */
|
|
4050
4231
|
mapType: f(Object),
|
|
4051
4232
|
hideLogo: f(Boolean),
|
|
4052
|
-
onLoad:
|
|
4053
|
-
"onUpdate:center":
|
|
4054
|
-
"onUpdate:current-center":
|
|
4055
|
-
"onUpdate:last-center":
|
|
4056
|
-
"onUpdate:map-type":
|
|
4057
|
-
"onUpdate:map-type-id":
|
|
4058
|
-
"onUpdate:zoom":
|
|
4059
|
-
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()
|
|
4060
4241
|
},
|
|
4061
4242
|
/** 声明事件的类型信息, 详见: {@link splitAttrs} */
|
|
4062
4243
|
emits: void 0,
|
|
4063
4244
|
setup(i, { attrs: e }) {
|
|
4064
4245
|
return {
|
|
4065
|
-
attrs:
|
|
4246
|
+
attrs: K(e, i),
|
|
4066
4247
|
centerSyncTimeoutId: 0
|
|
4067
4248
|
};
|
|
4068
4249
|
},
|
|
4069
4250
|
data() {
|
|
4070
4251
|
return {
|
|
4071
|
-
map:
|
|
4252
|
+
map: je(),
|
|
4072
4253
|
isDestroyed: !1
|
|
4073
4254
|
};
|
|
4074
4255
|
},
|
|
@@ -4113,7 +4294,7 @@ const ns = {
|
|
|
4113
4294
|
async mounted() {
|
|
4114
4295
|
const i = this.type;
|
|
4115
4296
|
try {
|
|
4116
|
-
await
|
|
4297
|
+
await fi({ type: i, config: Dt()[i] });
|
|
4117
4298
|
} catch (s) {
|
|
4118
4299
|
this.$emit("error", s);
|
|
4119
4300
|
return;
|
|
@@ -4122,7 +4303,7 @@ const ns = {
|
|
|
4122
4303
|
console.warn(`tg-map(type=${i})已销毁, 不需要继续执行`);
|
|
4123
4304
|
return;
|
|
4124
4305
|
}
|
|
4125
|
-
const e =
|
|
4306
|
+
const e = Fe.createMap(
|
|
4126
4307
|
i,
|
|
4127
4308
|
this.$refs.map,
|
|
4128
4309
|
/* options: */
|
|
@@ -4137,7 +4318,7 @@ const ns = {
|
|
|
4137
4318
|
buildInMapTypeId: this.mapTypeId
|
|
4138
4319
|
}
|
|
4139
4320
|
);
|
|
4140
|
-
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(
|
|
4141
4322
|
this.attrs.listeners,
|
|
4142
4323
|
e,
|
|
4143
4324
|
/* excludes: */
|
|
@@ -4164,28 +4345,28 @@ const ns = {
|
|
|
4164
4345
|
},
|
|
4165
4346
|
methods: {}
|
|
4166
4347
|
});
|
|
4167
|
-
const
|
|
4348
|
+
const j = (i, e) => {
|
|
4168
4349
|
const t = i.__vccOpts || i;
|
|
4169
4350
|
for (const [r, s] of e)
|
|
4170
4351
|
t[r] = s;
|
|
4171
4352
|
return t;
|
|
4172
4353
|
};
|
|
4173
|
-
function
|
|
4174
|
-
return
|
|
4175
|
-
|
|
4354
|
+
function Oi(i, e, t, r, s, n) {
|
|
4355
|
+
return Z(), W("div", le({ class: "tg-map" }, i.attrs.binds), [
|
|
4356
|
+
ur("div", {
|
|
4176
4357
|
ref: "map",
|
|
4177
|
-
class:
|
|
4358
|
+
class: Se({
|
|
4178
4359
|
"tg-map__map": !0,
|
|
4179
4360
|
[`tg-map__map--hide-logo-${i.type}`]: i.hideLogo
|
|
4180
4361
|
})
|
|
4181
4362
|
}, null, 2),
|
|
4182
|
-
|
|
4183
|
-
i.map ?
|
|
4184
|
-
|
|
4363
|
+
Ge("", !0),
|
|
4364
|
+
i.map ? R(i.$slots, "default", { key: 1 }) : Ge("", !0),
|
|
4365
|
+
R(i.$slots, "overlay")
|
|
4185
4366
|
], 16);
|
|
4186
4367
|
}
|
|
4187
|
-
const
|
|
4188
|
-
function
|
|
4368
|
+
const wi = /* @__PURE__ */ j(Ti, [["render", Oi]]);
|
|
4369
|
+
function Ci(i) {
|
|
4189
4370
|
if (i == null)
|
|
4190
4371
|
return;
|
|
4191
4372
|
let e;
|
|
@@ -4196,7 +4377,7 @@ function yi(i) {
|
|
|
4196
4377
|
e = i;
|
|
4197
4378
|
return `${e}px`;
|
|
4198
4379
|
}
|
|
4199
|
-
const
|
|
4380
|
+
const xi = x({
|
|
4200
4381
|
name: "tg-map-widget",
|
|
4201
4382
|
props: {
|
|
4202
4383
|
left: {
|
|
@@ -4222,22 +4403,22 @@ const vi = C({
|
|
|
4222
4403
|
}
|
|
4223
4404
|
},
|
|
4224
4405
|
methods: {
|
|
4225
|
-
dimen:
|
|
4406
|
+
dimen: Ci
|
|
4226
4407
|
}
|
|
4227
4408
|
});
|
|
4228
|
-
function
|
|
4229
|
-
return
|
|
4230
|
-
class:
|
|
4231
|
-
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) })
|
|
4232
4413
|
}, [
|
|
4233
|
-
|
|
4414
|
+
R(i.$slots, "default")
|
|
4234
4415
|
], 6);
|
|
4235
4416
|
}
|
|
4236
|
-
const
|
|
4417
|
+
const ms = /* @__PURE__ */ j(xi, [["render", Ei]]), Li = x({
|
|
4237
4418
|
name: "tg-custom-control",
|
|
4238
4419
|
mixins: [L],
|
|
4239
4420
|
props: {
|
|
4240
|
-
position:
|
|
4421
|
+
position: G(P, P.RIGHT_BOTTOM)
|
|
4241
4422
|
},
|
|
4242
4423
|
setup() {
|
|
4243
4424
|
return {
|
|
@@ -4250,8 +4431,8 @@ const os = /* @__PURE__ */ W(vi, [["render", _i]]), Mi = C({
|
|
|
4250
4431
|
}
|
|
4251
4432
|
},
|
|
4252
4433
|
onCreate() {
|
|
4253
|
-
|
|
4254
|
-
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 {
|
|
4255
4436
|
onCreateElement() {
|
|
4256
4437
|
return i;
|
|
4257
4438
|
}
|
|
@@ -4262,19 +4443,19 @@ const os = /* @__PURE__ */ W(vi, [["render", _i]]), Mi = C({
|
|
|
4262
4443
|
this.$map.removeCustomControl(this.control);
|
|
4263
4444
|
}
|
|
4264
4445
|
});
|
|
4265
|
-
function
|
|
4266
|
-
return
|
|
4267
|
-
class:
|
|
4446
|
+
function Pi(i, e, t, r, s, n) {
|
|
4447
|
+
return Z(), W("div", {
|
|
4448
|
+
class: Se(i.$options.name)
|
|
4268
4449
|
}, [
|
|
4269
|
-
|
|
4450
|
+
R(i.$slots, "default")
|
|
4270
4451
|
], 2);
|
|
4271
4452
|
}
|
|
4272
|
-
const
|
|
4453
|
+
const fs = /* @__PURE__ */ j(Li, [["render", Pi]]), ys = x({
|
|
4273
4454
|
name: "tg-map-type-control",
|
|
4274
4455
|
mixins: [L],
|
|
4275
4456
|
props: {
|
|
4276
|
-
position:
|
|
4277
|
-
type:
|
|
4457
|
+
position: G(P, P.TOP_LEFT),
|
|
4458
|
+
type: G(Vt),
|
|
4278
4459
|
mapTypes: f(Array)
|
|
4279
4460
|
},
|
|
4280
4461
|
setup() {
|
|
@@ -4302,11 +4483,11 @@ const as = /* @__PURE__ */ W(Mi, [["render", bi]]), ls = C({
|
|
|
4302
4483
|
onDestroy() {
|
|
4303
4484
|
this.$map.removeControl(this.control);
|
|
4304
4485
|
}
|
|
4305
|
-
}),
|
|
4486
|
+
}), vs = x({
|
|
4306
4487
|
name: "tg-scale-control",
|
|
4307
4488
|
mixins: [L],
|
|
4308
4489
|
props: {
|
|
4309
|
-
position:
|
|
4490
|
+
position: G(P, P.BOTTOM_RIGHT)
|
|
4310
4491
|
},
|
|
4311
4492
|
setup() {
|
|
4312
4493
|
return {
|
|
@@ -4325,9 +4506,9 @@ const as = /* @__PURE__ */ W(Mi, [["render", bi]]), ls = C({
|
|
|
4325
4506
|
this.$map.removeControl(this.control);
|
|
4326
4507
|
}
|
|
4327
4508
|
});
|
|
4328
|
-
function
|
|
4509
|
+
function or() {
|
|
4329
4510
|
var t;
|
|
4330
|
-
const i = (t =
|
|
4511
|
+
const i = (t = mr()) == null ? void 0 : t.type;
|
|
4331
4512
|
let e = (i == null ? void 0 : i.name) ?? (i == null ? void 0 : i.__name);
|
|
4332
4513
|
if (!e) {
|
|
4333
4514
|
const r = i == null ? void 0 : i.__file;
|
|
@@ -4335,22 +4516,22 @@ function Qt() {
|
|
|
4335
4516
|
}
|
|
4336
4517
|
return e;
|
|
4337
4518
|
}
|
|
4338
|
-
function
|
|
4339
|
-
const i =
|
|
4519
|
+
function ki() {
|
|
4520
|
+
const i = fr(Mt);
|
|
4340
4521
|
let e, t;
|
|
4341
|
-
return i == null &&
|
|
4522
|
+
return i == null && C(`<${or() || "unknown"}>必须作为<tg-map>的子代组件`), {
|
|
4342
4523
|
mapRef: i,
|
|
4343
4524
|
/** 读取map对象, 只要放在<tg-map>里面的组件(除#overlay插槽外)都能够立即读取到map对象 */
|
|
4344
4525
|
get map() {
|
|
4345
|
-
return i.value ??
|
|
4526
|
+
return i.value ?? C("map尚未初始化");
|
|
4346
4527
|
},
|
|
4347
4528
|
/** 地图元素创建回调 */
|
|
4348
|
-
[
|
|
4349
|
-
|
|
4529
|
+
[ve](r) {
|
|
4530
|
+
yr(r), e && C(`${ve}只能调用一次`), e = r;
|
|
4350
4531
|
},
|
|
4351
4532
|
/** 地图元素销毁回调 */
|
|
4352
|
-
[
|
|
4353
|
-
|
|
4533
|
+
[_e](r) {
|
|
4534
|
+
vr(r), t && C(`${_e}只能调用一次`), t = r;
|
|
4354
4535
|
},
|
|
4355
4536
|
/** 重新创建地图元素 */
|
|
4356
4537
|
recreate() {
|
|
@@ -4358,23 +4539,23 @@ function Ti() {
|
|
|
4358
4539
|
}
|
|
4359
4540
|
};
|
|
4360
4541
|
}
|
|
4361
|
-
const
|
|
4542
|
+
const _s = x({
|
|
4362
4543
|
name: "tg-zoom-control",
|
|
4363
4544
|
props: {
|
|
4364
|
-
position:
|
|
4545
|
+
position: G(P, P.RIGHT_BOTTOM)
|
|
4365
4546
|
},
|
|
4366
4547
|
setup(i) {
|
|
4367
4548
|
let e = void 0;
|
|
4368
|
-
const { map: t, onCreate: r, onDestroy: s } =
|
|
4549
|
+
const { map: t, onCreate: r, onDestroy: s } = ki();
|
|
4369
4550
|
return r(() => {
|
|
4370
4551
|
e = t.createZoomControl(i), t.addControl(e);
|
|
4371
4552
|
}), s(() => {
|
|
4372
4553
|
t.removeControl(e);
|
|
4373
|
-
}),
|
|
4554
|
+
}), _r(() => i.position, (n) => {
|
|
4374
4555
|
e.setPosition(n);
|
|
4375
|
-
}),
|
|
4556
|
+
}), nr;
|
|
4376
4557
|
}
|
|
4377
|
-
}),
|
|
4558
|
+
}), Ii = x({
|
|
4378
4559
|
name: "tg-marker-clusterer",
|
|
4379
4560
|
mixins: [L],
|
|
4380
4561
|
// markers从this.$children中读取, 故需要省略(Omit)
|
|
@@ -4438,14 +4619,14 @@ const cs = C({
|
|
|
4438
4619
|
}
|
|
4439
4620
|
}
|
|
4440
4621
|
});
|
|
4441
|
-
function
|
|
4442
|
-
return
|
|
4443
|
-
class:
|
|
4622
|
+
function Bi(i, e, t, r, s, n) {
|
|
4623
|
+
return Z(), W("div", {
|
|
4624
|
+
class: Se(i.$options.name)
|
|
4444
4625
|
}, [
|
|
4445
|
-
|
|
4626
|
+
R(i.$slots, "default")
|
|
4446
4627
|
], 2);
|
|
4447
4628
|
}
|
|
4448
|
-
const
|
|
4629
|
+
const Si = /* @__PURE__ */ j(Ii, [["render", Bi]]), Ms = x({
|
|
4449
4630
|
name: "tg-traffic-layer",
|
|
4450
4631
|
mixins: [L],
|
|
4451
4632
|
// 请直接使用v-if来控制它的显隐
|
|
@@ -4458,18 +4639,18 @@ const Ci = /* @__PURE__ */ W(Oi, [["render", wi]]), ds = C({
|
|
|
4458
4639
|
},
|
|
4459
4640
|
watch: {},
|
|
4460
4641
|
onCreate() {
|
|
4461
|
-
this.layer = new
|
|
4642
|
+
this.layer = new Hr(), this.$map.addLayer(this.layer);
|
|
4462
4643
|
},
|
|
4463
4644
|
onDestroy() {
|
|
4464
4645
|
this.$map.removeLayer(this.layer);
|
|
4465
4646
|
}
|
|
4466
|
-
}),
|
|
4647
|
+
}), bs = x({
|
|
4467
4648
|
name: "tg-circle",
|
|
4468
4649
|
mixins: [L],
|
|
4469
4650
|
inheritAttrs: !1,
|
|
4470
4651
|
props: {
|
|
4471
|
-
center:
|
|
4472
|
-
radius:
|
|
4652
|
+
center: z(y),
|
|
4653
|
+
radius: z(Number),
|
|
4473
4654
|
clickable: f(Boolean),
|
|
4474
4655
|
editable: f(Boolean),
|
|
4475
4656
|
strokeColor: f(String),
|
|
@@ -4481,7 +4662,7 @@ const Ci = /* @__PURE__ */ W(Oi, [["render", wi]]), ds = C({
|
|
|
4481
4662
|
},
|
|
4482
4663
|
setup(i, { attrs: e }) {
|
|
4483
4664
|
return {
|
|
4484
|
-
attrs:
|
|
4665
|
+
attrs: K(e),
|
|
4485
4666
|
overlay: void 0
|
|
4486
4667
|
};
|
|
4487
4668
|
},
|
|
@@ -4524,14 +4705,14 @@ const Ci = /* @__PURE__ */ W(Oi, [["render", wi]]), ds = C({
|
|
|
4524
4705
|
this.$map.removeOverlay(this.overlay);
|
|
4525
4706
|
}
|
|
4526
4707
|
});
|
|
4527
|
-
var
|
|
4528
|
-
class
|
|
4708
|
+
var Ue = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overlayMouseTarget = "overlayMouseTarget", i.float = "float", i))(Ue || {});
|
|
4709
|
+
class Ai {
|
|
4529
4710
|
constructor(e, t) {
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4711
|
+
p(this, "baidu");
|
|
4712
|
+
p(this, "google");
|
|
4713
|
+
p(this, "projection");
|
|
4714
|
+
p(this, "element", void 0);
|
|
4715
|
+
p(this, "mapPane");
|
|
4535
4716
|
this.map = e, this.mapPane = t.mapPane;
|
|
4536
4717
|
}
|
|
4537
4718
|
create() {
|
|
@@ -4546,7 +4727,7 @@ class xi {
|
|
|
4546
4727
|
asBaidu() {
|
|
4547
4728
|
if (!this.baidu) {
|
|
4548
4729
|
const e = this;
|
|
4549
|
-
|
|
4730
|
+
sr();
|
|
4550
4731
|
class t extends BMap.OverlayV3 {
|
|
4551
4732
|
initialize(n) {
|
|
4552
4733
|
const a = e.create(), c = n.getPanes();
|
|
@@ -4565,7 +4746,7 @@ class xi {
|
|
|
4565
4746
|
o = c.mapPane;
|
|
4566
4747
|
break;
|
|
4567
4748
|
default:
|
|
4568
|
-
|
|
4749
|
+
Ze(e.mapPane);
|
|
4569
4750
|
break;
|
|
4570
4751
|
}
|
|
4571
4752
|
return o == null || o.appendChild(a), a;
|
|
@@ -4592,7 +4773,7 @@ class xi {
|
|
|
4592
4773
|
const e = this;
|
|
4593
4774
|
class t extends google.maps.OverlayView {
|
|
4594
4775
|
onAdd() {
|
|
4595
|
-
const s = e.create(), n = this.getPanes() ??
|
|
4776
|
+
const s = e.create(), n = this.getPanes() ?? C("onAdd回调中一定会有panes");
|
|
4596
4777
|
let a;
|
|
4597
4778
|
switch (e.mapPane) {
|
|
4598
4779
|
case "float":
|
|
@@ -4608,7 +4789,7 @@ class xi {
|
|
|
4608
4789
|
a = n.mapPane;
|
|
4609
4790
|
break;
|
|
4610
4791
|
default:
|
|
4611
|
-
|
|
4792
|
+
Ze(e.mapPane);
|
|
4612
4793
|
break;
|
|
4613
4794
|
}
|
|
4614
4795
|
a.appendChild(s);
|
|
@@ -4633,7 +4814,7 @@ class xi {
|
|
|
4633
4814
|
return this.google;
|
|
4634
4815
|
}
|
|
4635
4816
|
}
|
|
4636
|
-
class
|
|
4817
|
+
class $i extends Ai {
|
|
4637
4818
|
constructor(e, t, r, s) {
|
|
4638
4819
|
super(e, t), this.content = r, this.position = s;
|
|
4639
4820
|
}
|
|
@@ -4648,12 +4829,12 @@ class Ei extends xi {
|
|
|
4648
4829
|
this.position = e, this.draw();
|
|
4649
4830
|
}
|
|
4650
4831
|
}
|
|
4651
|
-
const
|
|
4832
|
+
const Ri = x({
|
|
4652
4833
|
name: "tg-element-overlay",
|
|
4653
4834
|
mixins: [L],
|
|
4654
4835
|
props: {
|
|
4655
|
-
mapPane:
|
|
4656
|
-
position:
|
|
4836
|
+
mapPane: G(Ue, Ue.overlayMouseTarget),
|
|
4837
|
+
position: z(y)
|
|
4657
4838
|
},
|
|
4658
4839
|
setup() {
|
|
4659
4840
|
return {
|
|
@@ -4674,25 +4855,25 @@ const Li = C({
|
|
|
4674
4855
|
}
|
|
4675
4856
|
},
|
|
4676
4857
|
onCreate() {
|
|
4677
|
-
this.overlay = new
|
|
4858
|
+
this.overlay = new $i(this.$map, this, this.content(), this.position), this.$map.addElementOverlay(this.overlay);
|
|
4678
4859
|
},
|
|
4679
4860
|
onDestroy() {
|
|
4680
4861
|
this.$map.removeElementOverlay(this.overlay);
|
|
4681
4862
|
}
|
|
4682
4863
|
});
|
|
4683
|
-
function
|
|
4684
|
-
return
|
|
4864
|
+
function zi(i, e, t, r, s, n) {
|
|
4865
|
+
return Z(), W("div", le({
|
|
4685
4866
|
class: i.$options.name
|
|
4686
4867
|
}, i.$attrs), [
|
|
4687
|
-
|
|
4868
|
+
R(i.$slots, "default")
|
|
4688
4869
|
], 16);
|
|
4689
4870
|
}
|
|
4690
|
-
const
|
|
4871
|
+
const Ts = /* @__PURE__ */ j(Ri, [["render", zi]]), Ni = x({
|
|
4691
4872
|
name: "tg-marker",
|
|
4692
4873
|
mixins: [L],
|
|
4693
4874
|
inheritAttrs: !1,
|
|
4694
4875
|
props: {
|
|
4695
|
-
position:
|
|
4876
|
+
position: z(y),
|
|
4696
4877
|
title: f(String),
|
|
4697
4878
|
icon: f(Object),
|
|
4698
4879
|
clickable: f(Boolean),
|
|
@@ -4704,10 +4885,10 @@ const us = /* @__PURE__ */ W(Li, [["render", ki]]), Pi = C({
|
|
|
4704
4885
|
},
|
|
4705
4886
|
setup(i, { attrs: e }) {
|
|
4706
4887
|
return {
|
|
4707
|
-
attrs:
|
|
4888
|
+
attrs: K(e),
|
|
4708
4889
|
marker: void 0,
|
|
4709
|
-
label:
|
|
4710
|
-
info:
|
|
4890
|
+
label: je(),
|
|
4891
|
+
info: je()
|
|
4711
4892
|
};
|
|
4712
4893
|
},
|
|
4713
4894
|
watch: {
|
|
@@ -4721,7 +4902,7 @@ const us = /* @__PURE__ */ W(Li, [["render", ki]]), Pi = C({
|
|
|
4721
4902
|
i ? this.marker.setIcon(i) : this.recreate();
|
|
4722
4903
|
},
|
|
4723
4904
|
clickable(i) {
|
|
4724
|
-
this.marker instanceof
|
|
4905
|
+
this.marker instanceof ye ? this.recreate() : this.marker.setClickable(i);
|
|
4725
4906
|
},
|
|
4726
4907
|
draggable(i) {
|
|
4727
4908
|
this.marker.setDraggable(i);
|
|
@@ -4733,7 +4914,7 @@ const us = /* @__PURE__ */ W(Li, [["render", ki]]), Pi = C({
|
|
|
4733
4914
|
this.recreate();
|
|
4734
4915
|
},
|
|
4735
4916
|
zIndex(i) {
|
|
4736
|
-
this.marker instanceof
|
|
4917
|
+
this.marker instanceof ye ? this.recreate() : this.marker.setZIndex(i);
|
|
4737
4918
|
},
|
|
4738
4919
|
visible(i) {
|
|
4739
4920
|
this.marker.setVisible(i);
|
|
@@ -4747,7 +4928,7 @@ const us = /* @__PURE__ */ W(Li, [["render", ki]]), Pi = C({
|
|
|
4747
4928
|
},
|
|
4748
4929
|
methods: {
|
|
4749
4930
|
$clusterer() {
|
|
4750
|
-
return
|
|
4931
|
+
return Me(this.$parent, Si);
|
|
4751
4932
|
},
|
|
4752
4933
|
onAddLabel(i) {
|
|
4753
4934
|
this.label = i, this.marker && this.marker.setLabel(i.overlay);
|
|
@@ -4766,30 +4947,30 @@ const us = /* @__PURE__ */ W(Li, [["render", ki]]), Pi = C({
|
|
|
4766
4947
|
}
|
|
4767
4948
|
}
|
|
4768
4949
|
});
|
|
4769
|
-
function
|
|
4770
|
-
return
|
|
4950
|
+
function Di(i, e, t, r, s, n) {
|
|
4951
|
+
return Z(), W("div", le({
|
|
4771
4952
|
class: i.$options.name
|
|
4772
4953
|
}, i.attrs.binds), [
|
|
4773
|
-
|
|
4954
|
+
R(i.$slots, "default")
|
|
4774
4955
|
], 16);
|
|
4775
4956
|
}
|
|
4776
|
-
const
|
|
4957
|
+
const bt = /* @__PURE__ */ j(Ni, [["render", Di]]), Gi = x({
|
|
4777
4958
|
name: "tg-info-box",
|
|
4778
4959
|
mixins: [L],
|
|
4779
4960
|
inheritAttrs: !1,
|
|
4780
4961
|
props: {
|
|
4781
|
-
show:
|
|
4962
|
+
show: z(Boolean),
|
|
4782
4963
|
position: f(y),
|
|
4783
4964
|
offset: f(Object),
|
|
4784
4965
|
maxWidth: f(Number),
|
|
4785
4966
|
borderClass: f(String),
|
|
4786
4967
|
zIndex: f(Number),
|
|
4787
|
-
"onUpdate:show":
|
|
4968
|
+
"onUpdate:show": N()
|
|
4788
4969
|
},
|
|
4789
4970
|
emits: void 0,
|
|
4790
4971
|
setup(i, { attrs: e }) {
|
|
4791
4972
|
return {
|
|
4792
|
-
attrs:
|
|
4973
|
+
attrs: K(e, i),
|
|
4793
4974
|
overlay: void 0
|
|
4794
4975
|
};
|
|
4795
4976
|
},
|
|
@@ -4836,7 +5017,7 @@ const _t = /* @__PURE__ */ W(Pi, [["render", Ii]]), Bi = C({
|
|
|
4836
5017
|
return this.$el;
|
|
4837
5018
|
},
|
|
4838
5019
|
$marker() {
|
|
4839
|
-
return
|
|
5020
|
+
return Me(this.$parent, bt);
|
|
4840
5021
|
},
|
|
4841
5022
|
open(i) {
|
|
4842
5023
|
this.overlay.open(i);
|
|
@@ -4846,19 +5027,19 @@ const _t = /* @__PURE__ */ W(Pi, [["render", Ii]]), Bi = C({
|
|
|
4846
5027
|
}
|
|
4847
5028
|
}
|
|
4848
5029
|
});
|
|
4849
|
-
function
|
|
4850
|
-
return
|
|
5030
|
+
function Zi(i, e, t, r, s, n) {
|
|
5031
|
+
return Z(), W("div", le({
|
|
4851
5032
|
class: i.$options.name
|
|
4852
5033
|
}, i.attrs.binds), [
|
|
4853
|
-
|
|
5034
|
+
R(i.$slots, "default")
|
|
4854
5035
|
], 16);
|
|
4855
5036
|
}
|
|
4856
|
-
const
|
|
5037
|
+
const Os = /* @__PURE__ */ j(Gi, [["render", Zi]]), Wi = x({
|
|
4857
5038
|
name: "tg-info-window",
|
|
4858
5039
|
mixins: [L],
|
|
4859
5040
|
inheritAttrs: !1,
|
|
4860
5041
|
props: {
|
|
4861
|
-
show:
|
|
5042
|
+
show: z(Boolean),
|
|
4862
5043
|
position: f(y),
|
|
4863
5044
|
maxWidth: f(Number),
|
|
4864
5045
|
offset: f(Object),
|
|
@@ -4866,7 +5047,7 @@ const gs = /* @__PURE__ */ W(Bi, [["render", Si]]), Ai = C({
|
|
|
4866
5047
|
},
|
|
4867
5048
|
setup(i, { attrs: e }) {
|
|
4868
5049
|
return {
|
|
4869
|
-
attrs:
|
|
5050
|
+
attrs: K(e),
|
|
4870
5051
|
overlay: void 0
|
|
4871
5052
|
};
|
|
4872
5053
|
},
|
|
@@ -4892,7 +5073,7 @@ const gs = /* @__PURE__ */ W(Bi, [["render", Si]]), Ai = C({
|
|
|
4892
5073
|
return this.$el;
|
|
4893
5074
|
},
|
|
4894
5075
|
$marker() {
|
|
4895
|
-
return
|
|
5076
|
+
return Me(this.$parent, bt);
|
|
4896
5077
|
},
|
|
4897
5078
|
getOptions() {
|
|
4898
5079
|
return {
|
|
@@ -4915,16 +5096,16 @@ const gs = /* @__PURE__ */ W(Bi, [["render", Si]]), Ai = C({
|
|
|
4915
5096
|
this.$marker() ? this.$marker().onRemoveInfo(this) : this.overlay.close();
|
|
4916
5097
|
}
|
|
4917
5098
|
});
|
|
4918
|
-
function
|
|
4919
|
-
return
|
|
5099
|
+
function ji(i, e, t, r, s, n) {
|
|
5100
|
+
return Mr((Z(), W("div", le({
|
|
4920
5101
|
class: i.$options.name
|
|
4921
5102
|
}, i.attrs.binds), [
|
|
4922
|
-
|
|
5103
|
+
R(i.$slots, "default")
|
|
4923
5104
|
], 16)), [
|
|
4924
|
-
[
|
|
5105
|
+
[br, i.show]
|
|
4925
5106
|
]);
|
|
4926
5107
|
}
|
|
4927
|
-
const
|
|
5108
|
+
const ws = /* @__PURE__ */ j(Wi, [["render", ji]]), Vi = x({
|
|
4928
5109
|
name: "tg-label",
|
|
4929
5110
|
mixins: [L],
|
|
4930
5111
|
inheritAttrs: !1,
|
|
@@ -4935,7 +5116,7 @@ const ms = /* @__PURE__ */ W(Ai, [["render", $i]]), zi = C({
|
|
|
4935
5116
|
},
|
|
4936
5117
|
setup(i, { attrs: e }) {
|
|
4937
5118
|
return {
|
|
4938
|
-
attrs:
|
|
5119
|
+
attrs: K(e),
|
|
4939
5120
|
overlay: void 0
|
|
4940
5121
|
};
|
|
4941
5122
|
},
|
|
@@ -4962,7 +5143,7 @@ const ms = /* @__PURE__ */ W(Ai, [["render", $i]]), zi = C({
|
|
|
4962
5143
|
return (i = this.$marker()) == null ? void 0 : i.marker;
|
|
4963
5144
|
},
|
|
4964
5145
|
$marker() {
|
|
4965
|
-
return
|
|
5146
|
+
return Me(this.$parent, bt);
|
|
4966
5147
|
},
|
|
4967
5148
|
getOptions() {
|
|
4968
5149
|
return {
|
|
@@ -4980,19 +5161,19 @@ const ms = /* @__PURE__ */ W(Ai, [["render", $i]]), zi = C({
|
|
|
4980
5161
|
this.$marker() ? this.$marker().onRemoveLabel(this) : this.$map.removeOverlay(this.overlay);
|
|
4981
5162
|
}
|
|
4982
5163
|
});
|
|
4983
|
-
function
|
|
4984
|
-
return
|
|
5164
|
+
function Hi(i, e, t, r, s, n) {
|
|
5165
|
+
return Z(), W("div", le({
|
|
4985
5166
|
class: i.$options.name
|
|
4986
5167
|
}, i.attrs.binds), [
|
|
4987
|
-
|
|
5168
|
+
R(i.$slots, "default")
|
|
4988
5169
|
], 16);
|
|
4989
5170
|
}
|
|
4990
|
-
const
|
|
5171
|
+
const Cs = /* @__PURE__ */ j(Vi, [["render", Hi]]), xs = x({
|
|
4991
5172
|
name: "tg-polygon",
|
|
4992
5173
|
mixins: [L],
|
|
4993
5174
|
inheritAttrs: !1,
|
|
4994
5175
|
props: {
|
|
4995
|
-
paths:
|
|
5176
|
+
paths: z(Array),
|
|
4996
5177
|
clickable: f(Boolean),
|
|
4997
5178
|
editable: f(Boolean),
|
|
4998
5179
|
strokeColor: f(String),
|
|
@@ -5004,7 +5185,7 @@ const fs = /* @__PURE__ */ W(zi, [["render", Ni]]), ys = C({
|
|
|
5004
5185
|
},
|
|
5005
5186
|
setup(i, { attrs: e }) {
|
|
5006
5187
|
return {
|
|
5007
|
-
attrs:
|
|
5188
|
+
attrs: K(e),
|
|
5008
5189
|
polygon: void 0
|
|
5009
5190
|
};
|
|
5010
5191
|
},
|
|
@@ -5046,12 +5227,12 @@ const fs = /* @__PURE__ */ W(zi, [["render", Ni]]), ys = C({
|
|
|
5046
5227
|
onDestroy() {
|
|
5047
5228
|
this.$map.removeOverlay(this.polygon);
|
|
5048
5229
|
}
|
|
5049
|
-
}),
|
|
5230
|
+
}), Es = x({
|
|
5050
5231
|
name: "tg-polyline",
|
|
5051
5232
|
mixins: [L],
|
|
5052
5233
|
inheritAttrs: !1,
|
|
5053
5234
|
props: {
|
|
5054
|
-
path:
|
|
5235
|
+
path: z(Array),
|
|
5055
5236
|
clickable: f(Boolean),
|
|
5056
5237
|
editable: f(Boolean),
|
|
5057
5238
|
strokeColor: f(String),
|
|
@@ -5061,7 +5242,7 @@ const fs = /* @__PURE__ */ W(zi, [["render", Ni]]), ys = C({
|
|
|
5061
5242
|
},
|
|
5062
5243
|
setup(i, { attrs: e }) {
|
|
5063
5244
|
return {
|
|
5064
|
-
attrs:
|
|
5245
|
+
attrs: K(e),
|
|
5065
5246
|
polyline: void 0
|
|
5066
5247
|
};
|
|
5067
5248
|
},
|
|
@@ -5097,14 +5278,14 @@ const fs = /* @__PURE__ */ W(zi, [["render", Ni]]), ys = C({
|
|
|
5097
5278
|
onDestroy() {
|
|
5098
5279
|
this.$map.removeOverlay(this.polyline);
|
|
5099
5280
|
}
|
|
5100
|
-
}),
|
|
5281
|
+
}), Fi = ["beforeUpdate", "updated"], Ls = {
|
|
5101
5282
|
install(i, e = {}) {
|
|
5102
5283
|
if (e.enable !== !1) {
|
|
5103
|
-
const t =
|
|
5284
|
+
const t = x({
|
|
5104
5285
|
beforeCreate() {
|
|
5105
|
-
const r =
|
|
5106
|
-
e.hookNames ? e.hookNames.includes(a) && console.debug("[lifecycle]", r, a) :
|
|
5107
|
-
} :
|
|
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;
|
|
5108
5289
|
n("beforeCreate"), this.__life_impl = n;
|
|
5109
5290
|
},
|
|
5110
5291
|
created() {
|
|
@@ -5143,156 +5324,162 @@ const fs = /* @__PURE__ */ W(zi, [["render", Ni]]), ys = C({
|
|
|
5143
5324
|
i.mixin(t);
|
|
5144
5325
|
}
|
|
5145
5326
|
}
|
|
5146
|
-
},
|
|
5147
|
-
function
|
|
5327
|
+
}, Ui = 6378137;
|
|
5328
|
+
function pe(i) {
|
|
5148
5329
|
return i * Math.PI / 180;
|
|
5149
5330
|
}
|
|
5150
|
-
function
|
|
5331
|
+
function Bt(i) {
|
|
5151
5332
|
return i * 180 / Math.PI;
|
|
5152
5333
|
}
|
|
5153
|
-
function
|
|
5334
|
+
function Yi(i, e) {
|
|
5154
5335
|
if (i.lat === e.lat && i.lng === e.lng)
|
|
5155
5336
|
return 0;
|
|
5156
|
-
const t =
|
|
5337
|
+
const t = pe((i.lat + e.lat) / 2), r = pe((i.lat - e.lat) / 2), s = pe((i.lng - e.lng) / 2);
|
|
5157
5338
|
let n = Math.sin(r), a = Math.sin(s), c = Math.sin(t);
|
|
5158
|
-
const o =
|
|
5339
|
+
const o = Ui, l = 1 / 298.257;
|
|
5159
5340
|
n = n * n, a = a * a, c = c * c;
|
|
5160
|
-
const h = n * (1 - a) + (1 - c) * a,
|
|
5161
|
-
return b * (1 + l * (
|
|
5162
|
-
}
|
|
5163
|
-
function
|
|
5164
|
-
const s = 63567523142e-4, n = 1 / 298.257223563, a =
|
|
5165
|
-
let v = 0, O = 0, E = 0, w = t / (s * g),
|
|
5166
|
-
for (; Math.abs(w -
|
|
5167
|
-
v = Math.cos(2 *
|
|
5168
|
-
const
|
|
5169
|
-
|
|
5170
|
-
}
|
|
5171
|
-
const re =
|
|
5172
|
-
|
|
5173
|
-
(1 - n) * Math.sqrt(
|
|
5174
|
-
),
|
|
5175
|
-
return { lng: i.lng +
|
|
5176
|
-
}
|
|
5177
|
-
const
|
|
5178
|
-
getDistance:
|
|
5179
|
-
getDestination:
|
|
5180
|
-
},
|
|
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 = {
|
|
5181
5362
|
install(i, e) {
|
|
5182
|
-
|
|
5363
|
+
Dr(e), i.config.unwrapInjectedRef = !0;
|
|
5183
5364
|
const t = i.config.optionMergeStrategies;
|
|
5184
|
-
t[
|
|
5365
|
+
t[ve] = t[_e] = (r, s) => r ? [...new Set([].concat(r, s))] : Array.isArray(s) ? s : [s];
|
|
5185
5366
|
}
|
|
5186
5367
|
};
|
|
5187
5368
|
export {
|
|
5188
|
-
|
|
5189
|
-
|
|
5369
|
+
Wt as AbstractControl,
|
|
5370
|
+
rt as AbstractMap,
|
|
5190
5371
|
xe as Arrays,
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
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,
|
|
5379
|
+
ye as BaiduMarker,
|
|
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,
|
|
5389
|
+
P as ControlPosition,
|
|
5208
5390
|
B as ControlPositionConverter,
|
|
5209
5391
|
Q as CoordType,
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
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,
|
|
5229
5412
|
y as LatLng,
|
|
5230
5413
|
F as LatLngBounds,
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5414
|
+
Ls as LifecycleLogPlugin,
|
|
5415
|
+
ve as MIXIN_HOOK_CREATE,
|
|
5416
|
+
_e as MIXIN_HOOK_DESTROY,
|
|
5417
|
+
Mt as MIXIN_MAP_NAME,
|
|
5235
5418
|
Ee as MVCArrays,
|
|
5236
5419
|
L as MapMixin,
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5420
|
+
Vt as MapTypeControlType,
|
|
5421
|
+
ni as MapZoom,
|
|
5422
|
+
Qt as MarkerClusterer,
|
|
5240
5423
|
me as Objects,
|
|
5241
|
-
|
|
5242
|
-
|
|
5424
|
+
ir as Overlay,
|
|
5425
|
+
er as PlacesService,
|
|
5243
5426
|
U as Point,
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
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,
|
|
5254
5440
|
$ as TgMapType,
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
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
|
+
Te as callHook,
|
|
5452
|
+
cs as computedSaveOnThis,
|
|
5453
|
+
nr as createEmptyVNode,
|
|
5454
|
+
Mi as createPropertyObject,
|
|
5455
|
+
ds as createPropertyObjectTyped,
|
|
5456
|
+
es as debug,
|
|
5457
|
+
ks as default,
|
|
5458
|
+
gs as eventLogMethods,
|
|
5459
|
+
N as eventProp,
|
|
5460
|
+
us as extractVNodeFromSlotsByComponent,
|
|
5461
|
+
ps as findByComponentType,
|
|
5462
|
+
Ki as getDestination,
|
|
5463
|
+
Dt as getTgMapConfig,
|
|
5464
|
+
ts as isDef,
|
|
5465
|
+
is as isInstanceOf,
|
|
5466
|
+
rs as lateinit,
|
|
5467
|
+
ue as noop,
|
|
5281
5468
|
f as optionalProp,
|
|
5282
5469
|
ci as path,
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5470
|
+
z as requiredProp,
|
|
5471
|
+
ss as safeAs,
|
|
5472
|
+
Me as safeAsComponent,
|
|
5473
|
+
Dr as setTgMapConfig,
|
|
5474
|
+
bi as splitAttrs,
|
|
5475
|
+
G as stringEnumProp,
|
|
5476
|
+
_i as stringUnionPropFromValues,
|
|
5477
|
+
C as throwError,
|
|
5478
|
+
$t as throwUnsupported,
|
|
5479
|
+
Qi as todo,
|
|
5480
|
+
je as typed,
|
|
5481
|
+
ns as unwrapStringEnumValue,
|
|
5482
|
+
K as useSplittedAttrs,
|
|
5483
|
+
ki as useTgMap
|
|
5297
5484
|
};
|
|
5298
5485
|
//# sourceMappingURL=tg-map.js.map
|