tg-map-vue3 3.0.9 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/components/TgMap.vue.d.ts +45 -8
- package/dist/src/components/overlays/TgCircle.vue.d.ts +3 -2
- package/dist/src/components/overlays/TgInfoBox.vue.d.ts +13 -4
- package/dist/src/components/overlays/TgInfoWindow.vue.d.ts +3 -2
- package/dist/src/components/overlays/TgLabel.vue.d.ts +3 -2
- package/dist/src/components/overlays/TgMarker.vue.d.ts +9 -6
- package/dist/src/components/overlays/TgPolygon.vue.d.ts +3 -2
- package/dist/src/components/overlays/TgPolyline.vue.d.ts +3 -2
- package/dist/src/map/map/map-options.d.ts +2 -1
- package/dist/src/utils/vue-utils.d.ts +61 -12
- package/dist/tg-map.js +607 -580
- package/dist/tg-map.js.map +1 -1
- package/dist/tg-map.umd.cjs +4 -4
- package/dist/tg-map.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/tg-map.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
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-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 h = (i, e, t) => (
|
|
5
|
-
import { createCommentVNode as Ie,
|
|
6
|
-
function
|
|
2
|
+
var Vt = Object.defineProperty;
|
|
3
|
+
var Ht = (i, e, t) => e in i ? Vt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
4
|
+
var h = (i, e, t) => (Ht(i, typeof e != "symbol" ? e + "" : e, t), t);
|
|
5
|
+
import { createCommentVNode as Ie, computed as bt, defineComponent as C, openBlock as Z, createElementBlock as G, mergeProps as ie, createElementVNode as Ft, renderSlot as A, normalizeClass as De, normalizeStyle as Ut, withDirectives as Yt, vShow as Kt } from "vue";
|
|
6
|
+
function F(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 qt = 1;
|
|
12
|
+
function Xt() {
|
|
13
|
+
return qt++;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return e.__id__ || (e.__id__ =
|
|
15
|
+
function ye(i, e) {
|
|
16
|
+
return e.__id__ || (e.__id__ = Xt()), `${i}::${e.__id__}`;
|
|
17
17
|
}
|
|
18
|
-
var
|
|
18
|
+
var Tt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, W = {}, Jt = {
|
|
19
19
|
get exports() {
|
|
20
|
-
return
|
|
20
|
+
return W;
|
|
21
21
|
},
|
|
22
22
|
set exports(i) {
|
|
23
|
-
|
|
23
|
+
W = i;
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
(function(i) {
|
|
27
27
|
(function(e, t) {
|
|
28
28
|
i.exports ? i.exports = t() : e.coordtransform = t();
|
|
29
|
-
})(
|
|
29
|
+
})(Tt, function() {
|
|
30
30
|
var e = 52.35987755982988, t = 3.141592653589793, r = 6378245, s = 0.006693421622965943;
|
|
31
31
|
function n(p, f, v, O) {
|
|
32
32
|
this.west = Math.min(p, v), this.north = Math.max(f, O), this.east = Math.max(p, v), this.south = Math.min(f, O);
|
|
@@ -61,12 +61,12 @@ var Mt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
61
61
|
return !1;
|
|
62
62
|
}
|
|
63
63
|
function l(p, f) {
|
|
64
|
-
var v = p - 65e-4, O = f - 6e-3,
|
|
65
|
-
return [
|
|
64
|
+
var v = p - 65e-4, O = f - 6e-3, Y = Math.sqrt(v * v + O * O) - 2e-5 * Math.sin(O * e), B = Math.atan2(O, v) - 3e-6 * Math.cos(v * e), ue = Y * Math.cos(B), xe = Y * Math.sin(B);
|
|
65
|
+
return [ue, xe];
|
|
66
66
|
}
|
|
67
67
|
function c(p, f) {
|
|
68
|
-
var v = Math.sqrt(p * p + f * f) + 2e-5 * Math.sin(f * e), O = Math.atan2(f, p) + 3e-6 * Math.cos(p * e),
|
|
69
|
-
return [
|
|
68
|
+
var v = Math.sqrt(p * p + f * f) + 2e-5 * Math.sin(f * e), O = Math.atan2(f, p) + 3e-6 * Math.cos(p * e), Y = v * Math.cos(O) + 65e-4, B = v * Math.sin(O) + 6e-3;
|
|
69
|
+
return [Y, B];
|
|
70
70
|
}
|
|
71
71
|
function u(p, f) {
|
|
72
72
|
return o(p, f) ? b(p, f) : [p, f];
|
|
@@ -78,12 +78,12 @@ var Mt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
78
78
|
return [p * 2 - v[0], f * 2 - v[1]];
|
|
79
79
|
}
|
|
80
80
|
function b(p, f) {
|
|
81
|
-
var v = M(p - 105, f - 35), O = T(p - 105, f - 35),
|
|
81
|
+
var v = M(p - 105, f - 35), O = T(p - 105, f - 35), Y = f / 180 * t, B = Math.sin(Y);
|
|
82
82
|
B = 1 - s * B * B;
|
|
83
|
-
var
|
|
84
|
-
v = v * 180 / (r * (1 - s) / (B *
|
|
85
|
-
var
|
|
86
|
-
return [
|
|
83
|
+
var ue = Math.sqrt(B);
|
|
84
|
+
v = v * 180 / (r * (1 - s) / (B * ue) * t), O = O * 180 / (r / ue * Math.cos(Y) * t);
|
|
85
|
+
var xe = f + v, Wt = p + O;
|
|
86
|
+
return [Wt, xe];
|
|
87
87
|
}
|
|
88
88
|
function M(p, f) {
|
|
89
89
|
var v = -100 + 2 * p + 3 * f + 0.2 * f * f + 0.1 * p * f + 0.2 * Math.sqrt(Math.abs(p));
|
|
@@ -118,33 +118,33 @@ var Mt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
120
|
});
|
|
121
|
-
})(
|
|
121
|
+
})(Jt);
|
|
122
122
|
function x(i) {
|
|
123
123
|
throw new Error(i);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function Qt(i) {
|
|
126
126
|
throw new Error(`Unsupported: ${i}`);
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function wi(i) {
|
|
129
129
|
throw new Error(`todo: ${i}`);
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function xi(i) {
|
|
132
132
|
return i;
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function ve(...i) {
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function Ei(i) {
|
|
137
137
|
return i != null;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function ae(i, e) {
|
|
140
140
|
if (!i)
|
|
141
141
|
throw new Error(`AssertionError: ${e}`);
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function ut(i) {
|
|
144
144
|
throw new Error(`Unexpected object: ${i}`);
|
|
145
145
|
}
|
|
146
|
-
var
|
|
147
|
-
const
|
|
146
|
+
var q = /* @__PURE__ */ ((i) => (i.wgs84 = "wgs84", i.gcj02 = "gcj02", i.bd09 = "bd09", i))(q || {});
|
|
147
|
+
const Ee = "wgs84", S = 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 xe = "wgs84", S = class {
|
|
|
160
160
|
return new S(e.lat, e.lng, t);
|
|
161
161
|
}
|
|
162
162
|
static fromLiteral(e) {
|
|
163
|
-
return new S(e.lat, e.lng, e.coord ||
|
|
163
|
+
return new S(e.lat, e.lng, e.coord || Ee);
|
|
164
164
|
}
|
|
165
|
-
static fromLngLat(e, t, r =
|
|
165
|
+
static fromLngLat(e, t, r = Ee) {
|
|
166
166
|
return new S(t, e, r);
|
|
167
167
|
}
|
|
168
|
-
static create(e, t, r =
|
|
168
|
+
static create(e, t, r = Ee) {
|
|
169
169
|
return new S(e, t, r);
|
|
170
170
|
}
|
|
171
171
|
to(e) {
|
|
@@ -197,11 +197,11 @@ const xe = "wgs84", S = class {
|
|
|
197
197
|
convert(e) {
|
|
198
198
|
switch (this.coord) {
|
|
199
199
|
case "bd09":
|
|
200
|
-
return e === "gcj02" ?
|
|
200
|
+
return e === "gcj02" ? W.bd09ToGcj02(this.lng, this.lat) : W.bd09ToWgs84(this.lng, this.lat);
|
|
201
201
|
case "gcj02":
|
|
202
|
-
return e === "wgs84" ?
|
|
202
|
+
return e === "wgs84" ? W.gcj02ToWgs84(this.lng, this.lat) : W.gcj02ToBd09(this.lng, this.lat);
|
|
203
203
|
case "wgs84":
|
|
204
|
-
return e === "bd09" ?
|
|
204
|
+
return e === "bd09" ? W.wgs84ToBd09(this.lng, this.lat) : W.wgs84ToGcj02(this.lng, this.lat);
|
|
205
205
|
}
|
|
206
206
|
throw new Error(`不支持的坐标转换: ${this.coord}=>${e}`);
|
|
207
207
|
}
|
|
@@ -214,7 +214,7 @@ const xe = "wgs84", S = class {
|
|
|
214
214
|
};
|
|
215
215
|
let y = S;
|
|
216
216
|
h(y, "ZERO", S.create(0, 0));
|
|
217
|
-
const
|
|
217
|
+
const K = class {
|
|
218
218
|
/**
|
|
219
219
|
* 不推荐直接创建LatLngBounds, sw和ne的大小关系可能没法保证, 推荐用LatLngBounds.Builder或者LatLngBounds.from等静态方法来创建
|
|
220
220
|
* @param sw 西南, lat/lng更小
|
|
@@ -222,7 +222,7 @@ const Y = class {
|
|
|
222
222
|
*/
|
|
223
223
|
constructor(e, t) {
|
|
224
224
|
h(this, "coord");
|
|
225
|
-
this.sw = e, this.ne = t,
|
|
225
|
+
this.sw = e, this.ne = t, ae(e.coord === t.coord, "sw和ne的coord应该相同"), ae(Number.isFinite(e.lat) && Number.isFinite(e.lng) && Number.isFinite(t.lat) && Number.isFinite(t.lng), `sw(${e})和ne(${t})不能包含NaN或Infinite`), ae(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;
|
|
@@ -230,7 +230,7 @@ const Y = class {
|
|
|
230
230
|
static fromArray(e) {
|
|
231
231
|
if (e.length === 0)
|
|
232
232
|
return;
|
|
233
|
-
const t = new
|
|
233
|
+
const t = new K.Builder(e[0]);
|
|
234
234
|
for (let r = 1; r < e.length; r++)
|
|
235
235
|
t.include(e[r]);
|
|
236
236
|
return t.build();
|
|
@@ -239,13 +239,13 @@ const Y = class {
|
|
|
239
239
|
return this.fromArray(e) ?? x("positions中没有点");
|
|
240
240
|
}
|
|
241
241
|
static fromGoogle(e, t) {
|
|
242
|
-
return new
|
|
242
|
+
return new K(
|
|
243
243
|
y.fromGoogle(e.getSouthWest(), t),
|
|
244
244
|
y.fromGoogle(e.getNorthEast(), t)
|
|
245
245
|
);
|
|
246
246
|
}
|
|
247
247
|
static fromBaidu(e, t) {
|
|
248
|
-
return new
|
|
248
|
+
return new K(
|
|
249
249
|
y.fromBaidu(e.getSouthWest(), t),
|
|
250
250
|
y.fromBaidu(e.getNorthEast(), t)
|
|
251
251
|
);
|
|
@@ -258,7 +258,7 @@ const Y = class {
|
|
|
258
258
|
}
|
|
259
259
|
contains(e) {
|
|
260
260
|
const { lat: t, lng: r } = e.to(this.coord);
|
|
261
|
-
return this.sw.lat <= t && t <= this.ne.lat &&
|
|
261
|
+
return this.sw.lat <= t && t <= this.ne.lat && K.isBetweenLng(this.sw.lng, this.ne.lng, r);
|
|
262
262
|
}
|
|
263
263
|
getCenter() {
|
|
264
264
|
const e = (this.sw.lat + this.ne.lat) / 2, t = (this.sw.lng + this.ne.lng + (this.sw.lng < this.ne.lng ? 0 : 360)) / 2;
|
|
@@ -280,8 +280,8 @@ const Y = class {
|
|
|
280
280
|
return [this.sw.toBaidu(e), this.ne.toBaidu(e)];
|
|
281
281
|
}
|
|
282
282
|
};
|
|
283
|
-
let
|
|
284
|
-
h(
|
|
283
|
+
let V = K;
|
|
284
|
+
h(V, "EMPTY", new K(y.ZERO, y.ZERO));
|
|
285
285
|
((i) => {
|
|
286
286
|
class e {
|
|
287
287
|
constructor(r) {
|
|
@@ -309,78 +309,78 @@ h(W, "EMPTY", new Y(y.ZERO, y.ZERO));
|
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
311
|
i.Builder = e;
|
|
312
|
-
})(
|
|
313
|
-
var
|
|
314
|
-
return
|
|
312
|
+
})(V || (V = {}));
|
|
313
|
+
var er = function(e) {
|
|
314
|
+
return tr(e) && !rr(e);
|
|
315
315
|
};
|
|
316
|
-
function
|
|
316
|
+
function tr(i) {
|
|
317
317
|
return !!i && typeof i == "object";
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function rr(i) {
|
|
320
320
|
var e = Object.prototype.toString.call(i);
|
|
321
|
-
return e === "[object RegExp]" || e === "[object Date]" ||
|
|
322
|
-
}
|
|
323
|
-
var rr = typeof Symbol == "function" && Symbol.for, ir = rr ? Symbol.for("react.element") : 60103;
|
|
324
|
-
function sr(i) {
|
|
325
|
-
return i.$$typeof === ir;
|
|
321
|
+
return e === "[object RegExp]" || e === "[object Date]" || nr(i);
|
|
326
322
|
}
|
|
323
|
+
var ir = typeof Symbol == "function" && Symbol.for, sr = ir ? Symbol.for("react.element") : 60103;
|
|
327
324
|
function nr(i) {
|
|
325
|
+
return i.$$typeof === sr;
|
|
326
|
+
}
|
|
327
|
+
function or(i) {
|
|
328
328
|
return Array.isArray(i) ? [] : {};
|
|
329
329
|
}
|
|
330
|
-
function
|
|
331
|
-
return e.clone !== !1 && e.isMergeableObject(i) ?
|
|
330
|
+
function le(i, e) {
|
|
331
|
+
return e.clone !== !1 && e.isMergeableObject(i) ? ee(or(i), i, e) : i;
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function ar(i, e, t) {
|
|
334
334
|
return i.concat(e).map(function(r) {
|
|
335
|
-
return
|
|
335
|
+
return le(r, t);
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function lr(i, e) {
|
|
339
339
|
if (!e.customMerge)
|
|
340
|
-
return
|
|
340
|
+
return ee;
|
|
341
341
|
var t = e.customMerge(i);
|
|
342
|
-
return typeof t == "function" ? t :
|
|
342
|
+
return typeof t == "function" ? t : ee;
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function hr(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 gt(i) {
|
|
350
|
+
return Object.keys(i).concat(hr(i));
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function Ot(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 cr(i, e) {
|
|
360
|
+
return Ot(i, e) && !(Object.hasOwnProperty.call(i, e) && Object.propertyIsEnumerable.call(i, e));
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function dr(i, e, t) {
|
|
363
363
|
var r = {};
|
|
364
|
-
return t.isMergeableObject(i) &&
|
|
365
|
-
r[s] =
|
|
366
|
-
}),
|
|
367
|
-
|
|
364
|
+
return t.isMergeableObject(i) && gt(i).forEach(function(s) {
|
|
365
|
+
r[s] = le(i[s], t);
|
|
366
|
+
}), gt(e).forEach(function(s) {
|
|
367
|
+
cr(i, s) || (Ot(i, s) && t.isMergeableObject(e[s]) ? r[s] = lr(s, t)(i[s], e[s], t) : r[s] = le(e[s], t));
|
|
368
368
|
}), r;
|
|
369
369
|
}
|
|
370
|
-
function
|
|
371
|
-
t = t || {}, t.arrayMerge = t.arrayMerge ||
|
|
370
|
+
function ee(i, e, t) {
|
|
371
|
+
t = t || {}, t.arrayMerge = t.arrayMerge || ar, t.isMergeableObject = t.isMergeableObject || er, t.cloneUnlessOtherwiseSpecified = le;
|
|
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) : dr(i, e, t) : le(e, t);
|
|
374
374
|
}
|
|
375
|
-
|
|
375
|
+
ee.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 ee(r, s, t);
|
|
380
380
|
}, {});
|
|
381
381
|
};
|
|
382
|
-
var
|
|
383
|
-
const
|
|
382
|
+
var pr = ee, Ct = pr;
|
|
383
|
+
const _e = ["3.0"], ur = {
|
|
384
384
|
baidu: {
|
|
385
385
|
version: "3.0",
|
|
386
386
|
// 在build时会被静态替换, 导致使用者不能无法设置它
|
|
@@ -395,38 +395,38 @@ const ve = ["3.0"], pr = {
|
|
|
395
395
|
language: "en-us"
|
|
396
396
|
},
|
|
397
397
|
here: {
|
|
398
|
-
version:
|
|
398
|
+
version: _e[0],
|
|
399
399
|
key: {}.VITE_APP_DEV_KEY_HERE,
|
|
400
400
|
language: ""
|
|
401
401
|
}
|
|
402
402
|
};
|
|
403
|
-
let
|
|
404
|
-
function
|
|
405
|
-
return
|
|
403
|
+
let wt;
|
|
404
|
+
function xt() {
|
|
405
|
+
return wt || x("请先安装: Vue<PartialTgMapConfig>.use(TgMap, {})");
|
|
406
406
|
}
|
|
407
|
-
function
|
|
408
|
-
i != null && (
|
|
407
|
+
function gr(i) {
|
|
408
|
+
i != null && (wt = Ct(ur, i));
|
|
409
409
|
}
|
|
410
|
-
function
|
|
410
|
+
function ki() {
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function Le(i) {
|
|
413
413
|
return i;
|
|
414
414
|
}
|
|
415
|
-
function
|
|
415
|
+
function Pi(i, e) {
|
|
416
416
|
return i instanceof e;
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function Ii(i, e) {
|
|
419
419
|
if (i instanceof e)
|
|
420
420
|
return i;
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function pe(i, e) {
|
|
423
423
|
if ((i == null ? void 0 : i.$options.name) === e.name)
|
|
424
424
|
return i;
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function Li(i) {
|
|
427
427
|
return i;
|
|
428
428
|
}
|
|
429
|
-
class
|
|
429
|
+
class Ze {
|
|
430
430
|
constructor(e) {
|
|
431
431
|
h(this, "latestInfoWindow");
|
|
432
432
|
/** 使用{@link setEventTargetDelegate}初始化 */
|
|
@@ -478,7 +478,7 @@ class Re {
|
|
|
478
478
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
479
479
|
* Released under the MIT License.
|
|
480
480
|
*/
|
|
481
|
-
function
|
|
481
|
+
function mr(i) {
|
|
482
482
|
return i != null && typeof i == "object" && Array.isArray(i) === !1;
|
|
483
483
|
}
|
|
484
484
|
/*!
|
|
@@ -487,14 +487,14 @@ function gr(i) {
|
|
|
487
487
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
488
488
|
* Released under the MIT License.
|
|
489
489
|
*/
|
|
490
|
-
function
|
|
491
|
-
return
|
|
490
|
+
function mt(i) {
|
|
491
|
+
return mr(i) === !0 && Object.prototype.toString.call(i) === "[object Object]";
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function Et(i) {
|
|
494
494
|
var e, t;
|
|
495
|
-
return !(
|
|
495
|
+
return !(mt(i) === !1 || (e = i.constructor, typeof e != "function") || (t = e.prototype, mt(t) === !1) || t.hasOwnProperty("isPrototypeOf") === !1);
|
|
496
496
|
}
|
|
497
|
-
var
|
|
497
|
+
var he;
|
|
498
498
|
((i) => {
|
|
499
499
|
function e(n, a) {
|
|
500
500
|
return n.reduce((g, o) => (g[a(o)] = o, g), {});
|
|
@@ -509,36 +509,37 @@ var le;
|
|
|
509
509
|
}
|
|
510
510
|
i.toJsonSafely = r;
|
|
511
511
|
function s(n) {
|
|
512
|
-
|
|
512
|
+
Et(n) && Object.keys(n).forEach((a) => {
|
|
513
513
|
n[a] === void 0 ? delete n[a] : s(n[a]);
|
|
514
514
|
});
|
|
515
515
|
}
|
|
516
516
|
i.deleteUndefinedPropertyOnPlainObjectDeeply = s;
|
|
517
|
-
})(
|
|
518
|
-
|
|
519
|
-
|
|
517
|
+
})(he || (he = {}));
|
|
518
|
+
he.toJsonSafely;
|
|
519
|
+
const fr = ["single", "multi"];
|
|
520
|
+
var R = /* @__PURE__ */ ((i) => (i.auto = "auto", i.none = "none", i.greedy = "greedy", i.cooperative = "cooperative", i))(R || {}), Be;
|
|
520
521
|
((i) => {
|
|
521
522
|
function e(t) {
|
|
522
|
-
|
|
523
|
+
he.deleteUndefinedPropertyOnPlainObjectDeeply(t);
|
|
523
524
|
const r = { center: y.ZERO, zoom: 5 };
|
|
524
|
-
return
|
|
525
|
-
isMergeableObject:
|
|
525
|
+
return Ct(r, t || {}, {
|
|
526
|
+
isMergeableObject: Et
|
|
526
527
|
});
|
|
527
528
|
}
|
|
528
529
|
i.create = e;
|
|
529
|
-
})(
|
|
530
|
-
var
|
|
530
|
+
})(Be || (Be = {}));
|
|
531
|
+
var Se = {}, yr = {
|
|
531
532
|
get exports() {
|
|
532
|
-
return
|
|
533
|
+
return Se;
|
|
533
534
|
},
|
|
534
535
|
set exports(i) {
|
|
535
|
-
|
|
536
|
+
Se = i;
|
|
536
537
|
}
|
|
537
538
|
};
|
|
538
539
|
(function(i, e) {
|
|
539
540
|
(function(t, r) {
|
|
540
541
|
i.exports = r();
|
|
541
|
-
})(
|
|
542
|
+
})(Tt, function() {
|
|
542
543
|
var t, r = t = r || { version: "1.3.8" }, s = {};
|
|
543
544
|
r.guid = "$BAIDU$", s[r.guid] = s[r.guid] || {}, r.dom = r.dom || {}, r.dom.g = function(o) {
|
|
544
545
|
return typeof o == "string" || o instanceof String ? document.getElementById(o) : o && o.nodeName && (o.nodeType == 1 || o.nodeType == 9) ? o : null;
|
|
@@ -727,24 +728,24 @@ var Le = {}, mr = {
|
|
|
727
728
|
});
|
|
728
729
|
}, g;
|
|
729
730
|
});
|
|
730
|
-
})(
|
|
731
|
-
const
|
|
732
|
-
var
|
|
733
|
-
e =
|
|
731
|
+
})(yr);
|
|
732
|
+
const ft = Se;
|
|
733
|
+
var kt = function(i, e, t) {
|
|
734
|
+
e = vr(e);
|
|
734
735
|
var r = i.pointToPixel(e.getNorthEast()), s = i.pointToPixel(e.getSouthWest());
|
|
735
736
|
r.x += t, r.y -= t, s.x -= t, s.y += t;
|
|
736
737
|
var n = i.pixelToPoint(r), a = i.pixelToPoint(s);
|
|
737
738
|
return new BMap.Bounds(a, n);
|
|
738
|
-
},
|
|
739
|
-
var e =
|
|
739
|
+
}, vr = function(i) {
|
|
740
|
+
var e = ge(i.getNorthEast().lng, -180, 180), t = ge(i.getSouthWest().lng, -180, 180), r = ge(i.getNorthEast().lat, -74, 74), s = ge(i.getSouthWest().lat, -74, 74);
|
|
740
741
|
return new BMap.Bounds(new BMap.Point(t, s), new BMap.Point(e, r));
|
|
741
|
-
},
|
|
742
|
+
}, ge = function(i, e, t) {
|
|
742
743
|
return e && (i = Math.max(i, e)), t && (i = Math.min(i, t)), i;
|
|
743
|
-
},
|
|
744
|
+
}, Pt = function(i) {
|
|
744
745
|
return Object.prototype.toString.call(i) === "[object Array]";
|
|
745
|
-
},
|
|
746
|
+
}, It = function(i, e) {
|
|
746
747
|
var t = -1;
|
|
747
|
-
if (
|
|
748
|
+
if (Pt(e)) {
|
|
748
749
|
if (e.indexOf)
|
|
749
750
|
t = e.indexOf(i);
|
|
750
751
|
else
|
|
@@ -772,7 +773,7 @@ var xt = function(i, e, t) {
|
|
|
772
773
|
r._redraw();
|
|
773
774
|
});
|
|
774
775
|
var s = t.markers;
|
|
775
|
-
|
|
776
|
+
Pt(s) && this.addMarkers(s);
|
|
776
777
|
}
|
|
777
778
|
};
|
|
778
779
|
_.prototype.addMarkers = function(i) {
|
|
@@ -783,7 +784,7 @@ _.prototype.addMarkers = function(i) {
|
|
|
783
784
|
}
|
|
784
785
|
};
|
|
785
786
|
_.prototype._pushMarkerTo = function(i) {
|
|
786
|
-
var e =
|
|
787
|
+
var e = It(i, this._markers);
|
|
787
788
|
e === -1 && (i.isInCluster = !1, this._markers.push(i));
|
|
788
789
|
};
|
|
789
790
|
_.prototype.addMarker = function(i) {
|
|
@@ -792,7 +793,7 @@ _.prototype.addMarker = function(i) {
|
|
|
792
793
|
_.prototype._createClusters = function() {
|
|
793
794
|
var i = this._map.getBounds();
|
|
794
795
|
if (i.getCenter()) {
|
|
795
|
-
for (var e =
|
|
796
|
+
for (var e = kt(this._map, i, this._gridSize), t = 0, r; r = this._markers[t]; t++)
|
|
796
797
|
!r.isInCluster && e.containsPoint(r.getPosition()) && this._addToClosestCluster(r);
|
|
797
798
|
for (var s = this._markers.length, t = 0; t < s; t++)
|
|
798
799
|
this._clusters[t] && this._clusters[t].render();
|
|
@@ -832,7 +833,7 @@ _.prototype._removeMarkersFromMap = function() {
|
|
|
832
833
|
}
|
|
833
834
|
};
|
|
834
835
|
_.prototype._removeMarker = function(i) {
|
|
835
|
-
var e =
|
|
836
|
+
var e = It(i, this._markers);
|
|
836
837
|
return e === -1 ? !1 : (this._map.removeOverlay(i), this._markers.splice(e, 1), !0);
|
|
837
838
|
};
|
|
838
839
|
_.prototype.removeMarker = function(i) {
|
|
@@ -908,7 +909,7 @@ _.prototype.setStylesIndexCalculator = function(i) {
|
|
|
908
909
|
};
|
|
909
910
|
function L(i) {
|
|
910
911
|
var e = this;
|
|
911
|
-
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
|
|
912
|
+
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 ft(this._center, this._markers.length, {
|
|
912
913
|
styles: this._markerClusterer.getStyles(),
|
|
913
914
|
zIndex: i._zIndex
|
|
914
915
|
}), this._clusterMarker.getStyleByText = function(t, r) {
|
|
@@ -916,7 +917,7 @@ function L(i) {
|
|
|
916
917
|
var s = e._markerClusterer._stylesIndexCalculator(e._markers, r.length);
|
|
917
918
|
return r[s];
|
|
918
919
|
}
|
|
919
|
-
return
|
|
920
|
+
return ft.prototype.getStyleByText.call(this, t, r);
|
|
920
921
|
}, this._clusterMarker.addEventListener && this._clusterMarker.addEventListener("click", function(t) {
|
|
921
922
|
e._map.setViewport(e.getBounds());
|
|
922
923
|
});
|
|
@@ -956,7 +957,7 @@ L.prototype.isReal = function(i) {
|
|
|
956
957
|
};
|
|
957
958
|
L.prototype.updateGridBounds = function() {
|
|
958
959
|
var i = new BMap.Bounds(this._center, this._center);
|
|
959
|
-
this._gridBounds =
|
|
960
|
+
this._gridBounds = kt(this._map, i, this._markerClusterer.getGridSize());
|
|
960
961
|
};
|
|
961
962
|
L.prototype.updateClusterMarker = function() {
|
|
962
963
|
if (this._map.getZoom() > this._markerClusterer.getMaxZoom()) {
|
|
@@ -986,9 +987,9 @@ L.prototype.getBounds = function() {
|
|
|
986
987
|
L.prototype.getCenter = function() {
|
|
987
988
|
return this._center;
|
|
988
989
|
};
|
|
989
|
-
let
|
|
990
|
+
let _r = class Lt {
|
|
990
991
|
constructor(e, t, r) {
|
|
991
|
-
this.extend(
|
|
992
|
+
this.extend(Lt, 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;
|
|
992
993
|
var s = r || {};
|
|
993
994
|
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();
|
|
994
995
|
var n = this;
|
|
@@ -1407,7 +1408,7 @@ let yr = class It {
|
|
|
1407
1408
|
if (r && r.isMarkerInClusterBounds(e))
|
|
1408
1409
|
r.addMarker(e);
|
|
1409
1410
|
else {
|
|
1410
|
-
var o = new
|
|
1411
|
+
var o = new Mr(this);
|
|
1411
1412
|
o.addMarker(e), this.clusters_.push(o);
|
|
1412
1413
|
}
|
|
1413
1414
|
}
|
|
@@ -1425,9 +1426,9 @@ let yr = class It {
|
|
|
1425
1426
|
!s.isAdded && this.isMarkerInBounds_(s, t) && this.addToClosestCluster_(s);
|
|
1426
1427
|
}
|
|
1427
1428
|
};
|
|
1428
|
-
class
|
|
1429
|
+
class Mr {
|
|
1429
1430
|
constructor(e) {
|
|
1430
|
-
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
|
|
1431
|
+
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 Ge(
|
|
1431
1432
|
this,
|
|
1432
1433
|
e.getStyles(),
|
|
1433
1434
|
e.getGridSize()
|
|
@@ -1561,9 +1562,9 @@ class vr {
|
|
|
1561
1562
|
this.clusterIcon_.setCenter(this.center_), this.clusterIcon_.setSums(a), this.clusterIcon_.show();
|
|
1562
1563
|
}
|
|
1563
1564
|
}
|
|
1564
|
-
class
|
|
1565
|
+
class Ge {
|
|
1565
1566
|
constructor(e, t, r) {
|
|
1566
|
-
e.getMarkerClusterer().extend(
|
|
1567
|
+
e.getMarkerClusterer().extend(Ge, 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_);
|
|
1567
1568
|
}
|
|
1568
1569
|
/**
|
|
1569
1570
|
* Triggers the clusterclick event and zoom's if the option is set.
|
|
@@ -1694,7 +1695,7 @@ class De {
|
|
|
1694
1695
|
), t.join("");
|
|
1695
1696
|
}
|
|
1696
1697
|
}
|
|
1697
|
-
var
|
|
1698
|
+
var Me;
|
|
1698
1699
|
((i) => {
|
|
1699
1700
|
function e(r) {
|
|
1700
1701
|
return {
|
|
@@ -1719,8 +1720,8 @@ var _e;
|
|
|
1719
1720
|
};
|
|
1720
1721
|
}
|
|
1721
1722
|
i.toGoogle = t;
|
|
1722
|
-
})(
|
|
1723
|
-
class
|
|
1723
|
+
})(Me || (Me = {}));
|
|
1724
|
+
class Bt {
|
|
1724
1725
|
constructor(e) {
|
|
1725
1726
|
h(this, "inner");
|
|
1726
1727
|
this.map = e;
|
|
@@ -1746,7 +1747,7 @@ class Pt {
|
|
|
1746
1747
|
return this.inner.removeMarkers(e.map((t) => t.innerOverlay));
|
|
1747
1748
|
}
|
|
1748
1749
|
}
|
|
1749
|
-
class
|
|
1750
|
+
class br extends Bt {
|
|
1750
1751
|
constructor(e, t) {
|
|
1751
1752
|
var s;
|
|
1752
1753
|
super(e), this.inner = new _(e.innerMap, {
|
|
@@ -1756,7 +1757,7 @@ class _r extends Pt {
|
|
|
1756
1757
|
maxZoom: t.maxZoom,
|
|
1757
1758
|
minClusterSize: t.minClusterSize,
|
|
1758
1759
|
isAverageCenter: t.averageCenter,
|
|
1759
|
-
styles: (s = t.styles) == null ? void 0 : s.map((n) =>
|
|
1760
|
+
styles: (s = t.styles) == null ? void 0 : s.map((n) => Me.toBaidu(n)),
|
|
1760
1761
|
zIndex: t.zIndex
|
|
1761
1762
|
});
|
|
1762
1763
|
const r = t.stylesIndexCalculator;
|
|
@@ -1766,10 +1767,10 @@ class _r extends Pt {
|
|
|
1766
1767
|
this.inner._redraw();
|
|
1767
1768
|
}
|
|
1768
1769
|
}
|
|
1769
|
-
class
|
|
1770
|
+
class Tr extends Bt {
|
|
1770
1771
|
constructor(e, t) {
|
|
1771
1772
|
var s, n;
|
|
1772
|
-
super(e), this.inner = new
|
|
1773
|
+
super(e), this.inner = new _r(
|
|
1773
1774
|
e.innerMap,
|
|
1774
1775
|
// google的构造器中的markers,不会触发重绘, 第一次绘制通过监听地图的'idle'事件触发, 可以直接设置
|
|
1775
1776
|
(s = t.markers) == null ? void 0 : s.map((a) => a.innerOverlay),
|
|
@@ -1778,7 +1779,7 @@ class Mr extends Pt {
|
|
|
1778
1779
|
maxZoom: t.maxZoom,
|
|
1779
1780
|
minimumClusterSize: t.minClusterSize,
|
|
1780
1781
|
averageCenter: t.averageCenter,
|
|
1781
|
-
styles: (n = t.styles) == null ? void 0 : n.map((a) =>
|
|
1782
|
+
styles: (n = t.styles) == null ? void 0 : n.map((a) => Me.toGoogle(a)),
|
|
1782
1783
|
zIndex: t.zIndex
|
|
1783
1784
|
}
|
|
1784
1785
|
);
|
|
@@ -1793,7 +1794,7 @@ class Mr extends Pt {
|
|
|
1793
1794
|
this.inner.repaint();
|
|
1794
1795
|
}
|
|
1795
1796
|
}
|
|
1796
|
-
var
|
|
1797
|
+
var be;
|
|
1797
1798
|
((i) => {
|
|
1798
1799
|
function e(r, s) {
|
|
1799
1800
|
const n = r.indexOf(s);
|
|
@@ -1807,8 +1808,8 @@ var Me;
|
|
|
1807
1808
|
return n;
|
|
1808
1809
|
}
|
|
1809
1810
|
i.findByType = t;
|
|
1810
|
-
})(
|
|
1811
|
-
var
|
|
1811
|
+
})(be || (be = {}));
|
|
1812
|
+
var Te;
|
|
1812
1813
|
((i) => {
|
|
1813
1814
|
function e(r, s) {
|
|
1814
1815
|
const n = r.getLength();
|
|
@@ -1824,8 +1825,8 @@ var be;
|
|
|
1824
1825
|
return r.removeAt(n);
|
|
1825
1826
|
}
|
|
1826
1827
|
i.remove = t;
|
|
1827
|
-
})(
|
|
1828
|
-
class
|
|
1828
|
+
})(Te || (Te = {}));
|
|
1829
|
+
class St {
|
|
1829
1830
|
constructor(e, t) {
|
|
1830
1831
|
h(this, "eventMap", /* @__PURE__ */ new Map());
|
|
1831
1832
|
h(this, "target", void 0);
|
|
@@ -1835,14 +1836,14 @@ class Lt {
|
|
|
1835
1836
|
return this.target = e, this;
|
|
1836
1837
|
}
|
|
1837
1838
|
}
|
|
1838
|
-
const
|
|
1839
|
+
const pt = class extends St {
|
|
1839
1840
|
addEventListener(e, t) {
|
|
1840
|
-
const r =
|
|
1841
|
+
const r = ye(e, t);
|
|
1841
1842
|
if (this.eventMap.get(r)) {
|
|
1842
1843
|
console.warn("listener已经添加过了", r, t);
|
|
1843
1844
|
return;
|
|
1844
1845
|
}
|
|
1845
|
-
const s = this.inner.addListener(
|
|
1846
|
+
const s = this.inner.addListener(pt.EVENT_TYPE_MAP[e] || e, (n) => {
|
|
1846
1847
|
const a = {
|
|
1847
1848
|
type: e,
|
|
1848
1849
|
target: this.target,
|
|
@@ -1853,13 +1854,13 @@ const ct = class extends Lt {
|
|
|
1853
1854
|
this.eventMap.set(r, s);
|
|
1854
1855
|
}
|
|
1855
1856
|
removeEventListener(e, t) {
|
|
1856
|
-
const r =
|
|
1857
|
+
const r = ye(e, t), s = this.eventMap.get(r);
|
|
1857
1858
|
s ? (s.remove(), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, t);
|
|
1858
1859
|
}
|
|
1859
1860
|
};
|
|
1860
|
-
let
|
|
1861
|
+
let X = pt;
|
|
1861
1862
|
// 事件类型映射: tg => google
|
|
1862
|
-
h(
|
|
1863
|
+
h(X, "EVENT_TYPE_MAP", {
|
|
1863
1864
|
"center-changed": "center_changed",
|
|
1864
1865
|
"zoom-changed": "zoom_changed",
|
|
1865
1866
|
"map-type-changed": "maptypeid_changed",
|
|
@@ -1870,9 +1871,9 @@ h(q, "EVENT_TYPE_MAP", {
|
|
|
1870
1871
|
"map-mouseup": "mouseup",
|
|
1871
1872
|
"map-dblclick": "dblclick"
|
|
1872
1873
|
});
|
|
1873
|
-
const
|
|
1874
|
+
const Oe = class extends St {
|
|
1874
1875
|
addEventListener(e, t) {
|
|
1875
|
-
const r =
|
|
1876
|
+
const r = ye(e, t);
|
|
1876
1877
|
if (this.eventMap.get(r)) {
|
|
1877
1878
|
console.warn("listener已经添加过了", r, t);
|
|
1878
1879
|
return;
|
|
@@ -1885,23 +1886,23 @@ const Te = class extends Lt {
|
|
|
1885
1886
|
};
|
|
1886
1887
|
n.point && (a.position = y.fromBaidu(n.point, this.coordTypeSupplier.coordType)), t.call(this.target, a);
|
|
1887
1888
|
};
|
|
1888
|
-
this.inner.addEventListener(
|
|
1889
|
+
this.inner.addEventListener(Oe.EVENT_TYPE_MAP[e] || e, s), this.eventMap.set(r, s);
|
|
1889
1890
|
}
|
|
1890
1891
|
removeEventListener(e, t) {
|
|
1891
|
-
const r =
|
|
1892
|
-
s ? (this.inner.removeEventListener(
|
|
1892
|
+
const r = ye(e, t), s = this.eventMap.get(r);
|
|
1893
|
+
s ? (this.inner.removeEventListener(Oe.EVENT_TYPE_MAP[e] || e, s), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, t);
|
|
1893
1894
|
}
|
|
1894
1895
|
};
|
|
1895
|
-
let
|
|
1896
|
+
let Q = Oe;
|
|
1896
1897
|
// cSpell:words clickclose
|
|
1897
1898
|
// 事件类型映射, tg => baidu
|
|
1898
|
-
h(
|
|
1899
|
+
h(Q, "EVENT_TYPE_MAP", {
|
|
1899
1900
|
drag: "dragging",
|
|
1900
1901
|
closeclick: "clickclose",
|
|
1901
1902
|
"zoom-changed": "zoomend",
|
|
1902
1903
|
"map-type-changed": "maptypechange"
|
|
1903
1904
|
});
|
|
1904
|
-
class
|
|
1905
|
+
class Or {
|
|
1905
1906
|
constructor() {
|
|
1906
1907
|
h(this, "typeMap", /* @__PURE__ */ new Map());
|
|
1907
1908
|
}
|
|
@@ -1911,7 +1912,7 @@ class br {
|
|
|
1911
1912
|
}
|
|
1912
1913
|
removeEventListener(e, t) {
|
|
1913
1914
|
const r = this.typeMap.get(e);
|
|
1914
|
-
r &&
|
|
1915
|
+
r && be.remove(r, t);
|
|
1915
1916
|
}
|
|
1916
1917
|
hasListener(e) {
|
|
1917
1918
|
const t = this.typeMap.get(e);
|
|
@@ -1922,7 +1923,7 @@ class br {
|
|
|
1922
1923
|
t && t.forEach((r) => r.call(e.target, e));
|
|
1923
1924
|
}
|
|
1924
1925
|
}
|
|
1925
|
-
class
|
|
1926
|
+
class $t {
|
|
1926
1927
|
constructor(e, t, r, s) {
|
|
1927
1928
|
h(this, "addEventListener");
|
|
1928
1929
|
h(this, "removeEventListener");
|
|
@@ -1932,9 +1933,9 @@ class Bt {
|
|
|
1932
1933
|
this.map.removeOverlay(this);
|
|
1933
1934
|
}
|
|
1934
1935
|
}
|
|
1935
|
-
class
|
|
1936
|
+
class je extends $t {
|
|
1936
1937
|
constructor(e, t, r) {
|
|
1937
|
-
super(e, t, r, new
|
|
1938
|
+
super(e, t, r, new X(e, r));
|
|
1938
1939
|
}
|
|
1939
1940
|
isVisible() {
|
|
1940
1941
|
return this.innerOverlay.getVisible();
|
|
@@ -1943,9 +1944,9 @@ class Ze extends Bt {
|
|
|
1943
1944
|
this.innerOverlay.setVisible(e);
|
|
1944
1945
|
}
|
|
1945
1946
|
}
|
|
1946
|
-
class
|
|
1947
|
+
class Ce extends $t {
|
|
1947
1948
|
constructor(e, t, r) {
|
|
1948
|
-
super(e, t, r, new
|
|
1949
|
+
super(e, t, r, new Q(e, r));
|
|
1949
1950
|
}
|
|
1950
1951
|
/** 仅限内部使用; 设为private时, 生成的d.ts文件中, 方法返回值会变成any, 故改成了public */
|
|
1951
1952
|
get overlay() {
|
|
@@ -1962,7 +1963,7 @@ class Oe extends Bt {
|
|
|
1962
1963
|
return e !== void 0 && (e || this.setVisible(!1)), this;
|
|
1963
1964
|
}
|
|
1964
1965
|
}
|
|
1965
|
-
class
|
|
1966
|
+
class We extends Ce {
|
|
1966
1967
|
constructor(e, t, r, s) {
|
|
1967
1968
|
super(e, t, r), this.state = s;
|
|
1968
1969
|
}
|
|
@@ -1988,7 +1989,7 @@ class Ge extends Oe {
|
|
|
1988
1989
|
this.innerOverlay.setFillOpacity(e);
|
|
1989
1990
|
}
|
|
1990
1991
|
}
|
|
1991
|
-
class
|
|
1992
|
+
class Ve extends je {
|
|
1992
1993
|
isEditable() {
|
|
1993
1994
|
return this.innerOverlay.getEditable();
|
|
1994
1995
|
}
|
|
@@ -2011,7 +2012,7 @@ class je extends Ze {
|
|
|
2011
2012
|
this.innerOverlay.setOptions({ fillOpacity: e });
|
|
2012
2013
|
}
|
|
2013
2014
|
}
|
|
2014
|
-
class
|
|
2015
|
+
class He extends We {
|
|
2015
2016
|
static create(e) {
|
|
2016
2017
|
const t = this.coordType, r = new BMap.Polyline(e.path.map((s) => s.toBaidu(t)), {
|
|
2017
2018
|
enableClicking: e.clickable,
|
|
@@ -2020,7 +2021,7 @@ class We extends Ge {
|
|
|
2020
2021
|
strokeOpacity: e.strokeOpacity,
|
|
2021
2022
|
strokeWeight: e.strokeWeight
|
|
2022
2023
|
});
|
|
2023
|
-
return new
|
|
2024
|
+
return new He(r, t, this, { editable: e.editable === !0 }).visibleOptionInternal(e.visible);
|
|
2024
2025
|
}
|
|
2025
2026
|
getPath() {
|
|
2026
2027
|
return this.innerOverlay.getPath().map((e) => y.fromBaidu(e, this.coordType));
|
|
@@ -2029,7 +2030,7 @@ class We extends Ge {
|
|
|
2029
2030
|
this.coordType = this.map.coordType, this.innerOverlay.setPath(e.map((t) => t.toBaidu(this.coordType)));
|
|
2030
2031
|
}
|
|
2031
2032
|
}
|
|
2032
|
-
class
|
|
2033
|
+
class Fe extends Ve {
|
|
2033
2034
|
static create(e) {
|
|
2034
2035
|
const t = this.coordType, r = new google.maps.Polyline({
|
|
2035
2036
|
path: e.path.map((s) => s.toGoogle(t)),
|
|
@@ -2040,7 +2041,7 @@ class Ve extends je {
|
|
|
2040
2041
|
strokeWeight: e.strokeWeight,
|
|
2041
2042
|
visible: e.visible
|
|
2042
2043
|
});
|
|
2043
|
-
return new
|
|
2044
|
+
return new Fe(r, t, this);
|
|
2044
2045
|
}
|
|
2045
2046
|
getPath() {
|
|
2046
2047
|
const e = [];
|
|
@@ -2052,7 +2053,7 @@ class Ve extends je {
|
|
|
2052
2053
|
this.coordType = this.map.coordType, this.innerOverlay.setPath(e.map((t) => t.toGoogle(this.coordType)));
|
|
2053
2054
|
}
|
|
2054
2055
|
}
|
|
2055
|
-
class
|
|
2056
|
+
class Ue extends We {
|
|
2056
2057
|
static create(e) {
|
|
2057
2058
|
const t = this.coordType;
|
|
2058
2059
|
e.paths.length > 1 && console.warn("baidu不支持多path, 只会显示paths[0]");
|
|
@@ -2065,7 +2066,7 @@ class He extends Ge {
|
|
|
2065
2066
|
fillColor: e.fillColor,
|
|
2066
2067
|
fillOpacity: e.fillOpacity
|
|
2067
2068
|
});
|
|
2068
|
-
return new
|
|
2069
|
+
return new Ue(s, t, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
2069
2070
|
}
|
|
2070
2071
|
getPaths() {
|
|
2071
2072
|
return [this.innerOverlay.getPath().map((e) => y.fromBaidu(e, this.coordType))];
|
|
@@ -2074,7 +2075,7 @@ class He extends Ge {
|
|
|
2074
2075
|
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)));
|
|
2075
2076
|
}
|
|
2076
2077
|
}
|
|
2077
|
-
class
|
|
2078
|
+
class Ye extends Ve {
|
|
2078
2079
|
static create(e) {
|
|
2079
2080
|
const t = this.coordType, r = new google.maps.Polygon({
|
|
2080
2081
|
paths: e.paths.map((s) => s.map((n) => n.toGoogle(t))),
|
|
@@ -2087,7 +2088,7 @@ class Fe extends je {
|
|
|
2087
2088
|
fillOpacity: e.fillOpacity,
|
|
2088
2089
|
visible: e.visible
|
|
2089
2090
|
});
|
|
2090
|
-
return new
|
|
2091
|
+
return new Ye(r, t, this);
|
|
2091
2092
|
}
|
|
2092
2093
|
getPaths() {
|
|
2093
2094
|
const e = this.innerOverlay.getPaths(), t = [];
|
|
@@ -2102,7 +2103,7 @@ class Fe extends je {
|
|
|
2102
2103
|
this.coordType = this.map.coordType, this.innerOverlay.setPaths(e.map((t) => t.map((r) => r.toGoogle(this.coordType))));
|
|
2103
2104
|
}
|
|
2104
2105
|
}
|
|
2105
|
-
class
|
|
2106
|
+
class Ke extends We {
|
|
2106
2107
|
static create(e) {
|
|
2107
2108
|
const t = this.coordType, r = new BMap.Circle(e.center.toBaidu(t), e.radius, {
|
|
2108
2109
|
enableClicking: e.clickable,
|
|
@@ -2113,7 +2114,7 @@ class Ue extends Ge {
|
|
|
2113
2114
|
fillColor: e.fillColor,
|
|
2114
2115
|
fillOpacity: e.fillOpacity
|
|
2115
2116
|
});
|
|
2116
|
-
return new
|
|
2117
|
+
return new Ke(r, t, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
2117
2118
|
}
|
|
2118
2119
|
setCenter(e) {
|
|
2119
2120
|
this.coordType = this.map.coordType, this.innerOverlay.setCenter(e.toBaidu(this.coordType));
|
|
@@ -2128,7 +2129,7 @@ class Ue extends Ge {
|
|
|
2128
2129
|
return this.innerOverlay.getRadius();
|
|
2129
2130
|
}
|
|
2130
2131
|
}
|
|
2131
|
-
class
|
|
2132
|
+
class qe extends Ve {
|
|
2132
2133
|
static create(e) {
|
|
2133
2134
|
const t = this.coordType, r = new google.maps.Circle({
|
|
2134
2135
|
center: e.center.toGoogle(t),
|
|
@@ -2142,7 +2143,7 @@ class Ye extends je {
|
|
|
2142
2143
|
fillOpacity: e.fillOpacity,
|
|
2143
2144
|
visible: e.visible
|
|
2144
2145
|
});
|
|
2145
|
-
return new
|
|
2146
|
+
return new qe(r, t, this);
|
|
2146
2147
|
}
|
|
2147
2148
|
setCenter(e) {
|
|
2148
2149
|
this.coordType = this.map.coordType, this.innerOverlay.setCenter(e.toGoogle(this.coordType));
|
|
@@ -2157,14 +2158,14 @@ class Ye extends je {
|
|
|
2157
2158
|
return this.innerOverlay.getRadius();
|
|
2158
2159
|
}
|
|
2159
2160
|
}
|
|
2160
|
-
class
|
|
2161
|
+
class yt {
|
|
2161
2162
|
/**
|
|
2162
2163
|
* `keys`和`values`数组中可以有相同的值, 若存在相同值, 则index越小的优先级越高
|
|
2163
2164
|
*/
|
|
2164
2165
|
constructor(e, t) {
|
|
2165
2166
|
h(this, "keyToValue", /* @__PURE__ */ new Map());
|
|
2166
2167
|
h(this, "valueToKey", /* @__PURE__ */ new Map());
|
|
2167
|
-
|
|
2168
|
+
ae(e.length === t.length);
|
|
2168
2169
|
for (let r = e.length - 1; r >= 0; r--)
|
|
2169
2170
|
this.keyToValue.set(e[r], t[r]), this.valueToKey.set(t[r], e[r]);
|
|
2170
2171
|
}
|
|
@@ -2175,7 +2176,7 @@ class ft {
|
|
|
2175
2176
|
return this.keyToValue.get(e) ?? x();
|
|
2176
2177
|
}
|
|
2177
2178
|
}
|
|
2178
|
-
class
|
|
2179
|
+
class Cr {
|
|
2179
2180
|
constructor(e, t = 10) {
|
|
2180
2181
|
h(this, "map", /* @__PURE__ */ new Map());
|
|
2181
2182
|
this.values = e, this.maxSize4Debug = t;
|
|
@@ -2204,7 +2205,7 @@ class Tr {
|
|
|
2204
2205
|
return this.getOrNull(e, t) ?? x(`key(${t})不存在与valueMap(${this.getValueMap(e)})中`);
|
|
2205
2206
|
}
|
|
2206
2207
|
}
|
|
2207
|
-
class
|
|
2208
|
+
class vt {
|
|
2208
2209
|
constructor(e) {
|
|
2209
2210
|
h(this, "value");
|
|
2210
2211
|
this.creator = e;
|
|
@@ -2213,7 +2214,7 @@ class yt {
|
|
|
2213
2214
|
return this.value === void 0 && (this.value = this.creator()), this.value;
|
|
2214
2215
|
}
|
|
2215
2216
|
}
|
|
2216
|
-
var E = /* @__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))(E || {}),
|
|
2217
|
+
var E = /* @__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))(E || {}), I;
|
|
2217
2218
|
((i) => {
|
|
2218
2219
|
let e, t;
|
|
2219
2220
|
const r = [
|
|
@@ -2232,7 +2233,7 @@ var E = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
2232
2233
|
/* RIGHT_BOTTOM */
|
|
2233
2234
|
];
|
|
2234
2235
|
function s() {
|
|
2235
|
-
return e || (e = new
|
|
2236
|
+
return e || (e = new yt(r, [
|
|
2236
2237
|
/* | @tg/map |名字相同| baidu | */
|
|
2237
2238
|
/* TOP_LEFT = */
|
|
2238
2239
|
BMAP_ANCHOR_TOP_LEFT,
|
|
@@ -2262,7 +2263,7 @@ var E = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
2262
2263
|
}
|
|
2263
2264
|
i.getBaidu = s;
|
|
2264
2265
|
function n() {
|
|
2265
|
-
return t || (t = new
|
|
2266
|
+
return t || (t = new yt(r, [
|
|
2266
2267
|
google.maps.ControlPosition.TOP_LEFT,
|
|
2267
2268
|
google.maps.ControlPosition.TOP_CENTER,
|
|
2268
2269
|
google.maps.ControlPosition.TOP_RIGHT,
|
|
@@ -2278,17 +2279,17 @@ var E = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
2278
2279
|
])), t;
|
|
2279
2280
|
}
|
|
2280
2281
|
i.getGoogle = n;
|
|
2281
|
-
})(
|
|
2282
|
-
class
|
|
2282
|
+
})(I || (I = {}));
|
|
2283
|
+
class wr {
|
|
2283
2284
|
constructor(e) {
|
|
2284
2285
|
/** 实际添加到地图中的control对象 */
|
|
2285
2286
|
h(this, "inner");
|
|
2286
2287
|
this.position = e;
|
|
2287
2288
|
}
|
|
2288
2289
|
}
|
|
2289
|
-
class
|
|
2290
|
+
class At {
|
|
2290
2291
|
}
|
|
2291
|
-
class
|
|
2292
|
+
class Xe extends At {
|
|
2292
2293
|
constructor(e, t) {
|
|
2293
2294
|
super(), this.inner = e, this.position = t;
|
|
2294
2295
|
}
|
|
@@ -2299,10 +2300,10 @@ class Ke extends St {
|
|
|
2299
2300
|
e ? this.inner.show() : this.inner.hide();
|
|
2300
2301
|
}
|
|
2301
2302
|
getPosition() {
|
|
2302
|
-
return this.position ??
|
|
2303
|
+
return this.position ?? I.getBaidu().toKey(this.inner.getAnchor());
|
|
2303
2304
|
}
|
|
2304
2305
|
setPosition(e) {
|
|
2305
|
-
this.position = e, this.inner.setAnchor(
|
|
2306
|
+
this.position = e, this.inner.setAnchor(I.getBaidu().toValue(e));
|
|
2306
2307
|
}
|
|
2307
2308
|
addTo(e) {
|
|
2308
2309
|
e.innerMap.addControl(this.inner);
|
|
@@ -2311,7 +2312,7 @@ class Ke extends St {
|
|
|
2311
2312
|
e.innerMap.removeControl(this.inner);
|
|
2312
2313
|
}
|
|
2313
2314
|
}
|
|
2314
|
-
class
|
|
2315
|
+
class Je extends At {
|
|
2315
2316
|
constructor(t, r) {
|
|
2316
2317
|
super();
|
|
2317
2318
|
h(this, "visible", !1);
|
|
@@ -2338,7 +2339,7 @@ class qe extends St {
|
|
|
2338
2339
|
}
|
|
2339
2340
|
onCreateOptions() {
|
|
2340
2341
|
return {
|
|
2341
|
-
position:
|
|
2342
|
+
position: I.getGoogle().toValue(this.position)
|
|
2342
2343
|
};
|
|
2343
2344
|
}
|
|
2344
2345
|
tryUpdateOptions() {
|
|
@@ -2348,7 +2349,7 @@ class qe extends St {
|
|
|
2348
2349
|
});
|
|
2349
2350
|
}
|
|
2350
2351
|
}
|
|
2351
|
-
var
|
|
2352
|
+
var zt = /* @__PURE__ */ ((i) => (i.normal = "normal", i.satellite = "satellite", i.hybrid = "hybrid", i))(zt || {});
|
|
2352
2353
|
class k {
|
|
2353
2354
|
constructor(e, t, r, s) {
|
|
2354
2355
|
this.id = e, this.baidu = t, this.google = r, this.googleCoordType = s;
|
|
@@ -2357,7 +2358,7 @@ class k {
|
|
|
2357
2358
|
return this.id;
|
|
2358
2359
|
}
|
|
2359
2360
|
getBaiduCoordType() {
|
|
2360
|
-
return
|
|
2361
|
+
return q.bd09;
|
|
2361
2362
|
}
|
|
2362
2363
|
asBaiduMapType() {
|
|
2363
2364
|
return this.baidu();
|
|
@@ -2370,13 +2371,13 @@ class k {
|
|
|
2370
2371
|
return this.google();
|
|
2371
2372
|
}
|
|
2372
2373
|
asGoogleMapType() {
|
|
2373
|
-
|
|
2374
|
+
Qt("google的内置地图没有对应的实例");
|
|
2374
2375
|
}
|
|
2375
2376
|
}
|
|
2376
|
-
class
|
|
2377
|
+
class xr {
|
|
2377
2378
|
constructor() {
|
|
2378
|
-
h(this, "baiduCache", new
|
|
2379
|
-
h(this, "googleCache", new
|
|
2379
|
+
h(this, "baiduCache", new vt(() => new BMap.TrafficLayer()));
|
|
2380
|
+
h(this, "googleCache", new vt(() => new google.maps.TrafficLayer()));
|
|
2380
2381
|
}
|
|
2381
2382
|
asBaiduLayer() {
|
|
2382
2383
|
return this.baiduCache.get();
|
|
@@ -2385,21 +2386,21 @@ class Cr {
|
|
|
2385
2386
|
return this.googleCache.get();
|
|
2386
2387
|
}
|
|
2387
2388
|
}
|
|
2388
|
-
var
|
|
2389
|
+
var P;
|
|
2389
2390
|
((i) => {
|
|
2390
|
-
i.NORMAL = new k("normal", () => BMAP_NORMAL_MAP, () => google.maps.MapTypeId.ROADMAP,
|
|
2391
|
+
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", () => (
|
|
2391
2392
|
/* 三维 */
|
|
2392
2393
|
BMAP_PERSPECTIVE_MAP
|
|
2393
2394
|
), () => (
|
|
2394
2395
|
/* 地形 */
|
|
2395
2396
|
google.maps.MapTypeId.TERRAIN
|
|
2396
|
-
),
|
|
2397
|
-
})(
|
|
2398
|
-
var
|
|
2399
|
-
const
|
|
2400
|
-
class
|
|
2397
|
+
), q.wgs84), i.BUILD_IN_MAP_TYPES = new Cr([i.NORMAL, i.SATELLITE, i.HYBRID, i.TERRAIN]);
|
|
2398
|
+
})(P || (P = {}));
|
|
2399
|
+
var Nt = /* @__PURE__ */ ((i) => (i.DEFAULT = "default", i.HORIZONTAL = "horizontal", i.DROPDOWN = "dropdown", i))(Nt || {});
|
|
2400
|
+
const Rt = [P.NORMAL, P.SATELLITE, P.HYBRID];
|
|
2401
|
+
class Qe extends Xe {
|
|
2401
2402
|
static create(e) {
|
|
2402
|
-
const t = e.mapTypes ??
|
|
2403
|
+
const t = e.mapTypes ?? Rt, r = {
|
|
2403
2404
|
default: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
2404
2405
|
horizontal: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
2405
2406
|
dropdown: BMAP_MAPTYPE_CONTROL_DROPDOWN
|
|
@@ -2407,23 +2408,23 @@ class Xe extends Ke {
|
|
|
2407
2408
|
type: e.type && r[e.type],
|
|
2408
2409
|
mapTypes: t.map((n) => n.asBaiduMapType())
|
|
2409
2410
|
});
|
|
2410
|
-
return e.position && s.setAnchor(
|
|
2411
|
+
return e.position && s.setAnchor(I.getBaidu().toValue(e.position)), new Qe(s, e.position);
|
|
2411
2412
|
}
|
|
2412
2413
|
}
|
|
2413
|
-
const
|
|
2414
|
-
constructor(e = "default", t = E.TOP_LEFT, r =
|
|
2415
|
-
super("mapType", t), this.type = e, this.mapTypes = r,
|
|
2414
|
+
const J = class extends Je {
|
|
2415
|
+
constructor(e = "default", t = E.TOP_LEFT, r = Rt) {
|
|
2416
|
+
super("mapType", t), this.type = e, this.mapTypes = r, J.type2google || (J.type2google = {
|
|
2416
2417
|
default: google.maps.MapTypeControlStyle.DEFAULT,
|
|
2417
2418
|
horizontal: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
|
|
2418
2419
|
dropdown: google.maps.MapTypeControlStyle.DROPDOWN_MENU
|
|
2419
2420
|
});
|
|
2420
2421
|
}
|
|
2421
2422
|
static create(e) {
|
|
2422
|
-
return new
|
|
2423
|
+
return new J(e.type, e.position, e.mapTypes);
|
|
2423
2424
|
}
|
|
2424
2425
|
onCreateOptions() {
|
|
2425
2426
|
const e = super.onCreateOptions();
|
|
2426
|
-
return e.style =
|
|
2427
|
+
return e.style = J.type2google[this.type], e.mapTypeIds = this.mapTypes.map((t) => t instanceof k ? t.getGoogleMapTypeId() : t.id), e;
|
|
2427
2428
|
}
|
|
2428
2429
|
addTo(e) {
|
|
2429
2430
|
super.addTo(e), this.mapTypes.forEach((t) => {
|
|
@@ -2431,50 +2432,50 @@ const X = class extends qe {
|
|
|
2431
2432
|
});
|
|
2432
2433
|
}
|
|
2433
2434
|
};
|
|
2434
|
-
let
|
|
2435
|
-
h(
|
|
2436
|
-
class
|
|
2435
|
+
let fe = J;
|
|
2436
|
+
h(fe, "type2google");
|
|
2437
|
+
class et extends Xe {
|
|
2437
2438
|
static create(e) {
|
|
2438
2439
|
const t = new BMap.NavigationControl({
|
|
2439
2440
|
type: BMAP_NAVIGATION_CONTROL_ZOOM,
|
|
2440
2441
|
// enableGeolocation: true,
|
|
2441
|
-
anchor: e.position &&
|
|
2442
|
+
anchor: e.position && I.getBaidu().toValue(e.position)
|
|
2442
2443
|
});
|
|
2443
|
-
return new
|
|
2444
|
+
return new et(t, e.position);
|
|
2444
2445
|
}
|
|
2445
2446
|
}
|
|
2446
|
-
class
|
|
2447
|
+
class tt extends Je {
|
|
2447
2448
|
static create(e) {
|
|
2448
|
-
return new
|
|
2449
|
+
return new tt(e.position);
|
|
2449
2450
|
}
|
|
2450
2451
|
constructor(e = E.RIGHT_BOTTOM) {
|
|
2451
2452
|
super("zoom", e);
|
|
2452
2453
|
}
|
|
2453
2454
|
}
|
|
2454
|
-
class
|
|
2455
|
+
class rt extends Xe {
|
|
2455
2456
|
static create(e) {
|
|
2456
2457
|
const t = new BMap.ScaleControl({
|
|
2457
|
-
anchor: e.position &&
|
|
2458
|
+
anchor: e.position && I.getBaidu().toValue(e.position)
|
|
2458
2459
|
});
|
|
2459
|
-
return new
|
|
2460
|
+
return new rt(t, e.position);
|
|
2460
2461
|
}
|
|
2461
2462
|
}
|
|
2462
|
-
class
|
|
2463
|
+
class it extends Je {
|
|
2463
2464
|
static create(e) {
|
|
2464
|
-
return new
|
|
2465
|
+
return new it(e.position);
|
|
2465
2466
|
}
|
|
2466
2467
|
constructor(e = E.BOTTOM_RIGHT) {
|
|
2467
2468
|
super("scale", e);
|
|
2468
2469
|
}
|
|
2469
2470
|
}
|
|
2470
|
-
var
|
|
2471
|
+
var $e;
|
|
2471
2472
|
((i) => {
|
|
2472
2473
|
function e(t) {
|
|
2473
2474
|
return t.scrollWidth > t.clientWidth || t.scrollHeight > t.clientHeight;
|
|
2474
2475
|
}
|
|
2475
2476
|
i.isScrollable = e;
|
|
2476
|
-
})(
|
|
2477
|
-
var
|
|
2477
|
+
})($e || ($e = {}));
|
|
2478
|
+
var te;
|
|
2478
2479
|
((i) => {
|
|
2479
2480
|
function e(r) {
|
|
2480
2481
|
return {
|
|
@@ -2496,15 +2497,15 @@ var ee;
|
|
|
2496
2497
|
});
|
|
2497
2498
|
}
|
|
2498
2499
|
i.toBaidu = t;
|
|
2499
|
-
})(
|
|
2500
|
-
class
|
|
2500
|
+
})(te || (te = {}));
|
|
2501
|
+
class ce extends Ce {
|
|
2501
2502
|
constructor(e, t, r, s) {
|
|
2502
2503
|
super(e, t, r), this.state = s;
|
|
2503
2504
|
}
|
|
2504
2505
|
static create(e) {
|
|
2505
2506
|
const t = this.coordType, r = e.icon, s = {
|
|
2506
2507
|
title: e.title,
|
|
2507
|
-
icon: r &&
|
|
2508
|
+
icon: r && te.toBaidu(r),
|
|
2508
2509
|
enableClicking: e.clickable,
|
|
2509
2510
|
enableDragging: e.draggable,
|
|
2510
2511
|
// baidu的raiseOnDrag属性, 默认为false, 而我们的options.crossOnDrag默认为true, 故这里需要转换下
|
|
@@ -2513,7 +2514,7 @@ class he extends Oe {
|
|
|
2513
2514
|
}, n = new BMap.Marker(e.position.toBaidu(t), s);
|
|
2514
2515
|
e.zIndex !== void 0 && n.setZIndex(e.zIndex);
|
|
2515
2516
|
const a = e.clickable === void 0 ? !0 : e.clickable, g = !!e.draggable;
|
|
2516
|
-
return new
|
|
2517
|
+
return new ce(n, t, this, { clickable: a, draggable: g, zIndex: e.zIndex }).visibleOptionInternal(e.visible);
|
|
2517
2518
|
}
|
|
2518
2519
|
getPosition() {
|
|
2519
2520
|
return y.fromBaidu(this.innerOverlay.getPosition(), this.coordType);
|
|
@@ -2529,7 +2530,7 @@ class he extends Oe {
|
|
|
2529
2530
|
return this.innerOverlay.getTitle();
|
|
2530
2531
|
}
|
|
2531
2532
|
setIcon(e) {
|
|
2532
|
-
const t =
|
|
2533
|
+
const t = te.toBaidu(e);
|
|
2533
2534
|
this.innerOverlay.setIcon(t);
|
|
2534
2535
|
const r = this.getLabel();
|
|
2535
2536
|
r && r.attachIcon(t);
|
|
@@ -2564,7 +2565,7 @@ class he extends Oe {
|
|
|
2564
2565
|
return (e = this.innerOverlay.getLabel()) == null ? void 0 : e.__label__;
|
|
2565
2566
|
}
|
|
2566
2567
|
}
|
|
2567
|
-
class
|
|
2568
|
+
class st extends je {
|
|
2568
2569
|
constructor() {
|
|
2569
2570
|
super(...arguments);
|
|
2570
2571
|
h(this, "label");
|
|
@@ -2578,7 +2579,7 @@ class rt extends Ze {
|
|
|
2578
2579
|
title: t.title,
|
|
2579
2580
|
zIndex: t.zIndex,
|
|
2580
2581
|
visible: t.visible,
|
|
2581
|
-
icon: s &&
|
|
2582
|
+
icon: s && te.toGoogle(s),
|
|
2582
2583
|
clickable: t.clickable,
|
|
2583
2584
|
draggable: t.draggable,
|
|
2584
2585
|
// google的crossOnDrag和我们的crossOnDrag是匹配的, 不需要转换
|
|
@@ -2587,7 +2588,7 @@ class rt extends Ze {
|
|
|
2587
2588
|
// InfoWindow相对marker的position的偏移量, 若不指定, 则偏移到marker的icon的上部中央
|
|
2588
2589
|
anchorPoint: new google.maps.Point(0, 0)
|
|
2589
2590
|
};
|
|
2590
|
-
return new
|
|
2591
|
+
return new st(new google.maps.Marker(n), r, this);
|
|
2591
2592
|
}
|
|
2592
2593
|
getPosition() {
|
|
2593
2594
|
return y.fromGoogle(this.innerOverlay.getPosition(), this.coordType);
|
|
@@ -2602,7 +2603,7 @@ class rt extends Ze {
|
|
|
2602
2603
|
return this.innerOverlay.getTitle() || "";
|
|
2603
2604
|
}
|
|
2604
2605
|
setIcon(t) {
|
|
2605
|
-
this.innerOverlay.setIcon(
|
|
2606
|
+
this.innerOverlay.setIcon(te.toGoogle(t));
|
|
2606
2607
|
}
|
|
2607
2608
|
getIcon() {
|
|
2608
2609
|
return this.innerOverlay.getIcon();
|
|
@@ -2640,7 +2641,7 @@ class rt extends Ze {
|
|
|
2640
2641
|
this.label = void 0, this.labelPositionListener = void 0, this.labelVisibleListener = void 0, this.labelMapChangedListener = void 0;
|
|
2641
2642
|
}
|
|
2642
2643
|
}
|
|
2643
|
-
class
|
|
2644
|
+
class nt {
|
|
2644
2645
|
constructor(e) {
|
|
2645
2646
|
this.delegate = e, this.delegate.setTarget(this);
|
|
2646
2647
|
}
|
|
@@ -2651,9 +2652,9 @@ class it {
|
|
|
2651
2652
|
this.delegate.removeEventListener(e, t);
|
|
2652
2653
|
}
|
|
2653
2654
|
}
|
|
2654
|
-
class
|
|
2655
|
+
class ot extends nt {
|
|
2655
2656
|
constructor(e, t, r) {
|
|
2656
|
-
super(new
|
|
2657
|
+
super(new Q(e, t)), this.inner = e, this.map = t, this.state = r;
|
|
2657
2658
|
}
|
|
2658
2659
|
static create(e) {
|
|
2659
2660
|
const t = e.position || y.ZERO, r = new BMap.InfoWindow(e.content, {
|
|
@@ -2661,7 +2662,7 @@ class st extends it {
|
|
|
2661
2662
|
offset: e.offset && new BMap.Size(e.offset.x, e.offset.y),
|
|
2662
2663
|
enableAutoPan: !e.disableAutoPan
|
|
2663
2664
|
});
|
|
2664
|
-
return new
|
|
2665
|
+
return new ot(r, this, { position: t });
|
|
2665
2666
|
}
|
|
2666
2667
|
isOpen() {
|
|
2667
2668
|
return this.inner.isOpen();
|
|
@@ -2680,10 +2681,10 @@ class st extends it {
|
|
|
2680
2681
|
this.state.position = e, this.inner.isOpen() && this.open();
|
|
2681
2682
|
}
|
|
2682
2683
|
}
|
|
2683
|
-
class
|
|
2684
|
+
class at extends nt {
|
|
2684
2685
|
constructor(t, r) {
|
|
2685
|
-
super(new
|
|
2686
|
-
h(this, "eventHub", new
|
|
2686
|
+
super(new X(t, r));
|
|
2687
|
+
h(this, "eventHub", new Or());
|
|
2687
2688
|
h(this, "isOpened", !1);
|
|
2688
2689
|
this.inner = t, this.map = r, t.addListener("closeclick", () => {
|
|
2689
2690
|
this.isOpened = !1, this.eventHub.hasListener("close") && this.eventHub.notify({ type: "close", target: this });
|
|
@@ -2700,7 +2701,7 @@ class nt extends it {
|
|
|
2700
2701
|
position: r.toGoogle(this.coordType),
|
|
2701
2702
|
disableAutoPan: t.disableAutoPan
|
|
2702
2703
|
});
|
|
2703
|
-
return new
|
|
2704
|
+
return new at(s, this);
|
|
2704
2705
|
}
|
|
2705
2706
|
isOpen() {
|
|
2706
2707
|
return this.isOpened;
|
|
@@ -2738,15 +2739,15 @@ class nt extends it {
|
|
|
2738
2739
|
this.inner.setPosition(t.toGoogle(this.map.coordType));
|
|
2739
2740
|
}
|
|
2740
2741
|
}
|
|
2741
|
-
var
|
|
2742
|
+
var de;
|
|
2742
2743
|
((i) => {
|
|
2743
2744
|
i.ZERO = { x: 0, y: 0 };
|
|
2744
|
-
})(
|
|
2745
|
-
let
|
|
2746
|
-
function
|
|
2747
|
-
return
|
|
2745
|
+
})(de || (de = {}));
|
|
2746
|
+
let ke;
|
|
2747
|
+
function Er(i, e, t, r) {
|
|
2748
|
+
return ke || (ke = kr()), new ke(i, e, t, r);
|
|
2748
2749
|
}
|
|
2749
|
-
function
|
|
2750
|
+
function kr() {
|
|
2750
2751
|
return class extends google.maps.OverlayView {
|
|
2751
2752
|
constructor(t, r, s, n) {
|
|
2752
2753
|
super();
|
|
@@ -2802,7 +2803,7 @@ function xr() {
|
|
|
2802
2803
|
}
|
|
2803
2804
|
};
|
|
2804
2805
|
}
|
|
2805
|
-
var
|
|
2806
|
+
var re;
|
|
2806
2807
|
((i) => {
|
|
2807
2808
|
function e(r) {
|
|
2808
2809
|
return typeof r == "string" ? r : r.outerHTML;
|
|
@@ -2816,8 +2817,8 @@ var te;
|
|
|
2816
2817
|
return r;
|
|
2817
2818
|
}
|
|
2818
2819
|
i.toElement = t;
|
|
2819
|
-
})(
|
|
2820
|
-
class
|
|
2820
|
+
})(re || (re = {}));
|
|
2821
|
+
class lt extends Ce {
|
|
2821
2822
|
constructor(t, r, s, n) {
|
|
2822
2823
|
super(t, r, s);
|
|
2823
2824
|
h(this, "icon");
|
|
@@ -2827,7 +2828,7 @@ class ot extends Oe {
|
|
|
2827
2828
|
}
|
|
2828
2829
|
static create(t) {
|
|
2829
2830
|
var a;
|
|
2830
|
-
const r = this.coordType, s = new BMap.Label(
|
|
2831
|
+
const r = this.coordType, s = new BMap.Label(re.toString(t.content), {
|
|
2831
2832
|
position: (a = t.position) == null ? void 0 : a.toBaidu(r),
|
|
2832
2833
|
offset: t.offset && new BMap.Size(t.offset.x, t.offset.y)
|
|
2833
2834
|
});
|
|
@@ -2836,7 +2837,7 @@ class ot extends Oe {
|
|
|
2836
2837
|
padding: "0px",
|
|
2837
2838
|
backgroundColor: "unset"
|
|
2838
2839
|
});
|
|
2839
|
-
const n = new
|
|
2840
|
+
const n = new lt(s, r, this, t.content);
|
|
2840
2841
|
return s.__label__ = n, n;
|
|
2841
2842
|
}
|
|
2842
2843
|
setContentInternal(t, r = !1) {
|
|
@@ -2847,7 +2848,7 @@ class ot extends Oe {
|
|
|
2847
2848
|
characterData: !0,
|
|
2848
2849
|
childList: !0,
|
|
2849
2850
|
subtree: !0
|
|
2850
|
-
})), r || this.innerOverlay.setContent(
|
|
2851
|
+
})), r || this.innerOverlay.setContent(re.toString(t)), this.content = t);
|
|
2851
2852
|
}
|
|
2852
2853
|
setZIndex(t) {
|
|
2853
2854
|
this.innerOverlay.setZIndex(t);
|
|
@@ -2880,22 +2881,22 @@ class ot extends Oe {
|
|
|
2880
2881
|
this.icon && (s -= this.icon.anchor.width, n -= this.icon.anchor.height), t && (s += t.anchor.width, n += t.anchor.height), this.innerOverlay.setOffset(new BMap.Size(s, n)), this.icon = t;
|
|
2881
2882
|
}
|
|
2882
2883
|
}
|
|
2883
|
-
class
|
|
2884
|
+
class ht extends je {
|
|
2884
2885
|
static create(e) {
|
|
2885
2886
|
var s;
|
|
2886
|
-
const t = this.coordType, r =
|
|
2887
|
-
|
|
2887
|
+
const t = this.coordType, r = Er(
|
|
2888
|
+
re.toElement(e.content),
|
|
2888
2889
|
(s = e.position) == null ? void 0 : s.toGoogle(t),
|
|
2889
2890
|
e.offset,
|
|
2890
2891
|
e.zIndex
|
|
2891
2892
|
);
|
|
2892
|
-
return new
|
|
2893
|
+
return new ht(r, t, this);
|
|
2893
2894
|
}
|
|
2894
2895
|
setZIndex(e) {
|
|
2895
2896
|
this.innerOverlay.setZIndex(e);
|
|
2896
2897
|
}
|
|
2897
2898
|
setContent(e) {
|
|
2898
|
-
this.innerOverlay.setElement(
|
|
2899
|
+
this.innerOverlay.setElement(re.toElement(e));
|
|
2899
2900
|
}
|
|
2900
2901
|
getPosition() {
|
|
2901
2902
|
const e = this.innerOverlay.getPosition();
|
|
@@ -2905,24 +2906,24 @@ class at extends Ze {
|
|
|
2905
2906
|
this.coordType = this.map.coordType, this.innerOverlay.setPosition(e.toGoogle(this.coordType));
|
|
2906
2907
|
}
|
|
2907
2908
|
getOffset() {
|
|
2908
|
-
return this.innerOverlay.getOffset() ??
|
|
2909
|
+
return this.innerOverlay.getOffset() ?? de.ZERO;
|
|
2909
2910
|
}
|
|
2910
2911
|
setOffset(e) {
|
|
2911
2912
|
this.innerOverlay.setOffset(e);
|
|
2912
2913
|
}
|
|
2913
2914
|
}
|
|
2914
|
-
function
|
|
2915
|
+
function Dt() {
|
|
2915
2916
|
BMap.OverlayV3 || (BMap.OverlayV3 = BMap.Overlay);
|
|
2916
2917
|
}
|
|
2917
|
-
let
|
|
2918
|
-
function
|
|
2919
|
-
return
|
|
2918
|
+
let Pe;
|
|
2919
|
+
function Pr(i, e, t, r, s, n) {
|
|
2920
|
+
return Pe || (Pe = Ir()), new Pe(i, e, t, r, s, n);
|
|
2920
2921
|
}
|
|
2921
|
-
function
|
|
2922
|
-
|
|
2922
|
+
function Ir() {
|
|
2923
|
+
Dt();
|
|
2923
2924
|
const i = new BMap.Point(0, 0);
|
|
2924
2925
|
return class extends BMap.OverlayV3 {
|
|
2925
|
-
constructor(r, s = i, n =
|
|
2926
|
+
constructor(r, s = i, n = de.ZERO, a, g = 654, o = "") {
|
|
2926
2927
|
super();
|
|
2927
2928
|
// 类表达式不能有私有成员, 故改成public
|
|
2928
2929
|
h(this, "container");
|
|
@@ -2987,13 +2988,13 @@ function kr() {
|
|
|
2987
2988
|
}
|
|
2988
2989
|
};
|
|
2989
2990
|
}
|
|
2990
|
-
class
|
|
2991
|
+
class ct extends Ce {
|
|
2991
2992
|
constructor(e, t, r) {
|
|
2992
2993
|
super(e, t, r), this.baiduMap = r;
|
|
2993
2994
|
}
|
|
2994
2995
|
static create(e) {
|
|
2995
2996
|
var s;
|
|
2996
|
-
const t = this.coordType, r =
|
|
2997
|
+
const t = this.coordType, r = Pr(
|
|
2997
2998
|
e.content,
|
|
2998
2999
|
(s = e.position) == null ? void 0 : s.toBaidu(t),
|
|
2999
3000
|
e.offset,
|
|
@@ -3001,7 +3002,7 @@ class lt extends Oe {
|
|
|
3001
3002
|
e.maxWidth,
|
|
3002
3003
|
e.borderClass
|
|
3003
3004
|
);
|
|
3004
|
-
return new
|
|
3005
|
+
return new ct(r, t, this);
|
|
3005
3006
|
}
|
|
3006
3007
|
open(e) {
|
|
3007
3008
|
this.innerOverlay.open(this.baiduMap.innerMap, e == null ? void 0 : e.innerOverlay);
|
|
@@ -3022,9 +3023,9 @@ class lt extends Oe {
|
|
|
3022
3023
|
this.innerOverlay.setZIndex(e);
|
|
3023
3024
|
}
|
|
3024
3025
|
}
|
|
3025
|
-
class
|
|
3026
|
+
class dt extends nt {
|
|
3026
3027
|
constructor(e, t, r) {
|
|
3027
|
-
super(new
|
|
3028
|
+
super(new X(e, r)), this.inner = e, this.coordType = t, this.map = r;
|
|
3028
3029
|
}
|
|
3029
3030
|
static create(e) {
|
|
3030
3031
|
var n;
|
|
@@ -3039,7 +3040,7 @@ class ht extends it {
|
|
|
3039
3040
|
var g;
|
|
3040
3041
|
const a = (g = e.content.parentElement) == null ? void 0 : g.parentElement;
|
|
3041
3042
|
a && a.className.includes("gm-style-iw-c") && !a.className.includes(s) && (a.className += ` ${s}`);
|
|
3042
|
-
}), new
|
|
3043
|
+
}), new dt(r, t, this);
|
|
3043
3044
|
}
|
|
3044
3045
|
open(e) {
|
|
3045
3046
|
this.inner.open(this.map.innerMap, e == null ? void 0 : e.innerOverlay);
|
|
@@ -3067,30 +3068,30 @@ class ht extends it {
|
|
|
3067
3068
|
this.inner.setZIndex(e);
|
|
3068
3069
|
}
|
|
3069
3070
|
}
|
|
3070
|
-
class
|
|
3071
|
+
class Lr extends Ze {
|
|
3071
3072
|
constructor(t, r) {
|
|
3072
3073
|
var s;
|
|
3073
3074
|
super(t);
|
|
3074
3075
|
h(this, "buildInMapTypeId2BIMT");
|
|
3075
3076
|
h(this, "baiduMapType2BIMT");
|
|
3076
3077
|
h(this, "map");
|
|
3077
|
-
h(this, "createLabel",
|
|
3078
|
-
h(this, "createCircle",
|
|
3079
|
-
h(this, "createPolygon",
|
|
3080
|
-
h(this, "createPolyline",
|
|
3081
|
-
h(this, "createInfoWindow",
|
|
3082
|
-
h(this, "createInfoBox",
|
|
3083
|
-
h(this, "createMarker",
|
|
3084
|
-
h(this, "createMapTypeControl",
|
|
3085
|
-
h(this, "createZoomControl",
|
|
3086
|
-
h(this, "createScaleControl",
|
|
3087
|
-
this.buildInMapTypeId2BIMT =
|
|
3078
|
+
h(this, "createLabel", lt.create);
|
|
3079
|
+
h(this, "createCircle", Ke.create);
|
|
3080
|
+
h(this, "createPolygon", Ue.create);
|
|
3081
|
+
h(this, "createPolyline", He.create);
|
|
3082
|
+
h(this, "createInfoWindow", ot.create);
|
|
3083
|
+
h(this, "createInfoBox", ct.create);
|
|
3084
|
+
h(this, "createMarker", ce.create);
|
|
3085
|
+
h(this, "createMapTypeControl", Qe.create);
|
|
3086
|
+
h(this, "createZoomControl", et.create);
|
|
3087
|
+
h(this, "createScaleControl", rt.create);
|
|
3088
|
+
this.buildInMapTypeId2BIMT = P.BUILD_IN_MAP_TYPES.getValueMap(k.prototype.getId), this.baiduMapType2BIMT = P.BUILD_IN_MAP_TYPES.getValueMap(k.prototype.asBaiduMapType), this.map = new BMap.Map(t, {
|
|
3088
3089
|
minZoom: r.minZoom,
|
|
3089
3090
|
maxZoom: r.maxZoom,
|
|
3090
3091
|
mapType: r.buildInMapTypeId && ((s = this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId)) == null ? void 0 : s.asBaiduMapType()),
|
|
3091
3092
|
enableMapClick: !1
|
|
3092
3093
|
// 关闭底图点击功能
|
|
3093
|
-
}), this.map.centerAndZoom(r.center.toBaidu(this.coordType), r.zoom), this.setGestureHandling(r.gestureHandling), r.infoWindowMode === "multi" && console.warn("baidu不支持多个InfoWindow, 可能会出现未知问题"), r.mapStyle && this.map.setMapStyle2(r.mapStyle.toBaidu()), this.setEventTargetDelegate(new
|
|
3094
|
+
}), this.map.centerAndZoom(r.center.toBaidu(this.coordType), r.zoom), this.setGestureHandling(r.gestureHandling), r.infoWindowMode === "multi" && console.warn("baidu不支持多个InfoWindow, 可能会出现未知问题"), r.mapStyle && this.map.setMapStyle2(r.mapStyle.toBaidu()), this.setEventTargetDelegate(new Q(this.map, this)), this.map.addEventListener("addoverlay", (n) => {
|
|
3094
3095
|
const a = n.target.__info_box__;
|
|
3095
3096
|
a && (console.debug("add:info-box", a), this.map.addOverlay(a));
|
|
3096
3097
|
}), this.map.addEventListener("removeoverlay", (n) => {
|
|
@@ -3101,15 +3102,15 @@ class Ir extends Re {
|
|
|
3101
3102
|
setDefaultCursor(t) {
|
|
3102
3103
|
this.innerMap.setDefaultCursor(t);
|
|
3103
3104
|
}
|
|
3104
|
-
setGestureHandling(t =
|
|
3105
|
-
switch (t ===
|
|
3106
|
-
case
|
|
3105
|
+
setGestureHandling(t = R.auto) {
|
|
3106
|
+
switch (t === R.auto && (t = this.element.parentElement && $e.isScrollable(this.element.parentElement) ? R.cooperative : R.greedy), t) {
|
|
3107
|
+
case R.cooperative:
|
|
3107
3108
|
this.map.disableScrollWheelZoom(), this.map.enableDragging(), this.map.enableDoubleClickZoom();
|
|
3108
3109
|
break;
|
|
3109
|
-
case
|
|
3110
|
+
case R.greedy:
|
|
3110
3111
|
this.map.enableScrollWheelZoom(), this.map.enableDragging(), this.map.enableDoubleClickZoom();
|
|
3111
3112
|
break;
|
|
3112
|
-
case
|
|
3113
|
+
case R.none:
|
|
3113
3114
|
this.map.disableDragging(), this.map.disableScrollWheelZoom(), this.map.disableDoubleClickZoom();
|
|
3114
3115
|
break;
|
|
3115
3116
|
}
|
|
@@ -3192,7 +3193,7 @@ class Ir extends Re {
|
|
|
3192
3193
|
});
|
|
3193
3194
|
}
|
|
3194
3195
|
getBounds() {
|
|
3195
|
-
return
|
|
3196
|
+
return V.fromBaidu(this.map.getBounds(), this.coordType);
|
|
3196
3197
|
}
|
|
3197
3198
|
addElementOverlay(t) {
|
|
3198
3199
|
this.map.addOverlay(t.asBaidu());
|
|
@@ -3211,7 +3212,7 @@ class Ir extends Re {
|
|
|
3211
3212
|
const r = class extends BMap.Control {
|
|
3212
3213
|
constructor() {
|
|
3213
3214
|
super(...arguments);
|
|
3214
|
-
h(this, "defaultAnchor",
|
|
3215
|
+
h(this, "defaultAnchor", I.getBaidu().toValue(t.position));
|
|
3215
3216
|
h(this, "defaultOffset", new BMap.Size(0, 0));
|
|
3216
3217
|
}
|
|
3217
3218
|
initialize(n) {
|
|
@@ -3223,33 +3224,33 @@ class Ir extends Re {
|
|
|
3223
3224
|
}
|
|
3224
3225
|
}
|
|
3225
3226
|
removeCustomControl(t) {
|
|
3226
|
-
t.inner && (
|
|
3227
|
+
t.inner && (ae(t.inner instanceof BMap.Control, `control.inner(${t.inner})需要是BMap.Control`), this.map.removeControl(t.inner));
|
|
3227
3228
|
}
|
|
3228
3229
|
createMarkerClusterer(t) {
|
|
3229
|
-
return new
|
|
3230
|
+
return new br(this, t);
|
|
3230
3231
|
}
|
|
3231
3232
|
}
|
|
3232
|
-
class
|
|
3233
|
+
class Br extends Ze {
|
|
3233
3234
|
constructor(t, r) {
|
|
3234
3235
|
var n;
|
|
3235
3236
|
super(t);
|
|
3236
3237
|
h(this, "buildInMapTypeId2BIMT");
|
|
3237
3238
|
h(this, "googleMapTypeId2BIMT");
|
|
3238
3239
|
h(this, "map");
|
|
3239
|
-
h(this, "createLabel",
|
|
3240
|
-
h(this, "createCircle",
|
|
3241
|
-
h(this, "createPolygon",
|
|
3242
|
-
h(this, "createPolyline",
|
|
3243
|
-
h(this, "createInfoWindow",
|
|
3244
|
-
h(this, "createInfoBox",
|
|
3245
|
-
h(this, "createMarker",
|
|
3246
|
-
h(this, "createMapTypeControl",
|
|
3247
|
-
h(this, "createZoomControl",
|
|
3248
|
-
h(this, "createScaleControl",
|
|
3249
|
-
this.mapOptions = r, this.buildInMapTypeId2BIMT =
|
|
3240
|
+
h(this, "createLabel", ht.create);
|
|
3241
|
+
h(this, "createCircle", qe.create);
|
|
3242
|
+
h(this, "createPolygon", Ye.create);
|
|
3243
|
+
h(this, "createPolyline", Fe.create);
|
|
3244
|
+
h(this, "createInfoWindow", at.create);
|
|
3245
|
+
h(this, "createInfoBox", dt.create);
|
|
3246
|
+
h(this, "createMarker", st.create);
|
|
3247
|
+
h(this, "createMapTypeControl", fe.create);
|
|
3248
|
+
h(this, "createZoomControl", tt.create);
|
|
3249
|
+
h(this, "createScaleControl", it.create);
|
|
3250
|
+
this.mapOptions = r, this.buildInMapTypeId2BIMT = P.BUILD_IN_MAP_TYPES.getValueMap(k.prototype.getId), this.googleMapTypeId2BIMT = P.BUILD_IN_MAP_TYPES.getValueMap(k.prototype.getGoogleMapTypeId);
|
|
3250
3251
|
const s = r.buildInMapTypeId && this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId);
|
|
3251
3252
|
this.map = new google.maps.Map(t, {
|
|
3252
|
-
center: r.center.toGoogle((s ??
|
|
3253
|
+
center: r.center.toGoogle((s ?? P.NORMAL).getGoogleCoordType()),
|
|
3253
3254
|
zoom: r.zoom,
|
|
3254
3255
|
disableDefaultUI: !0,
|
|
3255
3256
|
streetViewControl: !0,
|
|
@@ -3258,7 +3259,7 @@ class Pr extends Re {
|
|
|
3258
3259
|
maxZoom: r.maxZoom,
|
|
3259
3260
|
styles: (n = r.mapStyle) == null ? void 0 : n.toGoogle(),
|
|
3260
3261
|
mapTypeId: s == null ? void 0 : s.getGoogleMapTypeId()
|
|
3261
|
-
}), this.setEventTargetDelegate(new
|
|
3262
|
+
}), this.setEventTargetDelegate(new X(this.map, this));
|
|
3262
3263
|
}
|
|
3263
3264
|
setDefaultCursor(t) {
|
|
3264
3265
|
this.innerMap.setOptions({ draggableCursor: t });
|
|
@@ -3284,7 +3285,7 @@ class Pr extends Re {
|
|
|
3284
3285
|
fromLatLngToContainerPoint(t) {
|
|
3285
3286
|
const r = this.innerMap.getProjection(), s = this.innerMap.getBounds();
|
|
3286
3287
|
if (r == null || s == null)
|
|
3287
|
-
return
|
|
3288
|
+
return de.ZERO;
|
|
3288
3289
|
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()), g = Math.pow(2, this.innerMap.getZoom()), o = r.fromLatLngToPoint(t.toGoogle(this.coordType));
|
|
3289
3290
|
return { x: (o.x - n.x) * g, y: (o.y - a.y) * g };
|
|
3290
3291
|
}
|
|
@@ -3325,7 +3326,7 @@ class Pr extends Re {
|
|
|
3325
3326
|
this.map.overlayMapTypes.push(t.asGoogleMapType());
|
|
3326
3327
|
}
|
|
3327
3328
|
removeOverlayMapType(t) {
|
|
3328
|
-
|
|
3329
|
+
Te.remove(this.map.overlayMapTypes, t.asGoogleMapType());
|
|
3329
3330
|
}
|
|
3330
3331
|
addLayer(t) {
|
|
3331
3332
|
t.asGoogleLayer().setMap(this.map);
|
|
@@ -3344,7 +3345,7 @@ class Pr extends Re {
|
|
|
3344
3345
|
}
|
|
3345
3346
|
getBounds() {
|
|
3346
3347
|
const t = this.map.getBounds();
|
|
3347
|
-
return t ?
|
|
3348
|
+
return t ? V.fromGoogle(t, this.coordType) : V.EMPTY;
|
|
3348
3349
|
}
|
|
3349
3350
|
addElementOverlay(t) {
|
|
3350
3351
|
t.asGoogle().setMap(this.map);
|
|
@@ -3359,27 +3360,27 @@ class Pr extends Re {
|
|
|
3359
3360
|
t.innerOverlay.setMap(null);
|
|
3360
3361
|
}
|
|
3361
3362
|
addCustomControl(t) {
|
|
3362
|
-
t.inner || (t.inner = t.onCreateElement(), this.map.controls[
|
|
3363
|
+
t.inner || (t.inner = t.onCreateElement(), this.map.controls[I.getGoogle().toValue(t.position)].push(t.inner));
|
|
3363
3364
|
}
|
|
3364
3365
|
removeCustomControl(t) {
|
|
3365
3366
|
if (t.inner) {
|
|
3366
|
-
const r = this.map.controls[
|
|
3367
|
-
|
|
3367
|
+
const r = this.map.controls[I.getGoogle().toValue(t.position)];
|
|
3368
|
+
Te.remove(r, t.inner);
|
|
3368
3369
|
}
|
|
3369
3370
|
}
|
|
3370
3371
|
createMarkerClusterer(t) {
|
|
3371
|
-
return new
|
|
3372
|
+
return new Tr(this, t);
|
|
3372
3373
|
}
|
|
3373
3374
|
}
|
|
3374
|
-
class
|
|
3375
|
+
class Sr extends Ze {
|
|
3375
3376
|
constructor(t, r) {
|
|
3376
3377
|
var a;
|
|
3377
3378
|
super(t);
|
|
3378
3379
|
h(this, "map");
|
|
3379
3380
|
h(this, "defaultLayers");
|
|
3380
3381
|
this.mapOptions = r;
|
|
3381
|
-
const s =
|
|
3382
|
-
|
|
3382
|
+
const s = xt().here;
|
|
3383
|
+
_e.includes(s.version) || x(`不支持${s.version}, HereMap当前只支持如下版本: ${_e}`);
|
|
3383
3384
|
const n = new H.service.Platform({
|
|
3384
3385
|
app_id: s.key.split(",")[0],
|
|
3385
3386
|
app_code: s.key.split(",")[1]
|
|
@@ -3396,7 +3397,7 @@ class Lr extends Re {
|
|
|
3396
3397
|
return this.map;
|
|
3397
3398
|
}
|
|
3398
3399
|
get coordType() {
|
|
3399
|
-
return
|
|
3400
|
+
return q.wgs84;
|
|
3400
3401
|
}
|
|
3401
3402
|
getCenter() {
|
|
3402
3403
|
return y.fromHere(this.map.getCenter(), this.coordType);
|
|
@@ -3508,44 +3509,44 @@ class Lr extends Re {
|
|
|
3508
3509
|
throw new Error("Method not implemented.");
|
|
3509
3510
|
}
|
|
3510
3511
|
}
|
|
3511
|
-
var $ = /* @__PURE__ */ ((i) => (i.google = "google", i.baidu = "baidu", i.here = "here", i))($ || {}),
|
|
3512
|
+
var $ = /* @__PURE__ */ ((i) => (i.google = "google", i.baidu = "baidu", i.here = "here", i))($ || {}), Ae;
|
|
3512
3513
|
((i) => {
|
|
3513
3514
|
function e(t, r, s) {
|
|
3514
|
-
const n =
|
|
3515
|
+
const n = Be.create(s);
|
|
3515
3516
|
switch (t) {
|
|
3516
3517
|
case "google":
|
|
3517
|
-
return new
|
|
3518
|
+
return new Br(r, n);
|
|
3518
3519
|
case "baidu":
|
|
3519
|
-
return new Ir(r, n);
|
|
3520
|
-
case "here":
|
|
3521
3520
|
return new Lr(r, n);
|
|
3521
|
+
case "here":
|
|
3522
|
+
return new Sr(r, n);
|
|
3522
3523
|
}
|
|
3523
3524
|
}
|
|
3524
3525
|
i.createMap = e;
|
|
3525
|
-
})(
|
|
3526
|
-
function
|
|
3527
|
-
const t = window, r =
|
|
3526
|
+
})(Ae || (Ae = {}));
|
|
3527
|
+
function $r(i, e) {
|
|
3528
|
+
const t = window, r = Ar(i);
|
|
3528
3529
|
if (t[r])
|
|
3529
3530
|
return Promise.resolve();
|
|
3530
3531
|
switch (i !== $.here && !e.key && x(`请先配置${i}地图的key`), i) {
|
|
3531
3532
|
case $.google:
|
|
3532
|
-
return
|
|
3533
|
+
return _t(`https://maps.googleapis.com/maps/api/js?key=${e.key}&language=${e.language}`);
|
|
3533
3534
|
case $.baidu:
|
|
3534
|
-
return
|
|
3535
|
+
return _t(`https://api.map.baidu.com/api?v=${e.version}&ak=${e.key}`);
|
|
3535
3536
|
case $.here:
|
|
3536
|
-
return se(
|
|
3537
|
+
return ne(se("core", e.version)).then(() => Promise.all([
|
|
3537
3538
|
// 其他大多数模块都可以同时载入
|
|
3538
|
-
se(
|
|
3539
|
-
se(
|
|
3540
|
-
se(
|
|
3541
|
-
se(
|
|
3539
|
+
ne(se("service", e.version)),
|
|
3540
|
+
ne(se("mapevents", e.version)),
|
|
3541
|
+
ne(se("clustering", e.version)),
|
|
3542
|
+
ne(se("ui", e.version))
|
|
3542
3543
|
])).catch((s) => (delete t[r], Promise.reject(s)));
|
|
3543
3544
|
}
|
|
3544
3545
|
}
|
|
3545
|
-
function
|
|
3546
|
+
function se(i, e = _e[0]) {
|
|
3546
3547
|
return `https://js.api.here.com/v3/${e}/mapsjs-${i}.js`;
|
|
3547
3548
|
}
|
|
3548
|
-
function
|
|
3549
|
+
function Ar(i) {
|
|
3549
3550
|
switch (i) {
|
|
3550
3551
|
case $.google:
|
|
3551
3552
|
return "google";
|
|
@@ -3555,29 +3556,29 @@ function Sr(i) {
|
|
|
3555
3556
|
return "H";
|
|
3556
3557
|
}
|
|
3557
3558
|
}
|
|
3558
|
-
let
|
|
3559
|
-
function
|
|
3559
|
+
let zr = 0;
|
|
3560
|
+
function _t(i, e = "callback") {
|
|
3560
3561
|
return new Promise((t, r) => {
|
|
3561
|
-
const s = `__callback${
|
|
3562
|
+
const s = `__callback${zr++}`;
|
|
3562
3563
|
window[s] = t;
|
|
3563
3564
|
const n = document.createElement("script");
|
|
3564
3565
|
n.src = `${i}&${e}=${s}`, n.onerror = r, document.body.appendChild(n);
|
|
3565
3566
|
});
|
|
3566
3567
|
}
|
|
3567
|
-
function
|
|
3568
|
+
function ne(i) {
|
|
3568
3569
|
return new Promise((e, t) => {
|
|
3569
3570
|
const r = document.createElement("script");
|
|
3570
3571
|
r.src = i, r.onload = e, r.onerror = t, document.body.appendChild(r);
|
|
3571
3572
|
});
|
|
3572
3573
|
}
|
|
3573
|
-
function
|
|
3574
|
+
function D(i, e) {
|
|
3574
3575
|
return {
|
|
3575
3576
|
type: String,
|
|
3576
3577
|
default: e,
|
|
3577
3578
|
validator: (t) => Object.values(i).includes(t)
|
|
3578
3579
|
};
|
|
3579
3580
|
}
|
|
3580
|
-
function
|
|
3581
|
+
function Nr(i, e) {
|
|
3581
3582
|
return {
|
|
3582
3583
|
type: String,
|
|
3583
3584
|
default: e,
|
|
@@ -3596,7 +3597,7 @@ function m(i, e) {
|
|
|
3596
3597
|
default: e
|
|
3597
3598
|
};
|
|
3598
3599
|
}
|
|
3599
|
-
function
|
|
3600
|
+
function $i(i) {
|
|
3600
3601
|
const e = {};
|
|
3601
3602
|
return Object.entries(i).forEach(([t, r]) => {
|
|
3602
3603
|
const s = `__${t}`;
|
|
@@ -3613,37 +3614,37 @@ function Li(i) {
|
|
|
3613
3614
|
};
|
|
3614
3615
|
}), e;
|
|
3615
3616
|
}
|
|
3616
|
-
const
|
|
3617
|
+
const oe = {
|
|
3617
3618
|
enumerable: !0,
|
|
3618
3619
|
configurable: !0,
|
|
3619
|
-
get:
|
|
3620
|
-
set:
|
|
3620
|
+
get: ve,
|
|
3621
|
+
set: ve
|
|
3621
3622
|
};
|
|
3622
|
-
function
|
|
3623
|
+
function Rr(i) {
|
|
3623
3624
|
return Object.keys(i).forEach((e) => {
|
|
3624
3625
|
const t = i[e];
|
|
3625
3626
|
let r = !1;
|
|
3626
|
-
typeof t == "function" ? (
|
|
3627
|
+
typeof t == "function" ? (oe.get = t, oe.set = ve, r = !0) : typeof t == "object" && typeof t.get == "function" && (oe.get = t.get, oe.set = t.set, r = !0), r && (i[e] = Object.defineProperty(i, e, oe));
|
|
3627
3628
|
}), i;
|
|
3628
3629
|
}
|
|
3629
|
-
function
|
|
3630
|
-
return
|
|
3630
|
+
function Ai(i) {
|
|
3631
|
+
return Rr(i);
|
|
3631
3632
|
}
|
|
3632
|
-
function
|
|
3633
|
+
function Dr() {
|
|
3633
3634
|
return Ie();
|
|
3634
3635
|
}
|
|
3635
|
-
function
|
|
3636
|
+
function me(i, e) {
|
|
3636
3637
|
const t = i.$options[e];
|
|
3637
3638
|
if (t)
|
|
3638
3639
|
for (const r of t)
|
|
3639
3640
|
r.call(i);
|
|
3640
3641
|
}
|
|
3641
|
-
function
|
|
3642
|
+
function zi(i, e) {
|
|
3642
3643
|
for (const t of i)
|
|
3643
3644
|
if (t.$options.name === e.name)
|
|
3644
3645
|
return t;
|
|
3645
3646
|
}
|
|
3646
|
-
function
|
|
3647
|
+
function Ni(i, e) {
|
|
3647
3648
|
if (!i.default)
|
|
3648
3649
|
return;
|
|
3649
3650
|
const t = i.default();
|
|
@@ -3651,16 +3652,28 @@ function $i(i, e) {
|
|
|
3651
3652
|
if ((r == null ? void 0 : r.type).name === e.name)
|
|
3652
3653
|
return r;
|
|
3653
3654
|
}
|
|
3654
|
-
function
|
|
3655
|
-
const
|
|
3656
|
-
return Object.keys(i).forEach((
|
|
3657
|
-
|
|
3655
|
+
function Zr(i, e) {
|
|
3656
|
+
const t = {}, r = {}, s = {};
|
|
3657
|
+
return Object.keys(i).forEach((n) => {
|
|
3658
|
+
n.startsWith("on") ? t[n.substring(2).toLowerCase()] = i[n] : r[n] = i[n];
|
|
3659
|
+
}), e && Object.keys(e).forEach((n) => {
|
|
3660
|
+
n.startsWith("on") && (s[n.substring(2).toLocaleLowerCase()] = e[n]);
|
|
3658
3661
|
}), {
|
|
3659
|
-
|
|
3660
|
-
|
|
3662
|
+
/** class/style/未声明的属性 等 */
|
|
3663
|
+
binds: r,
|
|
3664
|
+
/** 未声明的事件 */
|
|
3665
|
+
listeners: t,
|
|
3666
|
+
/** 声明在`props`中的事件 */
|
|
3667
|
+
listenerProps: s
|
|
3661
3668
|
};
|
|
3662
3669
|
}
|
|
3663
|
-
|
|
3670
|
+
function U(i, e) {
|
|
3671
|
+
return bt(() => Zr(i, e));
|
|
3672
|
+
}
|
|
3673
|
+
function N() {
|
|
3674
|
+
return Function;
|
|
3675
|
+
}
|
|
3676
|
+
const Ri = {
|
|
3664
3677
|
/**
|
|
3665
3678
|
* @event 一般来说传{@link Tg.Event}对象, 但传其他对象也不会报错
|
|
3666
3679
|
*/
|
|
@@ -3671,33 +3684,33 @@ const Ai = {
|
|
|
3671
3684
|
eventLogLess(i) {
|
|
3672
3685
|
((i && i.type) !== this.$_prev_type || Date.now() - (this.$_prev_time ?? 0) > 1e3) && this.eventLog(i);
|
|
3673
3686
|
}
|
|
3674
|
-
},
|
|
3675
|
-
inject: [
|
|
3687
|
+
}, Zt = "$map", ze = "onCreate", Ne = "onDestroy", w = C({
|
|
3688
|
+
inject: [Zt],
|
|
3676
3689
|
mounted() {
|
|
3677
|
-
|
|
3690
|
+
me(this, ze);
|
|
3678
3691
|
},
|
|
3679
3692
|
beforeUnmount() {
|
|
3680
|
-
|
|
3693
|
+
me(this, Ne);
|
|
3681
3694
|
},
|
|
3682
3695
|
methods: {
|
|
3683
3696
|
recreate() {
|
|
3684
|
-
|
|
3697
|
+
me(this, Ne), me(this, ze);
|
|
3685
3698
|
}
|
|
3686
3699
|
},
|
|
3687
3700
|
render() {
|
|
3688
|
-
return
|
|
3701
|
+
return Dr();
|
|
3689
3702
|
}
|
|
3690
|
-
}),
|
|
3703
|
+
}), Gr = C({
|
|
3691
3704
|
name: "tg-map",
|
|
3692
3705
|
provide() {
|
|
3693
3706
|
return {
|
|
3694
|
-
[
|
|
3707
|
+
[Zt]: bt(() => this.map)
|
|
3695
3708
|
};
|
|
3696
3709
|
},
|
|
3697
3710
|
inheritAttrs: !1,
|
|
3698
3711
|
props: {
|
|
3699
3712
|
/** type没做响应式, 但外部可以把type作为tg-map的key, 让type修改时完全重建tg-map */
|
|
3700
|
-
type:
|
|
3713
|
+
type: D($, $.google),
|
|
3701
3714
|
/**
|
|
3702
3715
|
* 当对该属性使用双向绑定时, 改变center将触发update:center又反过来触发center改变, 最终导致无限循环...
|
|
3703
3716
|
* 当前通过setCenter()时判断center是否有改变来避免该问题, 但为了避免可能存在的问题, 另外设计了如下机制:
|
|
@@ -3724,30 +3737,40 @@ const Ai = {
|
|
|
3724
3737
|
*/
|
|
3725
3738
|
lastCenter: m(y),
|
|
3726
3739
|
zoom: z(Number),
|
|
3727
|
-
infoWindowMode:
|
|
3728
|
-
gestureHandling: R
|
|
3740
|
+
infoWindowMode: Nr(fr),
|
|
3741
|
+
gestureHandling: D(R),
|
|
3729
3742
|
minZoom: m(Number),
|
|
3730
3743
|
maxZoom: m(Number),
|
|
3731
3744
|
mapStyle: m(Object),
|
|
3732
|
-
mapTypeId:
|
|
3745
|
+
mapTypeId: D(zt),
|
|
3733
3746
|
/** 地图类型对象, 优先级比mapTypeId高 */
|
|
3734
|
-
mapType: m(Object)
|
|
3747
|
+
mapType: m(Object),
|
|
3748
|
+
onLoad: N(),
|
|
3749
|
+
"onUpdate:center": N(),
|
|
3750
|
+
"onUpdate:current-center": N(),
|
|
3751
|
+
"onUpdate:last-center": N(),
|
|
3752
|
+
"onUpdate:map-type": N(),
|
|
3753
|
+
"onUpdate:map-type-id": N(),
|
|
3754
|
+
"onUpdate:zoom": N(),
|
|
3755
|
+
onError: N()
|
|
3735
3756
|
},
|
|
3757
|
+
/** 声明事件的类型信息, 详见: {@link splitAttrs} */
|
|
3758
|
+
emits: void 0,
|
|
3736
3759
|
setup(i, { attrs: e }) {
|
|
3737
3760
|
return {
|
|
3738
|
-
attrs:
|
|
3761
|
+
attrs: U(e, i),
|
|
3739
3762
|
centerSyncTimeoutId: 0
|
|
3740
3763
|
};
|
|
3741
3764
|
},
|
|
3742
3765
|
data() {
|
|
3743
3766
|
return {
|
|
3744
|
-
map:
|
|
3767
|
+
map: Le(),
|
|
3745
3768
|
isDestroyed: !1
|
|
3746
3769
|
};
|
|
3747
3770
|
},
|
|
3748
3771
|
computed: {
|
|
3749
3772
|
propsJson() {
|
|
3750
|
-
return
|
|
3773
|
+
return he.toJsonSafely(this.$props);
|
|
3751
3774
|
}
|
|
3752
3775
|
},
|
|
3753
3776
|
watch: {
|
|
@@ -3780,13 +3803,13 @@ const Ai = {
|
|
|
3780
3803
|
},
|
|
3781
3804
|
mapType(i) {
|
|
3782
3805
|
var e;
|
|
3783
|
-
(e = this.map) == null || e.setMapType(i ??
|
|
3806
|
+
(e = this.map) == null || e.setMapType(i ?? P.NORMAL);
|
|
3784
3807
|
}
|
|
3785
3808
|
},
|
|
3786
3809
|
async created() {
|
|
3787
3810
|
const i = this.type;
|
|
3788
3811
|
try {
|
|
3789
|
-
await
|
|
3812
|
+
await $r(i, xt()[i]);
|
|
3790
3813
|
} catch (s) {
|
|
3791
3814
|
this.$emit("error", s);
|
|
3792
3815
|
return;
|
|
@@ -3795,7 +3818,7 @@ const Ai = {
|
|
|
3795
3818
|
console.warn(`tg-map(type=${i})已销毁, 不需要继续执行`);
|
|
3796
3819
|
return;
|
|
3797
3820
|
}
|
|
3798
|
-
const e = this.map =
|
|
3821
|
+
const e = this.map = Ae.createMap(
|
|
3799
3822
|
i,
|
|
3800
3823
|
this.$refs.map,
|
|
3801
3824
|
/* options: */
|
|
@@ -3810,52 +3833,52 @@ const Ai = {
|
|
|
3810
3833
|
buildInMapTypeId: this.mapTypeId
|
|
3811
3834
|
}
|
|
3812
3835
|
);
|
|
3813
|
-
if (this.mapType && e.setMapType(this.mapType), "ready" in this.attrs.listeners && console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"),
|
|
3836
|
+
if (this.mapType && e.setMapType(this.mapType), "ready" in this.attrs.listeners && console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"), F(
|
|
3814
3837
|
this.attrs.listeners,
|
|
3815
|
-
|
|
3838
|
+
e,
|
|
3816
3839
|
/* excludes: */
|
|
3817
3840
|
["load"]
|
|
3818
|
-
), this.$emit("load",
|
|
3841
|
+
), this.$emit("load", e), "update:center" in this.attrs.listenerProps) {
|
|
3819
3842
|
const s = () => this.$emit("update:center", e.getCenter());
|
|
3820
3843
|
e.addEventListener("center-changed", () => {
|
|
3821
3844
|
this.centerSyncDelay > 0 ? (clearTimeout(this.centerSyncTimeoutId), this.centerSyncTimeoutId = setTimeout(s, this.centerSyncDelay)) : s();
|
|
3822
3845
|
});
|
|
3823
3846
|
}
|
|
3824
|
-
"update:current-center" in this.attrs.
|
|
3847
|
+
"update:current-center" in this.attrs.listenerProps && (this.$emit("update:current-center", this.center), e.addEventListener("center-changed", () => {
|
|
3825
3848
|
this.$emit("update:current-center", e.getCenter());
|
|
3826
|
-
})), "update:zoom" in this.attrs.
|
|
3849
|
+
})), "update:zoom" in this.attrs.listenerProps && e.addEventListener("zoom-changed", () => {
|
|
3827
3850
|
this.$emit("update:zoom", e.getZoom());
|
|
3828
3851
|
});
|
|
3829
|
-
const t = "update:map-type" in this.attrs.
|
|
3852
|
+
const t = "update:map-type" in this.attrs.listenerProps, r = "update:map-type-id" in this.attrs.listenerProps;
|
|
3830
3853
|
(t || r) && e.addEventListener("map-type-changed", () => {
|
|
3831
3854
|
const s = e.getMapType();
|
|
3832
3855
|
t && this.$emit("update:map-type", s), r && this.$emit("update:map-type-id", s.id);
|
|
3833
3856
|
});
|
|
3834
3857
|
},
|
|
3835
3858
|
unmounted() {
|
|
3836
|
-
this.isDestroyed = !0, this.map && ("update:last-center" in this.attrs.
|
|
3859
|
+
this.isDestroyed = !0, this.map && ("update:last-center" in this.attrs.listenerProps && this.$emit("update:last-center", this.map.getCenter()), "update:center" in this.attrs.listenerProps && (clearTimeout(this.centerSyncTimeoutId), this.$emit("update:center", this.map.getCenter())));
|
|
3837
3860
|
},
|
|
3838
3861
|
methods: {}
|
|
3839
3862
|
});
|
|
3840
|
-
const
|
|
3863
|
+
const j = (i, e) => {
|
|
3841
3864
|
const t = i.__vccOpts || i;
|
|
3842
3865
|
for (const [r, s] of e)
|
|
3843
3866
|
t[r] = s;
|
|
3844
3867
|
return t;
|
|
3845
|
-
},
|
|
3868
|
+
}, jr = {
|
|
3846
3869
|
ref: "map",
|
|
3847
3870
|
class: "tg-map__map"
|
|
3848
3871
|
};
|
|
3849
|
-
function
|
|
3850
|
-
return
|
|
3851
|
-
|
|
3872
|
+
function Wr(i, e, t, r, s, n) {
|
|
3873
|
+
return Z(), G("div", ie({ class: "tg-map" }, i.attrs.binds), [
|
|
3874
|
+
Ft("div", jr, null, 512),
|
|
3852
3875
|
Ie("", !0),
|
|
3853
3876
|
i.map ? A(i.$slots, "default", { key: 1 }) : Ie("", !0),
|
|
3854
3877
|
A(i.$slots, "overlay")
|
|
3855
3878
|
], 16);
|
|
3856
3879
|
}
|
|
3857
|
-
const
|
|
3858
|
-
function
|
|
3880
|
+
const Gt = /* @__PURE__ */ j(Gr, [["render", Wr]]);
|
|
3881
|
+
function Vr(i) {
|
|
3859
3882
|
if (i == null)
|
|
3860
3883
|
return;
|
|
3861
3884
|
let e;
|
|
@@ -3866,7 +3889,7 @@ function Gr(i) {
|
|
|
3866
3889
|
e = i;
|
|
3867
3890
|
return `${e}px`;
|
|
3868
3891
|
}
|
|
3869
|
-
const
|
|
3892
|
+
const Hr = C({
|
|
3870
3893
|
name: "tg-map-widget",
|
|
3871
3894
|
props: {
|
|
3872
3895
|
left: {
|
|
@@ -3892,22 +3915,22 @@ const jr = C({
|
|
|
3892
3915
|
}
|
|
3893
3916
|
},
|
|
3894
3917
|
methods: {
|
|
3895
|
-
dimen:
|
|
3918
|
+
dimen: Vr
|
|
3896
3919
|
}
|
|
3897
3920
|
});
|
|
3898
|
-
function
|
|
3899
|
-
return
|
|
3900
|
-
class:
|
|
3901
|
-
style:
|
|
3921
|
+
function Fr(i, e, t, r, s, n) {
|
|
3922
|
+
return Z(), G("div", {
|
|
3923
|
+
class: De(i.$options.name),
|
|
3924
|
+
style: Ut({ left: i.dimen(i.left), top: i.dimen(i.topValue), right: i.dimen(i.right), bottom: i.dimen(i.bottom) })
|
|
3902
3925
|
}, [
|
|
3903
3926
|
A(i.$slots, "default")
|
|
3904
3927
|
], 6);
|
|
3905
3928
|
}
|
|
3906
|
-
const
|
|
3929
|
+
const Ur = /* @__PURE__ */ j(Hr, [["render", Fr]]), Yr = C({
|
|
3907
3930
|
name: "tg-custom-control",
|
|
3908
3931
|
mixins: [w],
|
|
3909
3932
|
props: {
|
|
3910
|
-
position:
|
|
3933
|
+
position: D(E, E.RIGHT_BOTTOM)
|
|
3911
3934
|
},
|
|
3912
3935
|
setup() {
|
|
3913
3936
|
return {
|
|
@@ -3920,8 +3943,8 @@ const Vr = /* @__PURE__ */ G(jr, [["render", Wr]]), Hr = C({
|
|
|
3920
3943
|
}
|
|
3921
3944
|
},
|
|
3922
3945
|
onCreate() {
|
|
3923
|
-
|
|
3924
|
-
const { $el: i } = this, e = class extends
|
|
3946
|
+
pe(this.$parent, Gt) || console.warn("请将tg-custom-control放到tg-map中");
|
|
3947
|
+
const { $el: i } = this, e = class extends wr {
|
|
3925
3948
|
onCreateElement() {
|
|
3926
3949
|
return i;
|
|
3927
3950
|
}
|
|
@@ -3932,19 +3955,19 @@ const Vr = /* @__PURE__ */ G(jr, [["render", Wr]]), Hr = C({
|
|
|
3932
3955
|
this.$map.removeCustomControl(this.control);
|
|
3933
3956
|
}
|
|
3934
3957
|
});
|
|
3935
|
-
function
|
|
3936
|
-
return
|
|
3937
|
-
class:
|
|
3958
|
+
function Kr(i, e, t, r, s, n) {
|
|
3959
|
+
return Z(), G("div", {
|
|
3960
|
+
class: De(i.$options.name)
|
|
3938
3961
|
}, [
|
|
3939
3962
|
A(i.$slots, "default")
|
|
3940
3963
|
], 2);
|
|
3941
3964
|
}
|
|
3942
|
-
const
|
|
3965
|
+
const qr = /* @__PURE__ */ j(Yr, [["render", Kr]]), Xr = C({
|
|
3943
3966
|
name: "tg-map-type-control",
|
|
3944
3967
|
mixins: [w],
|
|
3945
3968
|
props: {
|
|
3946
|
-
position:
|
|
3947
|
-
type:
|
|
3969
|
+
position: D(E, E.TOP_LEFT),
|
|
3970
|
+
type: D(Nt),
|
|
3948
3971
|
mapTypes: m(Array)
|
|
3949
3972
|
},
|
|
3950
3973
|
setup() {
|
|
@@ -3972,11 +3995,11 @@ const Ur = /* @__PURE__ */ G(Hr, [["render", Fr]]), Yr = C({
|
|
|
3972
3995
|
onDestroy() {
|
|
3973
3996
|
this.$map.removeControl(this.control);
|
|
3974
3997
|
}
|
|
3975
|
-
}),
|
|
3998
|
+
}), Jr = C({
|
|
3976
3999
|
name: "tg-scale-control",
|
|
3977
4000
|
mixins: [w],
|
|
3978
4001
|
props: {
|
|
3979
|
-
position:
|
|
4002
|
+
position: D(E, E.BOTTOM_RIGHT)
|
|
3980
4003
|
},
|
|
3981
4004
|
setup() {
|
|
3982
4005
|
return {
|
|
@@ -3994,11 +4017,11 @@ const Ur = /* @__PURE__ */ G(Hr, [["render", Fr]]), Yr = C({
|
|
|
3994
4017
|
onDestroy() {
|
|
3995
4018
|
this.$map.removeControl(this.control);
|
|
3996
4019
|
}
|
|
3997
|
-
}),
|
|
4020
|
+
}), Qr = C({
|
|
3998
4021
|
name: "tg-zoom-control",
|
|
3999
4022
|
mixins: [w],
|
|
4000
4023
|
props: {
|
|
4001
|
-
position:
|
|
4024
|
+
position: D(E, E.RIGHT_BOTTOM)
|
|
4002
4025
|
},
|
|
4003
4026
|
setup() {
|
|
4004
4027
|
return {
|
|
@@ -4016,7 +4039,7 @@ const Ur = /* @__PURE__ */ G(Hr, [["render", Fr]]), Yr = C({
|
|
|
4016
4039
|
onDestroy() {
|
|
4017
4040
|
this.$map.removeControl(this.control);
|
|
4018
4041
|
}
|
|
4019
|
-
}),
|
|
4042
|
+
}), ei = C({
|
|
4020
4043
|
name: "tg-marker-clusterer",
|
|
4021
4044
|
mixins: [w],
|
|
4022
4045
|
// markers从this.$children中读取, 故需要省略(Omit)
|
|
@@ -4076,18 +4099,18 @@ const Ur = /* @__PURE__ */ G(Hr, [["render", Fr]]), Yr = C({
|
|
|
4076
4099
|
this.markers.push(i), this.isInitiated() && this.clusterer.addMarker(i);
|
|
4077
4100
|
},
|
|
4078
4101
|
onRemoveMarker(i) {
|
|
4079
|
-
this.isInitiated() && this.clusterer.removeMarker(i),
|
|
4102
|
+
this.isInitiated() && this.clusterer.removeMarker(i), be.remove(this.markers, i);
|
|
4080
4103
|
}
|
|
4081
4104
|
}
|
|
4082
4105
|
});
|
|
4083
|
-
function
|
|
4084
|
-
return
|
|
4085
|
-
class:
|
|
4106
|
+
function ti(i, e, t, r, s, n) {
|
|
4107
|
+
return Z(), G("div", {
|
|
4108
|
+
class: De(i.$options.name)
|
|
4086
4109
|
}, [
|
|
4087
4110
|
A(i.$slots, "default")
|
|
4088
4111
|
], 2);
|
|
4089
4112
|
}
|
|
4090
|
-
const
|
|
4113
|
+
const jt = /* @__PURE__ */ j(ei, [["render", ti]]), ri = C({
|
|
4091
4114
|
name: "tg-traffic-layer",
|
|
4092
4115
|
mixins: [w],
|
|
4093
4116
|
props: {
|
|
@@ -4100,12 +4123,12 @@ const Zt = /* @__PURE__ */ G(Xr, [["render", Jr]]), Qr = C({
|
|
|
4100
4123
|
},
|
|
4101
4124
|
watch: {},
|
|
4102
4125
|
onCreate() {
|
|
4103
|
-
this.layer = new
|
|
4126
|
+
this.layer = new xr(), this.$map.addLayer(this.layer);
|
|
4104
4127
|
},
|
|
4105
4128
|
onDestroy() {
|
|
4106
4129
|
this.$map.removeLayer(this.layer);
|
|
4107
4130
|
}
|
|
4108
|
-
}),
|
|
4131
|
+
}), ii = C({
|
|
4109
4132
|
name: "tg-circle",
|
|
4110
4133
|
mixins: [w],
|
|
4111
4134
|
inheritAttrs: !1,
|
|
@@ -4123,7 +4146,7 @@ const Zt = /* @__PURE__ */ G(Xr, [["render", Jr]]), Qr = C({
|
|
|
4123
4146
|
},
|
|
4124
4147
|
setup(i, { attrs: e }) {
|
|
4125
4148
|
return {
|
|
4126
|
-
attrs:
|
|
4149
|
+
attrs: U(e),
|
|
4127
4150
|
overlay: void 0
|
|
4128
4151
|
};
|
|
4129
4152
|
},
|
|
@@ -4160,14 +4183,14 @@ const Zt = /* @__PURE__ */ G(Xr, [["render", Jr]]), Qr = C({
|
|
|
4160
4183
|
}
|
|
4161
4184
|
},
|
|
4162
4185
|
onCreate() {
|
|
4163
|
-
this.overlay = this.$map.createCircle(this), this.$map.addOverlay(this.overlay),
|
|
4186
|
+
this.overlay = this.$map.createCircle(this), this.$map.addOverlay(this.overlay), F(this.attrs.listeners, this.overlay);
|
|
4164
4187
|
},
|
|
4165
4188
|
onDestroy() {
|
|
4166
4189
|
this.$map.removeOverlay(this.overlay);
|
|
4167
4190
|
}
|
|
4168
4191
|
});
|
|
4169
|
-
var
|
|
4170
|
-
class
|
|
4192
|
+
var Re = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overlayMouseTarget = "overlayMouseTarget", i.float = "float", i))(Re || {});
|
|
4193
|
+
class si {
|
|
4171
4194
|
constructor(e, t) {
|
|
4172
4195
|
h(this, "baidu");
|
|
4173
4196
|
h(this, "google");
|
|
@@ -4188,7 +4211,7 @@ class ti {
|
|
|
4188
4211
|
asBaidu() {
|
|
4189
4212
|
if (!this.baidu) {
|
|
4190
4213
|
const e = this;
|
|
4191
|
-
|
|
4214
|
+
Dt();
|
|
4192
4215
|
class t extends BMap.OverlayV3 {
|
|
4193
4216
|
initialize(n) {
|
|
4194
4217
|
const a = e.create(), g = n.getPanes();
|
|
@@ -4207,7 +4230,7 @@ class ti {
|
|
|
4207
4230
|
o = g.mapPane;
|
|
4208
4231
|
break;
|
|
4209
4232
|
default:
|
|
4210
|
-
|
|
4233
|
+
ut(e.mapPane);
|
|
4211
4234
|
break;
|
|
4212
4235
|
}
|
|
4213
4236
|
return o == null || o.appendChild(a), a;
|
|
@@ -4250,7 +4273,7 @@ class ti {
|
|
|
4250
4273
|
a = n.mapPane;
|
|
4251
4274
|
break;
|
|
4252
4275
|
default:
|
|
4253
|
-
|
|
4276
|
+
ut(e.mapPane);
|
|
4254
4277
|
break;
|
|
4255
4278
|
}
|
|
4256
4279
|
a.appendChild(s);
|
|
@@ -4275,7 +4298,7 @@ class ti {
|
|
|
4275
4298
|
return this.google;
|
|
4276
4299
|
}
|
|
4277
4300
|
}
|
|
4278
|
-
class
|
|
4301
|
+
class ni extends si {
|
|
4279
4302
|
constructor(e, t, r, s) {
|
|
4280
4303
|
super(e, t), this.content = r, this.position = s;
|
|
4281
4304
|
}
|
|
@@ -4290,11 +4313,11 @@ class ri extends ti {
|
|
|
4290
4313
|
this.position = e, this.draw();
|
|
4291
4314
|
}
|
|
4292
4315
|
}
|
|
4293
|
-
const
|
|
4316
|
+
const oi = C({
|
|
4294
4317
|
name: "tg-element-overlay",
|
|
4295
4318
|
mixins: [w],
|
|
4296
4319
|
props: {
|
|
4297
|
-
mapPane:
|
|
4320
|
+
mapPane: D(Re, Re.overlayMouseTarget),
|
|
4298
4321
|
position: z(y)
|
|
4299
4322
|
},
|
|
4300
4323
|
setup() {
|
|
@@ -4316,20 +4339,20 @@ const ii = C({
|
|
|
4316
4339
|
}
|
|
4317
4340
|
},
|
|
4318
4341
|
onCreate() {
|
|
4319
|
-
this.overlay = new
|
|
4342
|
+
this.overlay = new ni(this.$map, this, this.content(), this.position), this.$map.addElementOverlay(this.overlay);
|
|
4320
4343
|
},
|
|
4321
4344
|
onDestroy() {
|
|
4322
4345
|
this.$map.removeElementOverlay(this.overlay);
|
|
4323
4346
|
}
|
|
4324
4347
|
});
|
|
4325
|
-
function
|
|
4326
|
-
return
|
|
4348
|
+
function ai(i, e, t, r, s, n) {
|
|
4349
|
+
return Z(), G("div", ie({
|
|
4327
4350
|
class: i.$options.name
|
|
4328
4351
|
}, i.$attrs), [
|
|
4329
4352
|
A(i.$slots, "default")
|
|
4330
4353
|
], 16);
|
|
4331
4354
|
}
|
|
4332
|
-
const
|
|
4355
|
+
const li = /* @__PURE__ */ j(oi, [["render", ai]]), hi = C({
|
|
4333
4356
|
name: "tg-marker",
|
|
4334
4357
|
mixins: [w],
|
|
4335
4358
|
inheritAttrs: !1,
|
|
@@ -4346,10 +4369,10 @@ const ni = /* @__PURE__ */ G(ii, [["render", si]]), oi = C({
|
|
|
4346
4369
|
},
|
|
4347
4370
|
setup(i, { attrs: e }) {
|
|
4348
4371
|
return {
|
|
4349
|
-
attrs:
|
|
4372
|
+
attrs: U(e),
|
|
4350
4373
|
marker: void 0,
|
|
4351
|
-
label:
|
|
4352
|
-
info:
|
|
4374
|
+
label: Le(),
|
|
4375
|
+
info: Le()
|
|
4353
4376
|
};
|
|
4354
4377
|
},
|
|
4355
4378
|
watch: {
|
|
@@ -4363,7 +4386,7 @@ const ni = /* @__PURE__ */ G(ii, [["render", si]]), oi = C({
|
|
|
4363
4386
|
i ? this.marker.setIcon(i) : this.recreate();
|
|
4364
4387
|
},
|
|
4365
4388
|
clickable(i) {
|
|
4366
|
-
this.marker instanceof
|
|
4389
|
+
this.marker instanceof ce ? this.recreate() : this.marker.setClickable(i);
|
|
4367
4390
|
},
|
|
4368
4391
|
draggable(i) {
|
|
4369
4392
|
this.marker.setDraggable(i);
|
|
@@ -4375,21 +4398,21 @@ const ni = /* @__PURE__ */ G(ii, [["render", si]]), oi = C({
|
|
|
4375
4398
|
this.recreate();
|
|
4376
4399
|
},
|
|
4377
4400
|
zIndex(i) {
|
|
4378
|
-
this.marker instanceof
|
|
4401
|
+
this.marker instanceof ce ? this.recreate() : this.marker.setZIndex(i);
|
|
4379
4402
|
},
|
|
4380
4403
|
visible(i) {
|
|
4381
4404
|
this.marker.setVisible(i);
|
|
4382
4405
|
}
|
|
4383
4406
|
},
|
|
4384
4407
|
onCreate() {
|
|
4385
|
-
this.marker = this.$map.createMarker(this), this.label && this.marker.setLabel(this.label.overlay), this.$clusterer() ? this.$clusterer().onAddMarker(this.marker) : this.$map.addOverlay(this.marker), this.info && this.info.show && this.info.overlay.open(this.marker),
|
|
4408
|
+
this.marker = this.$map.createMarker(this), this.label && this.marker.setLabel(this.label.overlay), this.$clusterer() ? this.$clusterer().onAddMarker(this.marker) : this.$map.addOverlay(this.marker), this.info && this.info.show && this.info.overlay.open(this.marker), F(this.attrs.listeners, this.marker);
|
|
4386
4409
|
},
|
|
4387
4410
|
onDestroy() {
|
|
4388
4411
|
this.$clusterer() ? this.$clusterer().onRemoveMarker(this.marker) : this.$map.removeOverlay(this.marker);
|
|
4389
4412
|
},
|
|
4390
4413
|
methods: {
|
|
4391
4414
|
$clusterer() {
|
|
4392
|
-
return
|
|
4415
|
+
return pe(this.$parent, jt);
|
|
4393
4416
|
},
|
|
4394
4417
|
onAddLabel(i) {
|
|
4395
4418
|
this.label = i, this.marker && this.marker.setLabel(i.overlay);
|
|
@@ -4408,14 +4431,14 @@ const ni = /* @__PURE__ */ G(ii, [["render", si]]), oi = C({
|
|
|
4408
4431
|
}
|
|
4409
4432
|
}
|
|
4410
4433
|
});
|
|
4411
|
-
function
|
|
4412
|
-
return
|
|
4434
|
+
function ci(i, e, t, r, s, n) {
|
|
4435
|
+
return Z(), G("div", ie({
|
|
4413
4436
|
class: i.$options.name
|
|
4414
4437
|
}, i.attrs.binds), [
|
|
4415
4438
|
A(i.$slots, "default")
|
|
4416
4439
|
], 16);
|
|
4417
4440
|
}
|
|
4418
|
-
const
|
|
4441
|
+
const we = /* @__PURE__ */ j(hi, [["render", ci]]), di = C({
|
|
4419
4442
|
name: "tg-info-box",
|
|
4420
4443
|
mixins: [w],
|
|
4421
4444
|
inheritAttrs: !1,
|
|
@@ -4425,11 +4448,13 @@ const Ce = /* @__PURE__ */ G(oi, [["render", ai]]), li = C({
|
|
|
4425
4448
|
offset: m(Object),
|
|
4426
4449
|
maxWidth: m(Number),
|
|
4427
4450
|
borderClass: m(String),
|
|
4428
|
-
zIndex: m(Number)
|
|
4451
|
+
zIndex: m(Number),
|
|
4452
|
+
"onUpdate:show": N()
|
|
4429
4453
|
},
|
|
4454
|
+
emits: void 0,
|
|
4430
4455
|
setup(i, { attrs: e }) {
|
|
4431
4456
|
return {
|
|
4432
|
-
attrs:
|
|
4457
|
+
attrs: U(e, i),
|
|
4433
4458
|
overlay: void 0
|
|
4434
4459
|
};
|
|
4435
4460
|
},
|
|
@@ -4454,9 +4479,9 @@ const Ce = /* @__PURE__ */ G(oi, [["render", ai]]), li = C({
|
|
|
4454
4479
|
}
|
|
4455
4480
|
},
|
|
4456
4481
|
onCreate() {
|
|
4457
|
-
this.overlay = this.$map.createInfoBox(this.getOptions()), this.$marker() ? this.$marker().onAddInfo(this) : this.show && this.overlay.open(), "update:show" in this.attrs.
|
|
4482
|
+
this.overlay = this.$map.createInfoBox(this.getOptions()), this.$marker() ? this.$marker().onAddInfo(this) : this.show && this.overlay.open(), "update:show" in this.attrs.listenerProps && this.overlay.addEventListener("closeclick", () => {
|
|
4458
4483
|
this.$emit("update:show", !1);
|
|
4459
|
-
}),
|
|
4484
|
+
}), F(this.attrs.listeners, this.overlay);
|
|
4460
4485
|
},
|
|
4461
4486
|
onDestroy() {
|
|
4462
4487
|
this.$marker() ? this.$marker().onRemoveInfo(this) : this.overlay.close();
|
|
@@ -4476,7 +4501,7 @@ const Ce = /* @__PURE__ */ G(oi, [["render", ai]]), li = C({
|
|
|
4476
4501
|
return this.$el;
|
|
4477
4502
|
},
|
|
4478
4503
|
$marker() {
|
|
4479
|
-
return
|
|
4504
|
+
return pe(this.$parent, we);
|
|
4480
4505
|
},
|
|
4481
4506
|
open(i) {
|
|
4482
4507
|
this.overlay.open(i);
|
|
@@ -4486,14 +4511,14 @@ const Ce = /* @__PURE__ */ G(oi, [["render", ai]]), li = C({
|
|
|
4486
4511
|
}
|
|
4487
4512
|
}
|
|
4488
4513
|
});
|
|
4489
|
-
function
|
|
4490
|
-
return
|
|
4514
|
+
function pi(i, e, t, r, s, n) {
|
|
4515
|
+
return Z(), G("div", ie({
|
|
4491
4516
|
class: i.$options.name
|
|
4492
4517
|
}, i.attrs.binds), [
|
|
4493
4518
|
A(i.$slots, "default")
|
|
4494
4519
|
], 16);
|
|
4495
4520
|
}
|
|
4496
|
-
const
|
|
4521
|
+
const ui = /* @__PURE__ */ j(di, [["render", pi]]), gi = C({
|
|
4497
4522
|
name: "tg-info-window",
|
|
4498
4523
|
mixins: [w],
|
|
4499
4524
|
inheritAttrs: !1,
|
|
@@ -4506,7 +4531,7 @@ const ci = /* @__PURE__ */ G(li, [["render", hi]]), di = C({
|
|
|
4506
4531
|
},
|
|
4507
4532
|
setup(i, { attrs: e }) {
|
|
4508
4533
|
return {
|
|
4509
|
-
attrs:
|
|
4534
|
+
attrs: U(e),
|
|
4510
4535
|
overlay: void 0
|
|
4511
4536
|
};
|
|
4512
4537
|
},
|
|
@@ -4532,7 +4557,7 @@ const ci = /* @__PURE__ */ G(li, [["render", hi]]), di = C({
|
|
|
4532
4557
|
return this.$el;
|
|
4533
4558
|
},
|
|
4534
4559
|
$marker() {
|
|
4535
|
-
return
|
|
4560
|
+
return pe(this.$parent, we);
|
|
4536
4561
|
},
|
|
4537
4562
|
getOptions() {
|
|
4538
4563
|
return {
|
|
@@ -4549,22 +4574,22 @@ const ci = /* @__PURE__ */ G(li, [["render", hi]]), di = C({
|
|
|
4549
4574
|
this.$emit("update:show", !0);
|
|
4550
4575
|
}), this.overlay.addEventListener("close", () => {
|
|
4551
4576
|
this.$emit("update:show", !1);
|
|
4552
|
-
}),
|
|
4577
|
+
}), F(this.attrs.listeners, this.overlay);
|
|
4553
4578
|
},
|
|
4554
4579
|
onDestroy() {
|
|
4555
4580
|
this.$marker() ? this.$marker().onRemoveInfo(this) : this.overlay.close();
|
|
4556
4581
|
}
|
|
4557
4582
|
});
|
|
4558
|
-
function
|
|
4559
|
-
return
|
|
4583
|
+
function mi(i, e, t, r, s, n) {
|
|
4584
|
+
return Yt((Z(), G("div", ie({
|
|
4560
4585
|
class: i.$options.name
|
|
4561
4586
|
}, i.attrs.binds), [
|
|
4562
4587
|
A(i.$slots, "default")
|
|
4563
4588
|
], 16)), [
|
|
4564
|
-
[
|
|
4589
|
+
[Kt, i.show]
|
|
4565
4590
|
]);
|
|
4566
4591
|
}
|
|
4567
|
-
const
|
|
4592
|
+
const fi = /* @__PURE__ */ j(gi, [["render", mi]]), yi = C({
|
|
4568
4593
|
name: "tg-label",
|
|
4569
4594
|
mixins: [w],
|
|
4570
4595
|
inheritAttrs: !1,
|
|
@@ -4575,7 +4600,7 @@ const ui = /* @__PURE__ */ G(di, [["render", pi]]), gi = C({
|
|
|
4575
4600
|
},
|
|
4576
4601
|
setup(i, { attrs: e }) {
|
|
4577
4602
|
return {
|
|
4578
|
-
attrs:
|
|
4603
|
+
attrs: U(e),
|
|
4579
4604
|
overlay: void 0
|
|
4580
4605
|
};
|
|
4581
4606
|
},
|
|
@@ -4602,7 +4627,7 @@ const ui = /* @__PURE__ */ G(di, [["render", pi]]), gi = C({
|
|
|
4602
4627
|
return (i = this.$marker()) == null ? void 0 : i.marker;
|
|
4603
4628
|
},
|
|
4604
4629
|
$marker() {
|
|
4605
|
-
return
|
|
4630
|
+
return pe(this.$parent, we);
|
|
4606
4631
|
},
|
|
4607
4632
|
getOptions() {
|
|
4608
4633
|
return {
|
|
@@ -4614,20 +4639,20 @@ const ui = /* @__PURE__ */ G(di, [["render", pi]]), gi = C({
|
|
|
4614
4639
|
}
|
|
4615
4640
|
},
|
|
4616
4641
|
onCreate() {
|
|
4617
|
-
this.overlay = this.$map.createLabel(this.getOptions()), this.$marker() ? this.$marker().onAddLabel(this) : this.$map.addOverlay(this.overlay),
|
|
4642
|
+
this.overlay = this.$map.createLabel(this.getOptions()), this.$marker() ? this.$marker().onAddLabel(this) : this.$map.addOverlay(this.overlay), F(this.attrs.listeners, this.overlay);
|
|
4618
4643
|
},
|
|
4619
4644
|
onDestroy() {
|
|
4620
4645
|
this.$marker() ? this.$marker().onRemoveLabel(this) : this.$map.removeOverlay(this.overlay);
|
|
4621
4646
|
}
|
|
4622
4647
|
});
|
|
4623
|
-
function
|
|
4624
|
-
return
|
|
4648
|
+
function vi(i, e, t, r, s, n) {
|
|
4649
|
+
return Z(), G("div", ie({
|
|
4625
4650
|
class: i.$options.name
|
|
4626
4651
|
}, i.attrs.binds), [
|
|
4627
4652
|
A(i.$slots, "default")
|
|
4628
4653
|
], 16);
|
|
4629
4654
|
}
|
|
4630
|
-
const
|
|
4655
|
+
const _i = /* @__PURE__ */ j(yi, [["render", vi]]), Mi = C({
|
|
4631
4656
|
name: "tg-polygon",
|
|
4632
4657
|
mixins: [w],
|
|
4633
4658
|
inheritAttrs: !1,
|
|
@@ -4644,7 +4669,7 @@ const fi = /* @__PURE__ */ G(gi, [["render", mi]]), yi = C({
|
|
|
4644
4669
|
},
|
|
4645
4670
|
setup(i, { attrs: e }) {
|
|
4646
4671
|
return {
|
|
4647
|
-
attrs:
|
|
4672
|
+
attrs: U(e),
|
|
4648
4673
|
polygon: void 0
|
|
4649
4674
|
};
|
|
4650
4675
|
},
|
|
@@ -4681,12 +4706,12 @@ const fi = /* @__PURE__ */ G(gi, [["render", mi]]), yi = C({
|
|
|
4681
4706
|
}
|
|
4682
4707
|
},
|
|
4683
4708
|
onCreate() {
|
|
4684
|
-
this.polygon = this.$map.createPolygon(this), this.$map.addOverlay(this.polygon),
|
|
4709
|
+
this.polygon = this.$map.createPolygon(this), this.$map.addOverlay(this.polygon), F(this.attrs.listeners, this.polygon);
|
|
4685
4710
|
},
|
|
4686
4711
|
onDestroy() {
|
|
4687
4712
|
this.$map.removeOverlay(this.polygon);
|
|
4688
4713
|
}
|
|
4689
|
-
}),
|
|
4714
|
+
}), bi = C({
|
|
4690
4715
|
name: "tg-polyline",
|
|
4691
4716
|
mixins: [w],
|
|
4692
4717
|
inheritAttrs: !1,
|
|
@@ -4701,7 +4726,7 @@ const fi = /* @__PURE__ */ G(gi, [["render", mi]]), yi = C({
|
|
|
4701
4726
|
},
|
|
4702
4727
|
setup(i, { attrs: e }) {
|
|
4703
4728
|
return {
|
|
4704
|
-
attrs:
|
|
4729
|
+
attrs: U(e),
|
|
4705
4730
|
polyline: void 0
|
|
4706
4731
|
};
|
|
4707
4732
|
},
|
|
@@ -4732,19 +4757,19 @@ const fi = /* @__PURE__ */ G(gi, [["render", mi]]), yi = C({
|
|
|
4732
4757
|
}
|
|
4733
4758
|
},
|
|
4734
4759
|
onCreate() {
|
|
4735
|
-
this.polyline = this.$map.createPolyline(this), this.$map.addOverlay(this.polyline),
|
|
4760
|
+
this.polyline = this.$map.createPolyline(this), this.$map.addOverlay(this.polyline), F(this.attrs.listeners, this.polyline);
|
|
4736
4761
|
},
|
|
4737
4762
|
onDestroy() {
|
|
4738
4763
|
this.$map.removeOverlay(this.polyline);
|
|
4739
4764
|
}
|
|
4740
|
-
}),
|
|
4765
|
+
}), Ti = ["beforeUpdate", "updated"], Di = {
|
|
4741
4766
|
install(i, e = {}) {
|
|
4742
4767
|
if (e.enable !== !1) {
|
|
4743
4768
|
const t = C({
|
|
4744
4769
|
beforeCreate() {
|
|
4745
4770
|
const r = this.$options.name || this.$options._componentTag || "", n = (e.nameRegex || /^[A-Z]/).test(r) ? (a) => {
|
|
4746
|
-
e.hookNames ? e.hookNames.includes(a) && console.debug("[lifecycle]", r, a) :
|
|
4747
|
-
} :
|
|
4771
|
+
e.hookNames ? e.hookNames.includes(a) && console.debug("[lifecycle]", r, a) : Ti.includes(a) || console.debug("[lifecycle]", r, a);
|
|
4772
|
+
} : ve;
|
|
4748
4773
|
n("beforeCreate"), this.__life_impl = n;
|
|
4749
4774
|
},
|
|
4750
4775
|
created() {
|
|
@@ -4784,7 +4809,7 @@ const fi = /* @__PURE__ */ G(gi, [["render", mi]]), yi = C({
|
|
|
4784
4809
|
}
|
|
4785
4810
|
}
|
|
4786
4811
|
};
|
|
4787
|
-
var
|
|
4812
|
+
var Mt;
|
|
4788
4813
|
((i) => {
|
|
4789
4814
|
function e(r, s) {
|
|
4790
4815
|
if (r !== void 0)
|
|
@@ -4797,115 +4822,117 @@ var _t;
|
|
|
4797
4822
|
`);
|
|
4798
4823
|
}
|
|
4799
4824
|
i.trimIndent = t;
|
|
4800
|
-
})(
|
|
4801
|
-
const
|
|
4825
|
+
})(Mt || (Mt = {}));
|
|
4826
|
+
const Zi = {
|
|
4802
4827
|
install(i, e) {
|
|
4803
|
-
|
|
4804
|
-
const t = /* @__PURE__ */ Object.assign({ "./TgMap.vue":
|
|
4828
|
+
gr(e);
|
|
4829
|
+
const t = /* @__PURE__ */ Object.assign({ "./TgMap.vue": Gt, "./TgMapWidget.vue": Ur, "./controls/TgCustomControl.vue": qr, "./controls/TgMapTypeControl.vue": Xr, "./controls/TgScaleControl.vue": Jr, "./controls/TgZoomControl.vue": Qr, "./extra/TgMarkerClusterer.vue": jt, "./layers/TgTrafficLayer.vue": ri, "./overlays/TgCircle.vue": ii, "./overlays/TgElementOverlay.vue": li, "./overlays/TgInfoBox.vue": ui, "./overlays/TgInfoWindow.vue": fi, "./overlays/TgLabel.vue": _i, "./overlays/TgMarker.vue": we, "./overlays/TgPolygon.vue": Mi, "./overlays/TgPolyline.vue": bi });
|
|
4805
4830
|
Object.keys(t).forEach((s) => {
|
|
4806
4831
|
const n = t[s];
|
|
4807
4832
|
i.component(n.name ?? x(`Tg开头的组件必须设置name: ${s}`), n);
|
|
4808
4833
|
});
|
|
4809
4834
|
const r = i.config.optionMergeStrategies;
|
|
4810
|
-
r[
|
|
4835
|
+
r[ze] = r[Ne] = (s, n) => s ? [...new Set([].concat(s, n))] : n;
|
|
4811
4836
|
}
|
|
4812
4837
|
};
|
|
4813
4838
|
export {
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4839
|
+
At as AbstractControl,
|
|
4840
|
+
Ze as AbstractMap,
|
|
4841
|
+
be as Arrays,
|
|
4842
|
+
Ke as BaiduCircle,
|
|
4843
|
+
Xe as BaiduControl,
|
|
4844
|
+
ct as BaiduInfoBoxOverlay,
|
|
4845
|
+
ot as BaiduInfoWindow,
|
|
4846
|
+
Qe as BaiduMapTypeControl,
|
|
4847
|
+
ce as BaiduMarker,
|
|
4848
|
+
br as BaiduMarkerClusterer,
|
|
4849
|
+
Ce as BaiduOverlay,
|
|
4850
|
+
Ue as BaiduPolygon,
|
|
4851
|
+
He as BaiduPolyline,
|
|
4852
|
+
rt as BaiduScaleControl,
|
|
4853
|
+
et as BaiduZoomControl,
|
|
4854
|
+
vt as CachedValue,
|
|
4830
4855
|
E as ControlPosition,
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4856
|
+
I as ControlPositionConverter,
|
|
4857
|
+
q as CoordType,
|
|
4858
|
+
wr as CustomControl,
|
|
4859
|
+
Cr as FastFindValues,
|
|
4860
|
+
qe as GoogleCircle,
|
|
4861
|
+
Je as GoogleControl,
|
|
4862
|
+
dt as GoogleInfoBoxOverlay,
|
|
4863
|
+
at as GoogleInfoWindow,
|
|
4864
|
+
fe as GoogleMapTypeControl,
|
|
4865
|
+
st as GoogleMarker,
|
|
4866
|
+
Tr as GoogleMarkerClusterer,
|
|
4867
|
+
je as GoogleOverlay,
|
|
4868
|
+
Ye as GooglePolygon,
|
|
4869
|
+
Fe as GooglePolyline,
|
|
4870
|
+
it as GoogleScaleControl,
|
|
4871
|
+
tt as GoogleZoomControl,
|
|
4872
|
+
te as Icon,
|
|
4873
|
+
nt as InfoWindow,
|
|
4874
|
+
yt as KeyValue,
|
|
4850
4875
|
y as LatLng,
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4876
|
+
V as LatLngBounds,
|
|
4877
|
+
Di as LifecycleLogPlugin,
|
|
4878
|
+
ze as MIXIN_HOOK_CREATE,
|
|
4879
|
+
Ne as MIXIN_HOOK_DESTROY,
|
|
4880
|
+
Zt as MIXIN_MAP_NAME,
|
|
4881
|
+
Te as MVCArrays,
|
|
4857
4882
|
w as MapMixin,
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4883
|
+
Nt as MapTypeControlType,
|
|
4884
|
+
Bt as MarkerClusterer,
|
|
4885
|
+
he as Objects,
|
|
4886
|
+
$t as Overlay,
|
|
4887
|
+
de as Point,
|
|
4888
|
+
Mt as Strings,
|
|
4889
|
+
ii as TgCircle,
|
|
4890
|
+
qr as TgCustomControl,
|
|
4891
|
+
li as TgElementOverlay,
|
|
4892
|
+
ui as TgInfoBox,
|
|
4893
|
+
fi as TgInfoWindow,
|
|
4894
|
+
_i as TgLabel,
|
|
4895
|
+
Gt as TgMap,
|
|
4896
|
+
Ae as TgMapFactory,
|
|
4872
4897
|
$ as TgMapType,
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4898
|
+
Xr as TgMapTypeControl,
|
|
4899
|
+
Ur as TgMapWidget,
|
|
4900
|
+
we as TgMarker,
|
|
4901
|
+
jt as TgMarkerClusterer,
|
|
4902
|
+
Mi as TgPolygon,
|
|
4903
|
+
bi as TgPolyline,
|
|
4904
|
+
Jr as TgScaleControl,
|
|
4905
|
+
ri as TgTrafficLayer,
|
|
4906
|
+
Qr as TgZoomControl,
|
|
4907
|
+
me as callHook,
|
|
4908
|
+
$i as computedSaveOnThis,
|
|
4909
|
+
Dr as createEmptyVNode,
|
|
4910
|
+
Rr as createPropertyObject,
|
|
4911
|
+
Ai as createPropertyObjectTyped,
|
|
4912
|
+
xi as debug,
|
|
4913
|
+
Zi as default,
|
|
4914
|
+
Ri as eventLogMethods,
|
|
4915
|
+
N as eventProp,
|
|
4916
|
+
Ni as extractVNodeFromSlotsByComponent,
|
|
4917
|
+
zi as findByComponentType,
|
|
4918
|
+
xt as getTgMapConfig,
|
|
4919
|
+
Ei as isDef,
|
|
4920
|
+
Pi as isInstanceOf,
|
|
4921
|
+
ki as lateinit,
|
|
4922
|
+
ve as noop,
|
|
4897
4923
|
m as optionalProp,
|
|
4898
4924
|
z as requiredProp,
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4925
|
+
Ii as safeAs,
|
|
4926
|
+
pe as safeAsComponent,
|
|
4927
|
+
gr as setTgMapConfig,
|
|
4928
|
+
Zr as splitAttrs,
|
|
4929
|
+
D as stringEnumProp,
|
|
4930
|
+
Nr as stringUnionPropFromValues,
|
|
4905
4931
|
x as throwError,
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4932
|
+
Qt as throwUnsupported,
|
|
4933
|
+
wi as todo,
|
|
4934
|
+
Le as typed,
|
|
4935
|
+
Li as unwrapStringEnumValue,
|
|
4936
|
+
U as useSplittedAttrs
|
|
4910
4937
|
};
|
|
4911
4938
|
//# sourceMappingURL=tg-map.js.map
|