tg-map-vue3 4.2.1 → 4.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +117 -116
- package/README.md +105 -105
- package/dist/src/components/extra/TgMarkerClusterer.vue.d.ts +2 -0
- package/dist/tg-map.cjs +1 -1
- package/dist/tg-map.cjs.map +1 -1
- package/dist/tg-map.js +132 -128
- package/dist/tg-map.js.map +1 -1
- package/package.json +3 -3
package/dist/tg-map.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { noop as
|
|
2
|
-
import { Strings as
|
|
1
|
+
import { noop as x, typed as O, lateinit as l, path as Q, throwError as w, Arrays as F, deepEqual as ee } from "tg-commons";
|
|
2
|
+
import { Strings as G, TgMapType as D, unwrapStringEnumValue as d, loadCachedMap as te, TgMapFactory as se, BuildInMapTypeId as z, GestureHandlingOptions as W, bindEvents as v, MapType as re, Objects as ie, InfoWindowModeValues as oe, LatLng as y, dimen as ae, ControlPosition as c, CustomControl as ne, MapTypeControlType as le, TrafficLayer as he, MapPane as A, ElementOverlay as de, BaiduMarker as q, setTgMapConfig as pe } from "tg-map-core";
|
|
3
3
|
export * from "tg-map-core";
|
|
4
|
-
import { createCommentVNode as Z, computed as
|
|
4
|
+
import { createCommentVNode as Z, computed as X, defineComponent as n, markRaw as ce, watch as k, createElementBlock as $, openBlock as C, mergeProps as M, createElementVNode as me, renderSlot as f, normalizeClass as L, normalizeStyle as ue, getCurrentInstance as fe, inject as ye, onBeforeUnmount as ve, onMounted as ge, toRaw as B, withDirectives as be, vShow as $e } from "vue";
|
|
5
5
|
import "tg-map-core/dist/tg-map-core.css";
|
|
6
6
|
function u(e, t) {
|
|
7
7
|
return {
|
|
@@ -31,15 +31,15 @@ function s(e, t) {
|
|
|
31
31
|
}
|
|
32
32
|
function Qe(e) {
|
|
33
33
|
const t = {};
|
|
34
|
-
return Object.entries(e).forEach(([r,
|
|
35
|
-
const
|
|
34
|
+
return Object.entries(e).forEach(([r, i]) => {
|
|
35
|
+
const o = `__${r}`;
|
|
36
36
|
t[r] = {
|
|
37
37
|
get() {
|
|
38
|
-
const a = this[
|
|
39
|
-
return a === void 0 ?
|
|
38
|
+
const a = this[o];
|
|
39
|
+
return a === void 0 ? i : a;
|
|
40
40
|
},
|
|
41
41
|
set(a) {
|
|
42
|
-
this[
|
|
42
|
+
this[o] = a;
|
|
43
43
|
}
|
|
44
44
|
// Vue3已经不支持该属性
|
|
45
45
|
// cache: false
|
|
@@ -49,14 +49,14 @@ function Qe(e) {
|
|
|
49
49
|
const T = {
|
|
50
50
|
enumerable: !0,
|
|
51
51
|
configurable: !0,
|
|
52
|
-
get:
|
|
53
|
-
set:
|
|
52
|
+
get: x,
|
|
53
|
+
set: x
|
|
54
54
|
};
|
|
55
55
|
function _e(e) {
|
|
56
56
|
return Object.keys(e).forEach((t) => {
|
|
57
57
|
const r = e[t];
|
|
58
|
-
let
|
|
59
|
-
typeof r == "function" ? (T.get = r, T.set =
|
|
58
|
+
let i = !1;
|
|
59
|
+
typeof r == "function" ? (T.get = r, T.set = x, i = !0) : typeof r == "object" && typeof r.get == "function" && (T.get = r.get, T.set = r.set, i = !0), i && (e[t] = Object.defineProperty(e, t, T));
|
|
60
60
|
}), e;
|
|
61
61
|
}
|
|
62
62
|
function et(e) {
|
|
@@ -65,11 +65,11 @@ function et(e) {
|
|
|
65
65
|
function E() {
|
|
66
66
|
return Z();
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function S(e, t) {
|
|
69
69
|
const r = e.$options[t];
|
|
70
70
|
if (r)
|
|
71
|
-
for (const
|
|
72
|
-
|
|
71
|
+
for (const i of r)
|
|
72
|
+
i.call(e);
|
|
73
73
|
}
|
|
74
74
|
function tt(e, t) {
|
|
75
75
|
for (const r of e)
|
|
@@ -79,68 +79,68 @@ function tt(e, t) {
|
|
|
79
79
|
function st(e, t) {
|
|
80
80
|
if (!e.default) return;
|
|
81
81
|
const r = e.default();
|
|
82
|
-
for (const
|
|
83
|
-
if ((
|
|
84
|
-
return
|
|
82
|
+
for (const i of r)
|
|
83
|
+
if ((i == null ? void 0 : i.type).name === t.name)
|
|
84
|
+
return i;
|
|
85
85
|
}
|
|
86
86
|
function ke(e, t) {
|
|
87
|
-
const r = {},
|
|
87
|
+
const r = {}, i = {}, o = {};
|
|
88
88
|
return Object.keys(e).forEach((a) => {
|
|
89
|
-
a.startsWith("on") ? r[
|
|
89
|
+
a.startsWith("on") ? r[G.pascal2kebab(a.substring(2))] = e[a] : i[a] = e[a];
|
|
90
90
|
}), t && Object.keys(t).forEach((a) => {
|
|
91
|
-
a.startsWith("on") && (
|
|
91
|
+
a.startsWith("on") && (o[G.pascal2kebab(a.substring(2))] = t[a]);
|
|
92
92
|
}), {
|
|
93
93
|
/** class/style/未声明的属性 等 */
|
|
94
|
-
binds:
|
|
94
|
+
binds: i,
|
|
95
95
|
/** 未声明的事件 */
|
|
96
96
|
listeners: r,
|
|
97
97
|
/** 声明在`props`中的事件 */
|
|
98
|
-
listenerProps:
|
|
98
|
+
listenerProps: o
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
101
|
function g(e, t) {
|
|
102
|
-
return
|
|
102
|
+
return X(() => ke(e, t));
|
|
103
103
|
}
|
|
104
104
|
function h() {
|
|
105
105
|
return Function;
|
|
106
106
|
}
|
|
107
107
|
const rt = () => {
|
|
108
108
|
let e, t;
|
|
109
|
-
function r(
|
|
110
|
-
console.log(
|
|
109
|
+
function r(o) {
|
|
110
|
+
console.log(o), e = o && o.type, t = Date.now();
|
|
111
111
|
}
|
|
112
|
-
function o
|
|
113
|
-
((
|
|
112
|
+
function i(o) {
|
|
113
|
+
((o && o.type) !== e || Date.now() - (t ?? 0) > 1e3) && r(o);
|
|
114
114
|
}
|
|
115
|
-
return { eventLog: r, eventLogLess:
|
|
115
|
+
return { eventLog: r, eventLogLess: i };
|
|
116
116
|
};
|
|
117
117
|
function R(e, t) {
|
|
118
118
|
return (e == null ? void 0 : e.$options.name) === t.name;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function K(e, t) {
|
|
121
121
|
return R(e, t) ? e : void 0;
|
|
122
122
|
}
|
|
123
123
|
function U(e, t, r) {
|
|
124
|
-
let
|
|
125
|
-
for (;
|
|
126
|
-
if (R(
|
|
127
|
-
return
|
|
128
|
-
if (r && R(
|
|
124
|
+
let i = t;
|
|
125
|
+
for (; i; ) {
|
|
126
|
+
if (R(i, e))
|
|
127
|
+
return i;
|
|
128
|
+
if (r && R(i, r))
|
|
129
129
|
return;
|
|
130
|
-
|
|
130
|
+
i = i.$parent;
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
const j = "$map",
|
|
133
|
+
const j = "$map", P = "onCreate", I = "onDestroy", p = n({
|
|
134
134
|
inject: [j],
|
|
135
135
|
mounted() {
|
|
136
|
-
|
|
136
|
+
S(this, P);
|
|
137
137
|
},
|
|
138
138
|
beforeUnmount() {
|
|
139
|
-
|
|
139
|
+
S(this, I);
|
|
140
140
|
},
|
|
141
141
|
methods: {
|
|
142
142
|
recreate() {
|
|
143
|
-
|
|
143
|
+
S(this, I), S(this, P);
|
|
144
144
|
}
|
|
145
145
|
},
|
|
146
146
|
render() {
|
|
@@ -181,7 +181,7 @@ const j = "$map", O = "onCreate", P = "onDestroy", p = n({
|
|
|
181
181
|
* 该属性不会响应式更新, 要让它立即生效, 请参考{@link file://./../views/map/InfoDemo.vue#L3}
|
|
182
182
|
* @see MapOptions.infoWindowMode
|
|
183
183
|
*/
|
|
184
|
-
infoWindowMode: Ce(
|
|
184
|
+
infoWindowMode: Ce(oe),
|
|
185
185
|
gestureHandling: u(W),
|
|
186
186
|
fractionalZoom: s(Boolean),
|
|
187
187
|
minZoom: s(Number),
|
|
@@ -203,7 +203,7 @@ const j = "$map", O = "onCreate", P = "onDestroy", p = n({
|
|
|
203
203
|
name: "tg-map",
|
|
204
204
|
provide() {
|
|
205
205
|
return {
|
|
206
|
-
[j]:
|
|
206
|
+
[j]: X(() => this.map)
|
|
207
207
|
};
|
|
208
208
|
},
|
|
209
209
|
inheritAttrs: !1,
|
|
@@ -218,13 +218,13 @@ const j = "$map", O = "onCreate", P = "onDestroy", p = n({
|
|
|
218
218
|
},
|
|
219
219
|
data() {
|
|
220
220
|
return {
|
|
221
|
-
map:
|
|
221
|
+
map: O(),
|
|
222
222
|
isDestroyed: !1
|
|
223
223
|
};
|
|
224
224
|
},
|
|
225
225
|
computed: {
|
|
226
226
|
propsJson() {
|
|
227
|
-
return
|
|
227
|
+
return ie.toJsonSafely(this.$props);
|
|
228
228
|
}
|
|
229
229
|
},
|
|
230
230
|
watch: {
|
|
@@ -265,8 +265,8 @@ const j = "$map", O = "onCreate", P = "onDestroy", p = n({
|
|
|
265
265
|
const e = d(this.type, D);
|
|
266
266
|
try {
|
|
267
267
|
await te(e);
|
|
268
|
-
} catch (
|
|
269
|
-
this.$emit("error",
|
|
268
|
+
} catch (o) {
|
|
269
|
+
this.$emit("error", o);
|
|
270
270
|
return;
|
|
271
271
|
}
|
|
272
272
|
if (this.isDestroyed) {
|
|
@@ -299,12 +299,12 @@ const j = "$map", O = "onCreate", P = "onDestroy", p = n({
|
|
|
299
299
|
() => this.zoom,
|
|
300
300
|
() => this.center
|
|
301
301
|
//
|
|
302
|
-
], ([
|
|
303
|
-
|
|
302
|
+
], ([o, a], [_, Y]) => {
|
|
303
|
+
o !== _ && t.setZoom(o), a !== Y && (t.getCenter().equals(a) || t.setCenter(a));
|
|
304
304
|
}), this.attrs.listenerProps["update:center"]) {
|
|
305
|
-
const
|
|
305
|
+
const o = () => this.$emit("update:center", t.getCenter());
|
|
306
306
|
t.addEventListener("center-changed", () => {
|
|
307
|
-
this.centerSyncDelay > 0 ? (clearTimeout(this.centerSyncTimeoutId), this.centerSyncTimeoutId = setTimeout(
|
|
307
|
+
this.centerSyncDelay > 0 ? (clearTimeout(this.centerSyncTimeoutId), this.centerSyncTimeoutId = setTimeout(o, this.centerSyncDelay)) : o();
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
310
|
this.attrs.listenerProps["update:current-center"] && (this.$emit("update:current-center", this.center), t.addEventListener("center-changed", () => {
|
|
@@ -312,10 +312,10 @@ const j = "$map", O = "onCreate", P = "onDestroy", p = n({
|
|
|
312
312
|
})), this.attrs.listenerProps["update:zoom"] && t.addEventListener("zoom-changed", () => {
|
|
313
313
|
this.$emit("update:zoom", t.getZoom());
|
|
314
314
|
});
|
|
315
|
-
const r = this.attrs.listenerProps["update:map-type"],
|
|
316
|
-
(r ||
|
|
317
|
-
const
|
|
318
|
-
r && this.$emit("update:map-type",
|
|
315
|
+
const r = this.attrs.listenerProps["update:map-type"], i = this.attrs.listenerProps["update:map-type-id"];
|
|
316
|
+
(r || i) && t.addEventListener("map-type-changed", () => {
|
|
317
|
+
const o = t.getMapType();
|
|
318
|
+
r && this.$emit("update:map-type", o), i && this.$emit("update:map-type-id", o.id);
|
|
319
319
|
});
|
|
320
320
|
},
|
|
321
321
|
unmounted() {
|
|
@@ -324,15 +324,15 @@ const j = "$map", O = "onCreate", P = "onDestroy", p = n({
|
|
|
324
324
|
methods: {}
|
|
325
325
|
}), b = (e, t) => {
|
|
326
326
|
const r = e.__vccOpts || e;
|
|
327
|
-
for (const [
|
|
328
|
-
r[
|
|
327
|
+
for (const [i, o] of t)
|
|
328
|
+
r[i] = o;
|
|
329
329
|
return r;
|
|
330
330
|
};
|
|
331
|
-
function Pe(e, t, r,
|
|
332
|
-
return C(), $("div",
|
|
331
|
+
function Pe(e, t, r, i, o, a) {
|
|
332
|
+
return C(), $("div", M({ class: "tg-map" }, e.attrs.binds), [
|
|
333
333
|
me("div", {
|
|
334
334
|
ref: "map",
|
|
335
|
-
class:
|
|
335
|
+
class: L({
|
|
336
336
|
"tg-map__map": !0,
|
|
337
337
|
[`tg-map__map--hide-logo-${e.type}`]: e.hideLogo
|
|
338
338
|
})
|
|
@@ -371,15 +371,15 @@ const N = /* @__PURE__ */ b(Oe, [["render", Pe]]), Ie = n({
|
|
|
371
371
|
dimen: ae
|
|
372
372
|
}
|
|
373
373
|
});
|
|
374
|
-
function
|
|
374
|
+
function Me(e, t, r, i, o, a) {
|
|
375
375
|
return C(), $("div", {
|
|
376
|
-
class:
|
|
376
|
+
class: L(e.$options.name),
|
|
377
377
|
style: ue({ left: e.dimen(e.left), top: e.dimen(e.topValue), right: e.dimen(e.right), bottom: e.dimen(e.bottom) })
|
|
378
378
|
}, [
|
|
379
379
|
f(e.$slots, "default")
|
|
380
380
|
], 6);
|
|
381
381
|
}
|
|
382
|
-
const
|
|
382
|
+
const it = /* @__PURE__ */ b(Ie, [["render", Me]]), we = n({
|
|
383
383
|
name: "tg-custom-control",
|
|
384
384
|
mixins: [p],
|
|
385
385
|
props: {
|
|
@@ -396,7 +396,7 @@ const ot = /* @__PURE__ */ b(Ie, [["render", we]]), Me = n({
|
|
|
396
396
|
}
|
|
397
397
|
},
|
|
398
398
|
onCreate() {
|
|
399
|
-
|
|
399
|
+
K(this.$parent, N) || console.warn("请将tg-custom-control放到tg-map中");
|
|
400
400
|
const { $el: e } = this, t = class extends ne {
|
|
401
401
|
onCreateElement() {
|
|
402
402
|
return e;
|
|
@@ -408,14 +408,14 @@ const ot = /* @__PURE__ */ b(Ie, [["render", we]]), Me = n({
|
|
|
408
408
|
this.$map.removeCustomControl(this.control);
|
|
409
409
|
}
|
|
410
410
|
});
|
|
411
|
-
function Se(e, t, r,
|
|
411
|
+
function Se(e, t, r, i, o, a) {
|
|
412
412
|
return C(), $("div", {
|
|
413
|
-
class:
|
|
413
|
+
class: L(e.$options.name)
|
|
414
414
|
}, [
|
|
415
415
|
f(e.$slots, "default")
|
|
416
416
|
], 2);
|
|
417
417
|
}
|
|
418
|
-
const
|
|
418
|
+
const ot = /* @__PURE__ */ b(we, [["render", Se]]), at = n({
|
|
419
419
|
name: "tg-map-type-control",
|
|
420
420
|
mixins: [p],
|
|
421
421
|
props: {
|
|
@@ -471,32 +471,32 @@ const it = /* @__PURE__ */ b(Me, [["render", Se]]), at = n({
|
|
|
471
471
|
this.$map.removeControl(this.control);
|
|
472
472
|
}
|
|
473
473
|
});
|
|
474
|
-
function
|
|
474
|
+
function J() {
|
|
475
475
|
var r;
|
|
476
476
|
const e = (r = fe()) == null ? void 0 : r.type;
|
|
477
477
|
let t = (e == null ? void 0 : e.name) ?? (e == null ? void 0 : e.__name);
|
|
478
478
|
if (!t) {
|
|
479
|
-
const
|
|
480
|
-
|
|
479
|
+
const i = e == null ? void 0 : e.__file;
|
|
480
|
+
i && (t = Q.basename(i, ".vue"));
|
|
481
481
|
}
|
|
482
482
|
return t;
|
|
483
483
|
}
|
|
484
484
|
function H() {
|
|
485
485
|
const e = ye(j);
|
|
486
486
|
let t, r;
|
|
487
|
-
return e == null && w(`<${
|
|
487
|
+
return e == null && w(`<${J() || "unknown"}>必须作为<tg-map>的子代组件`), {
|
|
488
488
|
mapRef: e,
|
|
489
489
|
/** 读取map对象, 只要放在<tg-map>里面的组件(除#overlay插槽外)都能够立即读取到map对象 */
|
|
490
490
|
get map() {
|
|
491
491
|
return e.value ?? w("map尚未初始化");
|
|
492
492
|
},
|
|
493
493
|
/** 地图元素创建回调 */
|
|
494
|
-
[
|
|
495
|
-
ge(
|
|
494
|
+
[P](i) {
|
|
495
|
+
ge(i), t && w(`${P}只能调用一次`), t = i;
|
|
496
496
|
},
|
|
497
497
|
/** 地图元素销毁回调 */
|
|
498
|
-
[
|
|
499
|
-
ve(
|
|
498
|
+
[I](i) {
|
|
499
|
+
ve(i), r && w(`${I}只能调用一次`), r = i;
|
|
500
500
|
},
|
|
501
501
|
/** 重新创建地图元素 */
|
|
502
502
|
recreate() {
|
|
@@ -511,10 +511,10 @@ const lt = n({
|
|
|
511
511
|
},
|
|
512
512
|
setup(e) {
|
|
513
513
|
let t = l();
|
|
514
|
-
const { map: r, onCreate:
|
|
515
|
-
return
|
|
514
|
+
const { map: r, onCreate: i, onDestroy: o } = H();
|
|
515
|
+
return i(() => {
|
|
516
516
|
t = r.createStreetViewControl(d(e)), r.addControl(t);
|
|
517
|
-
}),
|
|
517
|
+
}), o(() => {
|
|
518
518
|
r.removeControl(t);
|
|
519
519
|
}), k(() => e.position, (a) => {
|
|
520
520
|
t.setPosition(d(a, c));
|
|
@@ -528,10 +528,10 @@ const lt = n({
|
|
|
528
528
|
},
|
|
529
529
|
setup(e) {
|
|
530
530
|
let t = l();
|
|
531
|
-
const { map: r, onCreate:
|
|
532
|
-
return
|
|
531
|
+
const { map: r, onCreate: i, onDestroy: o } = H();
|
|
532
|
+
return i(() => {
|
|
533
533
|
t = r.createZoomControl(d(e)), r.addControl(t);
|
|
534
|
-
}),
|
|
534
|
+
}), o(() => {
|
|
535
535
|
r.removeControl(t);
|
|
536
536
|
}), k(() => e.position, (a) => {
|
|
537
537
|
t.setPosition(d(a, c));
|
|
@@ -549,18 +549,18 @@ const lt = n({
|
|
|
549
549
|
data: m(Array)
|
|
550
550
|
},
|
|
551
551
|
setup(e) {
|
|
552
|
-
const { map: t, onCreate: r, onDestroy:
|
|
553
|
-
let
|
|
552
|
+
const { map: t, onCreate: r, onDestroy: i } = H();
|
|
553
|
+
let o = l();
|
|
554
554
|
return r(() => {
|
|
555
|
-
|
|
556
|
-
}),
|
|
557
|
-
|
|
558
|
-
}), k(() => e.data, (a) =>
|
|
555
|
+
o = t.createHeatmap(e);
|
|
556
|
+
}), i(() => {
|
|
557
|
+
o.remove();
|
|
558
|
+
}), k(() => e.data, (a) => o.setData(a)), k(
|
|
559
559
|
[() => e.maxIntensity, () => e.gradient, () => e.opacity, () => e.radius],
|
|
560
|
-
() =>
|
|
560
|
+
() => o.setOptions(e)
|
|
561
561
|
), E;
|
|
562
562
|
}
|
|
563
|
-
}),
|
|
563
|
+
}), xe = n({
|
|
564
564
|
name: "tg-marker-clusterer",
|
|
565
565
|
mixins: [p],
|
|
566
566
|
// markers从this.$children中读取, 故需要省略(Omit)
|
|
@@ -576,7 +576,8 @@ const lt = n({
|
|
|
576
576
|
setup() {
|
|
577
577
|
return {
|
|
578
578
|
clusterer: l(),
|
|
579
|
-
markers:
|
|
579
|
+
markers: O([]),
|
|
580
|
+
pendingMarkers: O([])
|
|
580
581
|
};
|
|
581
582
|
},
|
|
582
583
|
watch: {
|
|
@@ -609,29 +610,32 @@ const lt = n({
|
|
|
609
610
|
this.clusterer = this.$map.createMarkerClusterer(this);
|
|
610
611
|
},
|
|
611
612
|
onDestroy() {
|
|
612
|
-
this.clusterer.clearMarkers(!0);
|
|
613
|
+
this.clusterer.clearMarkers(!0), this.pendingMarkers = [];
|
|
613
614
|
},
|
|
614
615
|
methods: {
|
|
615
616
|
/** TgMarker有可能在该组件未初始化之前调用, 需要通过该方法判断 */
|
|
616
617
|
isInitiated() {
|
|
617
618
|
return this.clusterer != null;
|
|
618
619
|
},
|
|
620
|
+
performAddMarkers() {
|
|
621
|
+
this.clusterer.addMarkers(this.pendingMarkers), this.pendingMarkers = [];
|
|
622
|
+
},
|
|
619
623
|
onAddMarker(e) {
|
|
620
|
-
this.markers.push(e), this.isInitiated() && this.
|
|
624
|
+
this.markers.push(e), this.isInitiated() && (this.pendingMarkers.length || this.$nextTick(this.performAddMarkers), this.pendingMarkers.push(e));
|
|
621
625
|
},
|
|
622
626
|
onRemoveMarker(e) {
|
|
623
|
-
this.isInitiated() && this.clusterer.removeMarker(e),
|
|
627
|
+
this.isInitiated() && (F.remove(this.pendingMarkers, e) || this.clusterer.removeMarker(e)), F.remove(this.markers, e);
|
|
624
628
|
}
|
|
625
629
|
}
|
|
626
630
|
});
|
|
627
|
-
function
|
|
631
|
+
function Ae(e, t, r, i, o, a) {
|
|
628
632
|
return C(), $("div", {
|
|
629
|
-
class:
|
|
633
|
+
class: L(e.$options.name)
|
|
630
634
|
}, [
|
|
631
635
|
f(e.$slots, "default")
|
|
632
636
|
], 2);
|
|
633
637
|
}
|
|
634
|
-
const
|
|
638
|
+
const Le = /* @__PURE__ */ b(xe, [["render", Ae]]), pt = n({
|
|
635
639
|
name: "tg-traffic-layer",
|
|
636
640
|
mixins: [p],
|
|
637
641
|
// 请直接使用v-if来控制它的显隐
|
|
@@ -734,8 +738,8 @@ const Ae = /* @__PURE__ */ b(Le, [["render", xe]]), pt = n({
|
|
|
734
738
|
}
|
|
735
739
|
});
|
|
736
740
|
class Be extends de {
|
|
737
|
-
constructor(t, r,
|
|
738
|
-
super(t, r), this.content =
|
|
741
|
+
constructor(t, r, i, o) {
|
|
742
|
+
super(t, r), this.content = i, this.position = o;
|
|
739
743
|
}
|
|
740
744
|
onCreate() {
|
|
741
745
|
return this.content;
|
|
@@ -752,7 +756,7 @@ const Ee = n({
|
|
|
752
756
|
name: "tg-element-overlay",
|
|
753
757
|
mixins: [p],
|
|
754
758
|
props: {
|
|
755
|
-
mapPane: u(
|
|
759
|
+
mapPane: u(A, A.overlayMouseTarget),
|
|
756
760
|
position: m(y)
|
|
757
761
|
},
|
|
758
762
|
setup() {
|
|
@@ -780,8 +784,8 @@ const Ee = n({
|
|
|
780
784
|
this.$map.removeElementOverlay(this.overlay);
|
|
781
785
|
}
|
|
782
786
|
});
|
|
783
|
-
function Ne(e, t, r,
|
|
784
|
-
return C(), $("div",
|
|
787
|
+
function Ne(e, t, r, i, o, a) {
|
|
788
|
+
return C(), $("div", M({
|
|
785
789
|
class: e.$options.name
|
|
786
790
|
}, e.$attrs), [
|
|
787
791
|
f(e.$slots, "default")
|
|
@@ -815,8 +819,8 @@ const mt = /* @__PURE__ */ b(Ee, [["render", Ne]]), De = {
|
|
|
815
819
|
return {
|
|
816
820
|
attrs: g(t, e),
|
|
817
821
|
marker: l(),
|
|
818
|
-
labelOverlay:
|
|
819
|
-
info:
|
|
822
|
+
labelOverlay: O(),
|
|
823
|
+
info: O(),
|
|
820
824
|
emittedPosition: void 0,
|
|
821
825
|
autoAddToClustererWhenCreate: e.autoAddToClusterer
|
|
822
826
|
};
|
|
@@ -840,7 +844,7 @@ const mt = /* @__PURE__ */ b(Ee, [["render", Ne]]), De = {
|
|
|
840
844
|
e ? this.marker.setIcon(e) : this.recreate();
|
|
841
845
|
},
|
|
842
846
|
clickable(e) {
|
|
843
|
-
this.marker instanceof
|
|
847
|
+
this.marker instanceof q ? this.recreate() : this.marker.setClickable(e);
|
|
844
848
|
},
|
|
845
849
|
draggable(e) {
|
|
846
850
|
this.marker.setDraggable(e);
|
|
@@ -852,7 +856,7 @@ const mt = /* @__PURE__ */ b(Ee, [["render", Ne]]), De = {
|
|
|
852
856
|
this.recreate();
|
|
853
857
|
},
|
|
854
858
|
zIndex(e) {
|
|
855
|
-
this.marker instanceof
|
|
859
|
+
this.marker instanceof q ? this.recreate() : this.marker.setZIndex(e);
|
|
856
860
|
},
|
|
857
861
|
visible(e) {
|
|
858
862
|
this.marker.setVisible(e);
|
|
@@ -874,7 +878,7 @@ const mt = /* @__PURE__ */ b(Ee, [["render", Ne]]), De = {
|
|
|
874
878
|
},
|
|
875
879
|
methods: {
|
|
876
880
|
$clusterer() {
|
|
877
|
-
return
|
|
881
|
+
return K(this.$parent, Le);
|
|
878
882
|
},
|
|
879
883
|
onAddLabel(e) {
|
|
880
884
|
this.labelOverlay = e, this.marker && this.marker.attachLabelOverlay(e.overlay);
|
|
@@ -893,7 +897,7 @@ const mt = /* @__PURE__ */ b(Ee, [["render", Ne]]), De = {
|
|
|
893
897
|
}
|
|
894
898
|
}
|
|
895
899
|
});
|
|
896
|
-
function We(e, t, r,
|
|
900
|
+
function We(e, t, r, i, o, a) {
|
|
897
901
|
return f(e.$slots, "default");
|
|
898
902
|
}
|
|
899
903
|
const V = /* @__PURE__ */ b(ze, [["render", We]]), Ze = n({
|
|
@@ -974,8 +978,8 @@ const V = /* @__PURE__ */ b(ze, [["render", We]]), Ze = n({
|
|
|
974
978
|
}
|
|
975
979
|
}
|
|
976
980
|
});
|
|
977
|
-
function Re(e, t, r,
|
|
978
|
-
return C(), $("div",
|
|
981
|
+
function Re(e, t, r, i, o, a) {
|
|
982
|
+
return C(), $("div", M({
|
|
979
983
|
class: e.$options.name
|
|
980
984
|
}, e.attrs.binds), [
|
|
981
985
|
f(e.$slots, "default")
|
|
@@ -1045,8 +1049,8 @@ const ut = /* @__PURE__ */ b(Ze, [["render", Re]]), Ue = n({
|
|
|
1045
1049
|
this.$marker() ? this.$marker().onRemoveInfo(this) : this.overlay.close();
|
|
1046
1050
|
}
|
|
1047
1051
|
});
|
|
1048
|
-
function je(e, t, r,
|
|
1049
|
-
return be((C(), $("div",
|
|
1052
|
+
function je(e, t, r, i, o, a) {
|
|
1053
|
+
return be((C(), $("div", M({
|
|
1050
1054
|
class: e.$options.name
|
|
1051
1055
|
}, e.attrs.binds), [
|
|
1052
1056
|
f(e.$slots, "default")
|
|
@@ -1062,7 +1066,7 @@ const ft = /* @__PURE__ */ b(Ue, [["render", je]]), He = n({
|
|
|
1062
1066
|
position: s(y),
|
|
1063
1067
|
offset: s(Object),
|
|
1064
1068
|
zIndex: s(Number),
|
|
1065
|
-
mapPane: u(
|
|
1069
|
+
mapPane: u(A)
|
|
1066
1070
|
},
|
|
1067
1071
|
emits: void 0,
|
|
1068
1072
|
setup(e, { attrs: t }) {
|
|
@@ -1105,7 +1109,7 @@ const ft = /* @__PURE__ */ b(Ue, [["render", je]]), He = n({
|
|
|
1105
1109
|
position: this.position,
|
|
1106
1110
|
offset: this.offset,
|
|
1107
1111
|
zIndex: this.zIndex,
|
|
1108
|
-
mapPane: d(this.mapPane,
|
|
1112
|
+
mapPane: d(this.mapPane, A)
|
|
1109
1113
|
};
|
|
1110
1114
|
}
|
|
1111
1115
|
},
|
|
@@ -1116,8 +1120,8 @@ const ft = /* @__PURE__ */ b(Ue, [["render", je]]), He = n({
|
|
|
1116
1120
|
this.$marker() ? this.$marker().onRemoveLabel(this) : this.$map.removeOverlay(this.overlay);
|
|
1117
1121
|
}
|
|
1118
1122
|
});
|
|
1119
|
-
function Ve(e, t, r,
|
|
1120
|
-
return C(), $("div",
|
|
1123
|
+
function Ve(e, t, r, i, o, a) {
|
|
1124
|
+
return C(), $("div", M({
|
|
1121
1125
|
class: e.$options.name
|
|
1122
1126
|
}, e.attrs.binds), [
|
|
1123
1127
|
f(e.$slots, "default")
|
|
@@ -1153,7 +1157,7 @@ const yt = /* @__PURE__ */ b(He, [["render", Ve]]), Fe = {
|
|
|
1153
1157
|
handler(e) {
|
|
1154
1158
|
if (this.emittedPaths != null) {
|
|
1155
1159
|
const t = this.emittedPaths;
|
|
1156
|
-
if (this.emittedPaths = void 0, t.length === e.length && t.every((r,
|
|
1160
|
+
if (this.emittedPaths = void 0, t.length === e.length && t.every((r, i) => r === B(e[i])))
|
|
1157
1161
|
return;
|
|
1158
1162
|
}
|
|
1159
1163
|
this.overlay.setPaths(e);
|
|
@@ -1343,9 +1347,9 @@ const yt = /* @__PURE__ */ b(He, [["render", Ve]]), Fe = {
|
|
|
1343
1347
|
if (t.enable !== !1) {
|
|
1344
1348
|
const r = n({
|
|
1345
1349
|
beforeCreate() {
|
|
1346
|
-
const
|
|
1347
|
-
t.hookNames ? t.hookNames.includes(_) && console.debug("[lifecycle]",
|
|
1348
|
-
} :
|
|
1350
|
+
const i = J() ?? "", a = (t.nameRegex || /^[A-Z]/).test(i) ? (_) => {
|
|
1351
|
+
t.hookNames ? t.hookNames.includes(_) && console.debug("[lifecycle]", i, _) : Ge.includes(_) || console.debug("[lifecycle]", i, _);
|
|
1352
|
+
} : x;
|
|
1349
1353
|
a("beforeCreate"), this.__life_impl = a;
|
|
1350
1354
|
},
|
|
1351
1355
|
created() {
|
|
@@ -1370,8 +1374,8 @@ const yt = /* @__PURE__ */ b(He, [["render", Ve]]), Fe = {
|
|
|
1370
1374
|
this.__life("unmounted");
|
|
1371
1375
|
},
|
|
1372
1376
|
methods: {
|
|
1373
|
-
__life(
|
|
1374
|
-
this.__life_impl(
|
|
1377
|
+
__life(i) {
|
|
1378
|
+
this.__life_impl(i);
|
|
1375
1379
|
}
|
|
1376
1380
|
},
|
|
1377
1381
|
onCreate() {
|
|
@@ -1388,17 +1392,17 @@ const yt = /* @__PURE__ */ b(He, [["render", Ve]]), Fe = {
|
|
|
1388
1392
|
install(e, t) {
|
|
1389
1393
|
pe(t);
|
|
1390
1394
|
const r = e.config.optionMergeStrategies;
|
|
1391
|
-
r[
|
|
1395
|
+
r[P] = r[I] = (i, o) => i ? [...new Set([].concat(i, o))] : Array.isArray(o) ? o : [o];
|
|
1392
1396
|
}
|
|
1393
1397
|
};
|
|
1394
1398
|
export {
|
|
1395
1399
|
$t as LifecycleLogPlugin,
|
|
1396
|
-
|
|
1397
|
-
|
|
1400
|
+
P as MIXIN_HOOK_CREATE,
|
|
1401
|
+
I as MIXIN_HOOK_DESTROY,
|
|
1398
1402
|
j as MIXIN_MAP_NAME,
|
|
1399
1403
|
p as MapMixin,
|
|
1400
1404
|
ct as TgCircle,
|
|
1401
|
-
|
|
1405
|
+
ot as TgCustomControl,
|
|
1402
1406
|
mt as TgElementOverlay,
|
|
1403
1407
|
dt as TgHeatmap,
|
|
1404
1408
|
ut as TgInfoBox,
|
|
@@ -1406,9 +1410,9 @@ export {
|
|
|
1406
1410
|
yt as TgLabel,
|
|
1407
1411
|
N as TgMap,
|
|
1408
1412
|
at as TgMapTypeControl,
|
|
1409
|
-
|
|
1413
|
+
it as TgMapWidget,
|
|
1410
1414
|
V as TgMarker,
|
|
1411
|
-
|
|
1415
|
+
Le as TgMarkerClusterer,
|
|
1412
1416
|
vt as TgPolygon,
|
|
1413
1417
|
gt as TgPolyline,
|
|
1414
1418
|
bt as TgRectangle,
|
|
@@ -1416,7 +1420,7 @@ export {
|
|
|
1416
1420
|
lt as TgStreetViewControl,
|
|
1417
1421
|
pt as TgTrafficLayer,
|
|
1418
1422
|
ht as TgZoomControl,
|
|
1419
|
-
|
|
1423
|
+
S as callHook,
|
|
1420
1424
|
Qe as computedSaveOnThis,
|
|
1421
1425
|
E as createEmptyVNode,
|
|
1422
1426
|
_e as createPropertyObject,
|
|
@@ -1429,7 +1433,7 @@ export {
|
|
|
1429
1433
|
R as isComponentByType,
|
|
1430
1434
|
s as optionalProp,
|
|
1431
1435
|
m as requiredProp,
|
|
1432
|
-
|
|
1436
|
+
K as safeAsComponent,
|
|
1433
1437
|
ke as splitAttrs,
|
|
1434
1438
|
u as stringEnumProp,
|
|
1435
1439
|
Ce as stringUnionPropFromValues,
|