tg-map-vue3 4.2.7 → 4.2.8
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/tg-map.cjs +1 -1
- package/dist/tg-map.cjs.map +1 -1
- package/dist/tg-map.js +129 -128
- package/dist/tg-map.js.map +1 -1
- package/package.json +2 -2
package/dist/tg-map.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { noop as x, typed as O, lateinit as l, path as te, throwError as w, Arrays as V, deepEqual as se } from "tg-commons";
|
|
2
|
-
import { Strings as G, TgMapType as D, unwrapStringEnumValue as d, loadCachedMap as
|
|
2
|
+
import { Strings as G, TgMapType as D, unwrapStringEnumValue as d, loadCachedMap as ie, TgMapFactory as re, BuildInMapTypeId as z, GestureHandlingOptions as W, bindEvents as v, MapType as oe, Objects as ae, InfoWindowModeValues as ne, LatLng as y, dimen as le, ControlPosition as m, CustomControl as he, MapTypeControlType as de, TrafficLayer as pe, MapPane as A, ElementOverlay as me, BaiduMarker as q, GoogleMap as X, wrapComponentElementForGoogle as K, setTgMapConfig as ce } from "tg-map-core";
|
|
3
3
|
export * from "tg-map-core";
|
|
4
4
|
import { createCommentVNode as Z, computed as J, defineComponent as n, markRaw as ue, watch as k, createElementBlock as b, openBlock as C, mergeProps as M, createElementVNode as fe, renderSlot as f, normalizeClass as L, normalizeStyle as ye, getCurrentInstance as ve, inject as ge, onBeforeUnmount as $e, onMounted as be, toRaw as B, withDirectives as Ce, vShow as _e } from "vue";
|
|
5
5
|
import "tg-map-core/dist/tg-map-core.css";
|
|
@@ -7,17 +7,17 @@ function u(e, t) {
|
|
|
7
7
|
return {
|
|
8
8
|
type: String,
|
|
9
9
|
default: t,
|
|
10
|
-
validator: (
|
|
10
|
+
validator: (i) => Object.values(e).includes(i)
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
function ke(e, t) {
|
|
14
14
|
return {
|
|
15
15
|
type: String,
|
|
16
16
|
default: t,
|
|
17
|
-
validator: (
|
|
17
|
+
validator: (i) => e.includes(i)
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function c(e) {
|
|
21
21
|
return {
|
|
22
22
|
type: e,
|
|
23
23
|
required: !0
|
|
@@ -31,12 +31,12 @@ function s(e, t) {
|
|
|
31
31
|
}
|
|
32
32
|
function tt(e) {
|
|
33
33
|
const t = {};
|
|
34
|
-
return Object.entries(e).forEach(([
|
|
35
|
-
const o = `__${
|
|
36
|
-
t[
|
|
34
|
+
return Object.entries(e).forEach(([i, r]) => {
|
|
35
|
+
const o = `__${i}`;
|
|
36
|
+
t[i] = {
|
|
37
37
|
get() {
|
|
38
38
|
const a = this[o];
|
|
39
|
-
return a === void 0 ?
|
|
39
|
+
return a === void 0 ? r : a;
|
|
40
40
|
},
|
|
41
41
|
set(a) {
|
|
42
42
|
this[o] = a;
|
|
@@ -54,9 +54,9 @@ const T = {
|
|
|
54
54
|
};
|
|
55
55
|
function Te(e) {
|
|
56
56
|
return Object.keys(e).forEach((t) => {
|
|
57
|
-
const
|
|
58
|
-
let
|
|
59
|
-
typeof
|
|
57
|
+
const i = e[t];
|
|
58
|
+
let r = !1;
|
|
59
|
+
typeof i == "function" ? (T.get = i, T.set = x, r = !0) : typeof i == "object" && typeof i.get == "function" && (T.get = i.get, T.set = i.set, r = !0), r && (e[t] = Object.defineProperty(e, t, T));
|
|
60
60
|
}), e;
|
|
61
61
|
}
|
|
62
62
|
function st(e) {
|
|
@@ -66,34 +66,34 @@ function E() {
|
|
|
66
66
|
return Z();
|
|
67
67
|
}
|
|
68
68
|
function S(e, t) {
|
|
69
|
-
const
|
|
70
|
-
if (
|
|
71
|
-
for (const
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
function rt(e, t) {
|
|
75
|
-
for (const r of e)
|
|
76
|
-
if (r.$options.name === t.name)
|
|
77
|
-
return r;
|
|
69
|
+
const i = e.$options[t];
|
|
70
|
+
if (i)
|
|
71
|
+
for (const r of i)
|
|
72
|
+
r.call(e);
|
|
78
73
|
}
|
|
79
74
|
function it(e, t) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
for (const i of r)
|
|
83
|
-
if ((i == null ? void 0 : i.type).name === t.name)
|
|
75
|
+
for (const i of e)
|
|
76
|
+
if (i.$options.name === t.name)
|
|
84
77
|
return i;
|
|
85
78
|
}
|
|
79
|
+
function rt(e, t) {
|
|
80
|
+
if (!e.default) return;
|
|
81
|
+
const i = e.default();
|
|
82
|
+
for (const r of i)
|
|
83
|
+
if ((r == null ? void 0 : r.type).name === t.name)
|
|
84
|
+
return r;
|
|
85
|
+
}
|
|
86
86
|
function Oe(e, t) {
|
|
87
|
-
const
|
|
87
|
+
const i = {}, r = {}, o = {};
|
|
88
88
|
return Object.keys(e).forEach((a) => {
|
|
89
|
-
a.startsWith("on") ?
|
|
89
|
+
a.startsWith("on") ? i[G.pascal2kebab(a.substring(2))] = e[a] : r[a] = e[a];
|
|
90
90
|
}), t && Object.keys(t).forEach((a) => {
|
|
91
91
|
a.startsWith("on") && (o[G.pascal2kebab(a.substring(2))] = t[a]);
|
|
92
92
|
}), {
|
|
93
93
|
/** class/style/未声明的属性 等 */
|
|
94
|
-
binds:
|
|
94
|
+
binds: r,
|
|
95
95
|
/** 未声明的事件 */
|
|
96
|
-
listeners:
|
|
96
|
+
listeners: i,
|
|
97
97
|
/** 声明在`props`中的事件 */
|
|
98
98
|
listenerProps: o
|
|
99
99
|
};
|
|
@@ -106,13 +106,13 @@ function h() {
|
|
|
106
106
|
}
|
|
107
107
|
const ot = () => {
|
|
108
108
|
let e, t;
|
|
109
|
-
function
|
|
109
|
+
function i(o) {
|
|
110
110
|
console.log(o), e = o && o.type, t = Date.now();
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
((o && o.type) !== e || Date.now() - (t ?? 0) > 1e3) &&
|
|
112
|
+
function r(o) {
|
|
113
|
+
((o && o.type) !== e || Date.now() - (t ?? 0) > 1e3) && i(o);
|
|
114
114
|
}
|
|
115
|
-
return { eventLog:
|
|
115
|
+
return { eventLog: i, eventLogLess: r };
|
|
116
116
|
};
|
|
117
117
|
function R(e, t) {
|
|
118
118
|
return (e == null ? void 0 : e.$options.name) === t.name;
|
|
@@ -120,14 +120,14 @@ function R(e, t) {
|
|
|
120
120
|
function Y(e, t) {
|
|
121
121
|
return R(e, t) ? e : void 0;
|
|
122
122
|
}
|
|
123
|
-
function U(e, t,
|
|
124
|
-
let
|
|
125
|
-
for (;
|
|
126
|
-
if (R(
|
|
127
|
-
return
|
|
128
|
-
if (
|
|
123
|
+
function U(e, t, i) {
|
|
124
|
+
let r = t;
|
|
125
|
+
for (; r; ) {
|
|
126
|
+
if (R(r, e))
|
|
127
|
+
return r;
|
|
128
|
+
if (i && R(r, i))
|
|
129
129
|
return;
|
|
130
|
-
|
|
130
|
+
r = r.$parent;
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
const j = "$map", P = "onCreate", I = "onDestroy", p = n({
|
|
@@ -157,7 +157,7 @@ const j = "$map", P = "onCreate", I = "onDestroy", p = n({
|
|
|
157
157
|
* - :last-center.sync="center": 获取tg-map销毁时的最后的center的值, 使用这种方式可以做到type切换时保留中心点位置
|
|
158
158
|
* @see AbstractMapEventMap.center-changed
|
|
159
159
|
*/
|
|
160
|
-
center:
|
|
160
|
+
center: c(y),
|
|
161
161
|
/**
|
|
162
162
|
* 同步center的延时
|
|
163
163
|
* @default 300
|
|
@@ -176,7 +176,7 @@ const j = "$map", P = "onCreate", I = "onDestroy", p = n({
|
|
|
176
176
|
* @deprecated 用的太少, 故maptalks未实现该属性
|
|
177
177
|
*/
|
|
178
178
|
lastCenter: s(y),
|
|
179
|
-
zoom:
|
|
179
|
+
zoom: c(Number),
|
|
180
180
|
/**
|
|
181
181
|
* 该属性不会响应式更新, 要让它立即生效, 请参考{@link file://./../views/map/InfoDemo.vue#L3}
|
|
182
182
|
* @see MapOptions.infoWindowMode
|
|
@@ -264,7 +264,7 @@ const j = "$map", P = "onCreate", I = "onDestroy", p = n({
|
|
|
264
264
|
async mounted() {
|
|
265
265
|
const e = d(this.type, D);
|
|
266
266
|
try {
|
|
267
|
-
await
|
|
267
|
+
await ie(e);
|
|
268
268
|
} catch (o) {
|
|
269
269
|
this.$emit("error", o);
|
|
270
270
|
return;
|
|
@@ -273,7 +273,7 @@ const j = "$map", P = "onCreate", I = "onDestroy", p = n({
|
|
|
273
273
|
console.warn(`tg-map(type=${e})已销毁, 不需要继续执行`);
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
276
|
-
const t =
|
|
276
|
+
const t = re.createMap(
|
|
277
277
|
e,
|
|
278
278
|
this.$refs.map,
|
|
279
279
|
/* options: */
|
|
@@ -293,6 +293,7 @@ const j = "$map", P = "onCreate", I = "onDestroy", p = n({
|
|
|
293
293
|
if (this.map = ue(t), this.mapType && t.setMapType(this.mapType), "ready" in this.attrs.listeners && console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"), v(
|
|
294
294
|
this.attrs.listeners,
|
|
295
295
|
t,
|
|
296
|
+
this.$emit,
|
|
296
297
|
/* excludes: */
|
|
297
298
|
["load"]
|
|
298
299
|
), this.$emit("load", t), k([
|
|
@@ -312,10 +313,10 @@ const j = "$map", P = "onCreate", I = "onDestroy", p = n({
|
|
|
312
313
|
})), this.attrs.listenerProps["update:zoom"] && t.addEventListener("zoom-changed", () => {
|
|
313
314
|
this.$emit("update:zoom", t.getZoom());
|
|
314
315
|
});
|
|
315
|
-
const
|
|
316
|
-
(
|
|
316
|
+
const i = this.attrs.listenerProps["update:map-type"], r = this.attrs.listenerProps["update:map-type-id"];
|
|
317
|
+
(i || r) && t.addEventListener("map-type-changed", () => {
|
|
317
318
|
const o = t.getMapType();
|
|
318
|
-
|
|
319
|
+
i && this.$emit("update:map-type", o), r && this.$emit("update:map-type-id", o.id);
|
|
319
320
|
});
|
|
320
321
|
},
|
|
321
322
|
unmounted() {
|
|
@@ -323,12 +324,12 @@ const j = "$map", P = "onCreate", I = "onDestroy", p = n({
|
|
|
323
324
|
},
|
|
324
325
|
methods: {}
|
|
325
326
|
}), $ = (e, t) => {
|
|
326
|
-
const
|
|
327
|
-
for (const [
|
|
328
|
-
r
|
|
329
|
-
return
|
|
327
|
+
const i = e.__vccOpts || e;
|
|
328
|
+
for (const [r, o] of t)
|
|
329
|
+
i[r] = o;
|
|
330
|
+
return i;
|
|
330
331
|
};
|
|
331
|
-
function Me(e, t,
|
|
332
|
+
function Me(e, t, i, r, o, a) {
|
|
332
333
|
return C(), b("div", M({ class: "tg-map" }, e.attrs.binds), [
|
|
333
334
|
fe("div", {
|
|
334
335
|
ref: "map",
|
|
@@ -371,7 +372,7 @@ const N = /* @__PURE__ */ $(Ie, [["render", Me]]), we = n({
|
|
|
371
372
|
dimen: le
|
|
372
373
|
}
|
|
373
374
|
});
|
|
374
|
-
function Se(e, t,
|
|
375
|
+
function Se(e, t, i, r, o, a) {
|
|
375
376
|
return C(), b("div", {
|
|
376
377
|
class: L(e.$options.name),
|
|
377
378
|
style: ye({ left: e.dimen(e.left), top: e.dimen(e.topValue), right: e.dimen(e.right), bottom: e.dimen(e.bottom) })
|
|
@@ -383,7 +384,7 @@ const at = /* @__PURE__ */ $(we, [["render", Se]]), xe = n({
|
|
|
383
384
|
name: "tg-custom-control",
|
|
384
385
|
mixins: [p],
|
|
385
386
|
props: {
|
|
386
|
-
position: u(
|
|
387
|
+
position: u(m, m.RIGHT_BOTTOM)
|
|
387
388
|
},
|
|
388
389
|
setup() {
|
|
389
390
|
return {
|
|
@@ -402,13 +403,13 @@ const at = /* @__PURE__ */ $(we, [["render", Se]]), xe = n({
|
|
|
402
403
|
return e;
|
|
403
404
|
}
|
|
404
405
|
};
|
|
405
|
-
this.control = new t(d(this.position,
|
|
406
|
+
this.control = new t(d(this.position, m)), this.$map.addCustomControl(this.control);
|
|
406
407
|
},
|
|
407
408
|
onDestroy() {
|
|
408
409
|
this.$map.removeCustomControl(this.control);
|
|
409
410
|
}
|
|
410
411
|
});
|
|
411
|
-
function Ae(e, t,
|
|
412
|
+
function Ae(e, t, i, r, o, a) {
|
|
412
413
|
return C(), b("div", {
|
|
413
414
|
class: L(e.$options.name)
|
|
414
415
|
}, [
|
|
@@ -419,7 +420,7 @@ const nt = /* @__PURE__ */ $(xe, [["render", Ae]]), lt = n({
|
|
|
419
420
|
name: "tg-map-type-control",
|
|
420
421
|
mixins: [p],
|
|
421
422
|
props: {
|
|
422
|
-
position: u(
|
|
423
|
+
position: u(m, m.TOP_LEFT),
|
|
423
424
|
type: u(de),
|
|
424
425
|
mapTypes: s(Array)
|
|
425
426
|
},
|
|
@@ -452,7 +453,7 @@ const nt = /* @__PURE__ */ $(xe, [["render", Ae]]), lt = n({
|
|
|
452
453
|
name: "tg-scale-control",
|
|
453
454
|
mixins: [p],
|
|
454
455
|
props: {
|
|
455
|
-
position: u(
|
|
456
|
+
position: u(m, m.BOTTOM_RIGHT)
|
|
456
457
|
},
|
|
457
458
|
setup() {
|
|
458
459
|
return {
|
|
@@ -472,18 +473,18 @@ const nt = /* @__PURE__ */ $(xe, [["render", Ae]]), lt = n({
|
|
|
472
473
|
}
|
|
473
474
|
});
|
|
474
475
|
function Q() {
|
|
475
|
-
var
|
|
476
|
-
const e = (
|
|
476
|
+
var i;
|
|
477
|
+
const e = (i = ve()) == null ? void 0 : i.type;
|
|
477
478
|
let t = (e == null ? void 0 : e.name) ?? (e == null ? void 0 : e.__name);
|
|
478
479
|
if (!t) {
|
|
479
|
-
const
|
|
480
|
-
|
|
480
|
+
const r = e == null ? void 0 : e.__file;
|
|
481
|
+
r && (t = te.basename(r, ".vue"));
|
|
481
482
|
}
|
|
482
483
|
return t;
|
|
483
484
|
}
|
|
484
485
|
function F() {
|
|
485
486
|
const e = ge(j);
|
|
486
|
-
let t,
|
|
487
|
+
let t, i;
|
|
487
488
|
return e == null && w(`<${Q() || "unknown"}>必须作为<tg-map>的子代组件`), {
|
|
488
489
|
mapRef: e,
|
|
489
490
|
/** 读取map对象, 只要放在<tg-map>里面的组件(除#overlay插槽外)都能够立即读取到map对象 */
|
|
@@ -491,69 +492,69 @@ function F() {
|
|
|
491
492
|
return e.value ?? w("map尚未初始化");
|
|
492
493
|
},
|
|
493
494
|
/** 地图元素创建回调 */
|
|
494
|
-
[P](
|
|
495
|
-
be(
|
|
495
|
+
[P](r) {
|
|
496
|
+
be(r), t && w(`${P}只能调用一次`), t = r;
|
|
496
497
|
},
|
|
497
498
|
/** 地图元素销毁回调 */
|
|
498
|
-
[I](
|
|
499
|
-
$e(
|
|
499
|
+
[I](r) {
|
|
500
|
+
$e(r), i && w(`${I}只能调用一次`), i = r;
|
|
500
501
|
},
|
|
501
502
|
/** 重新创建地图元素 */
|
|
502
503
|
recreate() {
|
|
503
|
-
|
|
504
|
+
i == null || i(), t == null || t();
|
|
504
505
|
}
|
|
505
506
|
};
|
|
506
507
|
}
|
|
507
508
|
const dt = n({
|
|
508
509
|
name: "tg-street-view-control",
|
|
509
510
|
props: {
|
|
510
|
-
position: u(
|
|
511
|
+
position: u(m, m.RIGHT_BOTTOM)
|
|
511
512
|
},
|
|
512
513
|
setup(e) {
|
|
513
514
|
let t = l();
|
|
514
|
-
const { map:
|
|
515
|
-
return
|
|
516
|
-
t =
|
|
515
|
+
const { map: i, onCreate: r, onDestroy: o } = F();
|
|
516
|
+
return r(() => {
|
|
517
|
+
t = i.createStreetViewControl(d(e)), i.addControl(t);
|
|
517
518
|
}), o(() => {
|
|
518
|
-
|
|
519
|
+
i.removeControl(t);
|
|
519
520
|
}), k(() => e.position, (a) => {
|
|
520
|
-
t.setPosition(d(a,
|
|
521
|
+
t.setPosition(d(a, m));
|
|
521
522
|
}), E;
|
|
522
523
|
}
|
|
523
524
|
}), pt = n({
|
|
524
525
|
name: "tg-zoom-control",
|
|
525
526
|
props: {
|
|
526
|
-
position: u(
|
|
527
|
+
position: u(m, m.RIGHT_BOTTOM),
|
|
527
528
|
showZoomLevel: s(Boolean)
|
|
528
529
|
},
|
|
529
530
|
setup(e) {
|
|
530
531
|
let t = l();
|
|
531
|
-
const { map:
|
|
532
|
-
return
|
|
533
|
-
t =
|
|
532
|
+
const { map: i, onCreate: r, onDestroy: o } = F();
|
|
533
|
+
return r(() => {
|
|
534
|
+
t = i.createZoomControl(d(e)), i.addControl(t);
|
|
534
535
|
}), o(() => {
|
|
535
|
-
|
|
536
|
+
i.removeControl(t);
|
|
536
537
|
}), k(() => e.position, (a) => {
|
|
537
|
-
t.setPosition(d(a,
|
|
538
|
+
t.setPosition(d(a, m));
|
|
538
539
|
}), k(() => e.showZoomLevel, (a) => {
|
|
539
540
|
t.setShowZoomLevel(a ?? !0);
|
|
540
541
|
}), E;
|
|
541
542
|
}
|
|
542
|
-
}),
|
|
543
|
+
}), mt = n({
|
|
543
544
|
name: "tg-heatmap",
|
|
544
545
|
props: {
|
|
545
546
|
maxIntensity: s(Number),
|
|
546
547
|
gradient: s(Object),
|
|
547
548
|
opacity: s(Number),
|
|
548
549
|
radius: s(Number),
|
|
549
|
-
data:
|
|
550
|
+
data: c(Array)
|
|
550
551
|
},
|
|
551
552
|
setup(e) {
|
|
552
|
-
const { map: t, onCreate:
|
|
553
|
+
const { map: t, onCreate: i, onDestroy: r } = F();
|
|
553
554
|
let o = l();
|
|
554
|
-
return
|
|
555
|
+
return i(() => {
|
|
555
556
|
o = t.createHeatmap(e);
|
|
556
|
-
}),
|
|
557
|
+
}), r(() => {
|
|
557
558
|
o.remove();
|
|
558
559
|
}), k(() => e.data, (a) => o.setData(a)), k(
|
|
559
560
|
[() => e.maxIntensity, () => e.gradient, () => e.opacity, () => e.radius],
|
|
@@ -628,14 +629,14 @@ const dt = n({
|
|
|
628
629
|
}
|
|
629
630
|
}
|
|
630
631
|
});
|
|
631
|
-
function Be(e, t,
|
|
632
|
+
function Be(e, t, i, r, o, a) {
|
|
632
633
|
return C(), b("div", {
|
|
633
634
|
class: L(e.$options.name)
|
|
634
635
|
}, [
|
|
635
636
|
f(e.$slots, "default")
|
|
636
637
|
], 2);
|
|
637
638
|
}
|
|
638
|
-
const Ee = /* @__PURE__ */ $(Le, [["render", Be]]),
|
|
639
|
+
const Ee = /* @__PURE__ */ $(Le, [["render", Be]]), ct = n({
|
|
639
640
|
name: "tg-traffic-layer",
|
|
640
641
|
mixins: [p],
|
|
641
642
|
// 请直接使用v-if来控制它的显隐
|
|
@@ -658,8 +659,8 @@ const Ee = /* @__PURE__ */ $(Le, [["render", Be]]), mt = n({
|
|
|
658
659
|
mixins: [p],
|
|
659
660
|
inheritAttrs: !1,
|
|
660
661
|
props: {
|
|
661
|
-
center:
|
|
662
|
-
radius:
|
|
662
|
+
center: c(y),
|
|
663
|
+
radius: c(Number),
|
|
663
664
|
clickable: s(Boolean),
|
|
664
665
|
editable: s(Boolean),
|
|
665
666
|
strokeColor: s(String),
|
|
@@ -727,7 +728,7 @@ const Ee = /* @__PURE__ */ $(Le, [["render", Be]]), mt = n({
|
|
|
727
728
|
}
|
|
728
729
|
},
|
|
729
730
|
onCreate() {
|
|
730
|
-
this.overlay = this.$map.createCircle(this), this.$map.addOverlay(this.overlay), v(this.attrs.listeners, this.overlay), this.attrs.listenerProps["update:center"] && this.overlay.addEventListener("center-changed", () => {
|
|
731
|
+
this.overlay = this.$map.createCircle(this), this.$map.addOverlay(this.overlay), v(this.attrs.listeners, this.overlay, this.$emit), this.attrs.listenerProps["update:center"] && this.overlay.addEventListener("center-changed", () => {
|
|
731
732
|
this.$emit("update:center", this.emittedCenter = this.overlay.getCenter());
|
|
732
733
|
}), this.attrs.listenerProps["update:radius"] && this.overlay.addEventListener("radius-changed", () => {
|
|
733
734
|
this.$emit("update:radius", this.emittedRadius = this.overlay.getRadius());
|
|
@@ -737,16 +738,16 @@ const Ee = /* @__PURE__ */ $(Le, [["render", Be]]), mt = n({
|
|
|
737
738
|
this.$map.removeOverlay(this.overlay);
|
|
738
739
|
}
|
|
739
740
|
});
|
|
740
|
-
class Ne extends
|
|
741
|
-
constructor(t,
|
|
742
|
-
super(t,
|
|
741
|
+
class Ne extends me {
|
|
742
|
+
constructor(t, i, r, o) {
|
|
743
|
+
super(t, i), this.content = r, this.position = o;
|
|
743
744
|
}
|
|
744
745
|
onCreate() {
|
|
745
746
|
return this.content;
|
|
746
747
|
}
|
|
747
748
|
onDraw(t) {
|
|
748
|
-
const
|
|
749
|
-
this.content.style.left =
|
|
749
|
+
const i = t.fromLatLngToOverlayPoint(this.position);
|
|
750
|
+
this.content.style.left = i.x + "px", this.content.style.top = i.y + "px";
|
|
750
751
|
}
|
|
751
752
|
setPosition(t) {
|
|
752
753
|
this.position = t, this.draw();
|
|
@@ -757,7 +758,7 @@ const De = n({
|
|
|
757
758
|
mixins: [p],
|
|
758
759
|
props: {
|
|
759
760
|
mapPane: u(A, A.overlayMouseTarget),
|
|
760
|
-
position:
|
|
761
|
+
position: c(y)
|
|
761
762
|
},
|
|
762
763
|
setup() {
|
|
763
764
|
return {
|
|
@@ -784,7 +785,7 @@ const De = n({
|
|
|
784
785
|
this.$map.removeElementOverlay(this.overlay);
|
|
785
786
|
}
|
|
786
787
|
});
|
|
787
|
-
function ze(e, t,
|
|
788
|
+
function ze(e, t, i, r, o, a) {
|
|
788
789
|
return C(), b("div", M({
|
|
789
790
|
class: e.$options.name
|
|
790
791
|
}, e.$attrs), [
|
|
@@ -792,7 +793,7 @@ function ze(e, t, r, i, o, a) {
|
|
|
792
793
|
], 16);
|
|
793
794
|
}
|
|
794
795
|
const ft = /* @__PURE__ */ $(De, [["render", ze]]), We = {
|
|
795
|
-
position:
|
|
796
|
+
position: c(y),
|
|
796
797
|
title: s(String),
|
|
797
798
|
label: s(Object),
|
|
798
799
|
icon: s(Object),
|
|
@@ -869,7 +870,7 @@ const ft = /* @__PURE__ */ $(De, [["render", ze]]), We = {
|
|
|
869
870
|
}
|
|
870
871
|
},
|
|
871
872
|
onCreate() {
|
|
872
|
-
this.marker = this.$map.createMarker(this), this.labelOverlay && this.marker.attachLabelOverlay(this.labelOverlay.overlay), this.$clusterer() && this.autoAddToClusterer ? this.$clusterer().onAddMarker(this.marker) : this.$map.addOverlay(this.marker), this.autoAddToClustererWhenCreate = this.autoAddToClusterer, this.info && this.info.show && this.info.overlay.open(this.marker), v(this.attrs.listeners, this.marker), this.attrs.listenerProps["update:position"] && this.marker.addEventListener("dragend", (e) => {
|
|
873
|
+
this.marker = this.$map.createMarker(this), this.labelOverlay && this.marker.attachLabelOverlay(this.labelOverlay.overlay), this.$clusterer() && this.autoAddToClusterer ? this.$clusterer().onAddMarker(this.marker) : this.$map.addOverlay(this.marker), this.autoAddToClustererWhenCreate = this.autoAddToClusterer, this.info && this.info.show && this.info.overlay.open(this.marker), v(this.attrs.listeners, this.marker, this.$emit), this.attrs.listenerProps["update:position"] && this.marker.addEventListener("dragend", (e) => {
|
|
873
874
|
this.$emit("update:position", this.emittedPosition = e.position);
|
|
874
875
|
});
|
|
875
876
|
},
|
|
@@ -897,7 +898,7 @@ const ft = /* @__PURE__ */ $(De, [["render", ze]]), We = {
|
|
|
897
898
|
}
|
|
898
899
|
}
|
|
899
900
|
});
|
|
900
|
-
function Re(e, t,
|
|
901
|
+
function Re(e, t, i, r, o, a) {
|
|
901
902
|
return f(e.$slots, "default");
|
|
902
903
|
}
|
|
903
904
|
const H = /* @__PURE__ */ $(Ze, [["render", Re]]), Ue = n({
|
|
@@ -905,7 +906,7 @@ const H = /* @__PURE__ */ $(Ze, [["render", Re]]), Ue = n({
|
|
|
905
906
|
mixins: [p],
|
|
906
907
|
inheritAttrs: !1,
|
|
907
908
|
props: {
|
|
908
|
-
show:
|
|
909
|
+
show: c(Boolean),
|
|
909
910
|
position: s(y),
|
|
910
911
|
offset: s(Object),
|
|
911
912
|
maxWidth: s(Number),
|
|
@@ -947,7 +948,7 @@ const H = /* @__PURE__ */ $(Ze, [["render", Re]]), Ue = n({
|
|
|
947
948
|
onCreate() {
|
|
948
949
|
this.overlay = this.$map.createInfoBox(this.getOptions()), this.$marker() ? this.$marker().onAddInfo(this) : this.show && this.overlay.open(), this.attrs.listenerProps["update:show"] && this.overlay.addEventListener("closeclick", () => {
|
|
949
950
|
this.$emit("update:show", !1);
|
|
950
|
-
}), v(this.attrs.listeners, this.overlay);
|
|
951
|
+
}), v(this.attrs.listeners, this.overlay, this.$emit);
|
|
951
952
|
},
|
|
952
953
|
onDestroy() {
|
|
953
954
|
this.$marker() ? this.$marker().onRemoveInfo(this) : this.overlay.close();
|
|
@@ -978,7 +979,7 @@ const H = /* @__PURE__ */ $(Ze, [["render", Re]]), Ue = n({
|
|
|
978
979
|
}
|
|
979
980
|
}
|
|
980
981
|
});
|
|
981
|
-
function je(e, t,
|
|
982
|
+
function je(e, t, i, r, o, a) {
|
|
982
983
|
return C(), b("div", M({
|
|
983
984
|
class: e.$options.name
|
|
984
985
|
}, e.attrs.binds), [
|
|
@@ -990,7 +991,7 @@ const yt = /* @__PURE__ */ $(Ue, [["render", je]]), Fe = n({
|
|
|
990
991
|
mixins: [p],
|
|
991
992
|
inheritAttrs: !1,
|
|
992
993
|
props: {
|
|
993
|
-
show:
|
|
994
|
+
show: c(Boolean),
|
|
994
995
|
position: s(y),
|
|
995
996
|
maxWidth: s(Number),
|
|
996
997
|
offset: s(Object),
|
|
@@ -1043,13 +1044,13 @@ const yt = /* @__PURE__ */ $(Ue, [["render", je]]), Fe = n({
|
|
|
1043
1044
|
this.$emit("update:show", !0);
|
|
1044
1045
|
}), this.overlay.addEventListener("close", () => {
|
|
1045
1046
|
this.$emit("update:show", !1);
|
|
1046
|
-
}), v(this.attrs.listeners, this.overlay);
|
|
1047
|
+
}), v(this.attrs.listeners, this.overlay, this.$emit);
|
|
1047
1048
|
},
|
|
1048
1049
|
onDestroy() {
|
|
1049
1050
|
this.$marker() ? this.$marker().onRemoveInfo(this) : this.overlay.close();
|
|
1050
1051
|
}
|
|
1051
1052
|
});
|
|
1052
|
-
function He(e, t,
|
|
1053
|
+
function He(e, t, i, r, o, a) {
|
|
1053
1054
|
return Ce((C(), b("div", M({
|
|
1054
1055
|
class: e.$options.name
|
|
1055
1056
|
}, e.attrs.binds), [
|
|
@@ -1114,13 +1115,13 @@ const vt = /* @__PURE__ */ $(Fe, [["render", He]]), Ve = n({
|
|
|
1114
1115
|
}
|
|
1115
1116
|
},
|
|
1116
1117
|
onCreate() {
|
|
1117
|
-
this.overlay = this.$map.createLabel(this.getOptions()), this.$marker() ? this.$marker().onAddLabel(this) : this.$map.addOverlay(this.overlay), v(this.attrs.listeners, this.overlay);
|
|
1118
|
+
this.overlay = this.$map.createLabel(this.getOptions()), this.$marker() ? this.$marker().onAddLabel(this) : this.$map.addOverlay(this.overlay), v(this.attrs.listeners, this.overlay, this.$emit);
|
|
1118
1119
|
},
|
|
1119
1120
|
onDestroy() {
|
|
1120
1121
|
this.$marker() ? this.$marker().onRemoveLabel(this) : this.$map.removeOverlay(this.overlay);
|
|
1121
1122
|
}
|
|
1122
1123
|
});
|
|
1123
|
-
function Ge(e, t,
|
|
1124
|
+
function Ge(e, t, i, r, o, a) {
|
|
1124
1125
|
return C(), b("div", M({
|
|
1125
1126
|
class: e.$options.name
|
|
1126
1127
|
}, e.attrs.binds), [
|
|
@@ -1128,7 +1129,7 @@ function Ge(e, t, r, i, o, a) {
|
|
|
1128
1129
|
], 16);
|
|
1129
1130
|
}
|
|
1130
1131
|
const gt = /* @__PURE__ */ $(Ve, [["render", Ge]]), qe = {
|
|
1131
|
-
paths:
|
|
1132
|
+
paths: c(Array),
|
|
1132
1133
|
clickable: s(Boolean),
|
|
1133
1134
|
editable: s(Boolean),
|
|
1134
1135
|
strokeColor: s(String),
|
|
@@ -1157,7 +1158,7 @@ const gt = /* @__PURE__ */ $(Ve, [["render", Ge]]), qe = {
|
|
|
1157
1158
|
handler(e) {
|
|
1158
1159
|
if (this.emittedPaths != null) {
|
|
1159
1160
|
const t = this.emittedPaths;
|
|
1160
|
-
if (this.emittedPaths = void 0, t.length === e.length && t.every((
|
|
1161
|
+
if (this.emittedPaths = void 0, t.length === e.length && t.every((i, r) => i === B(e[r])))
|
|
1161
1162
|
return;
|
|
1162
1163
|
}
|
|
1163
1164
|
this.overlay.setPaths(e);
|
|
@@ -1193,7 +1194,7 @@ const gt = /* @__PURE__ */ $(Ve, [["render", Ge]]), qe = {
|
|
|
1193
1194
|
}
|
|
1194
1195
|
},
|
|
1195
1196
|
onCreate() {
|
|
1196
|
-
this.overlay = this.$map.createPolygon(this), this.$map.addOverlay(this.overlay), v(this.attrs.listeners, this.overlay), this.attrs.listenerProps["update:paths"] && this.overlay.addEventListener("paths-edited", () => {
|
|
1197
|
+
this.overlay = this.$map.createPolygon(this), this.$map.addOverlay(this.overlay), v(this.attrs.listeners, this.overlay, this.$emit), this.attrs.listenerProps["update:paths"] && this.overlay.addEventListener("paths-edited", () => {
|
|
1197
1198
|
this.$emit("update:paths", this.emittedPaths = this.overlay.getPaths());
|
|
1198
1199
|
});
|
|
1199
1200
|
},
|
|
@@ -1205,7 +1206,7 @@ const gt = /* @__PURE__ */ $(Ve, [["render", Ge]]), qe = {
|
|
|
1205
1206
|
mixins: [p],
|
|
1206
1207
|
inheritAttrs: !1,
|
|
1207
1208
|
props: {
|
|
1208
|
-
path:
|
|
1209
|
+
path: c(Array),
|
|
1209
1210
|
icons: s(Array),
|
|
1210
1211
|
clickable: s(Boolean),
|
|
1211
1212
|
editable: s(Boolean),
|
|
@@ -1265,7 +1266,7 @@ const gt = /* @__PURE__ */ $(Ve, [["render", Ge]]), qe = {
|
|
|
1265
1266
|
}
|
|
1266
1267
|
},
|
|
1267
1268
|
onCreate() {
|
|
1268
|
-
this.overlay = this.$map.createPolyline(this), this.$map.addOverlay(this.overlay), v(this.attrs.listeners, this.overlay), this.attrs.listenerProps["update:path"] && this.overlay.addEventListener("path-edited", () => {
|
|
1269
|
+
this.overlay = this.$map.createPolyline(this), this.$map.addOverlay(this.overlay), v(this.attrs.listeners, this.overlay, this.$emit), this.attrs.listenerProps["update:path"] && this.overlay.addEventListener("path-edited", () => {
|
|
1269
1270
|
this.$emit("update:path", this.emittedPath = this.overlay.getPath());
|
|
1270
1271
|
});
|
|
1271
1272
|
},
|
|
@@ -1277,7 +1278,7 @@ const gt = /* @__PURE__ */ $(Ve, [["render", Ge]]), qe = {
|
|
|
1277
1278
|
mixins: [p],
|
|
1278
1279
|
inheritAttrs: !1,
|
|
1279
1280
|
props: {
|
|
1280
|
-
bounds:
|
|
1281
|
+
bounds: c(Object),
|
|
1281
1282
|
clickable: s(Boolean),
|
|
1282
1283
|
editable: s(Boolean),
|
|
1283
1284
|
strokeColor: s(String),
|
|
@@ -1335,7 +1336,7 @@ const gt = /* @__PURE__ */ $(Ve, [["render", Ge]]), qe = {
|
|
|
1335
1336
|
}
|
|
1336
1337
|
},
|
|
1337
1338
|
onCreate() {
|
|
1338
|
-
this.overlay = this.$map.createRectangle(this), this.$map.addOverlay(this.overlay), v(this.attrs.listeners, this.overlay), this.attrs.listenerProps["update:bounds"] && this.overlay.addEventListener("bounds-changed", () => {
|
|
1339
|
+
this.overlay = this.$map.createRectangle(this), this.$map.addOverlay(this.overlay), v(this.attrs.listeners, this.overlay, this.$emit), this.attrs.listenerProps["update:bounds"] && this.overlay.addEventListener("bounds-changed", () => {
|
|
1339
1340
|
this.$emit("update:bounds", this.emittedBounds = this.overlay.getBounds());
|
|
1340
1341
|
});
|
|
1341
1342
|
},
|
|
@@ -1345,10 +1346,10 @@ const gt = /* @__PURE__ */ $(Ve, [["render", Ge]]), qe = {
|
|
|
1345
1346
|
}), Xe = ["beforeUpdate", "updated"], _t = {
|
|
1346
1347
|
install(e, t = {}) {
|
|
1347
1348
|
if (t.enable !== !1) {
|
|
1348
|
-
const
|
|
1349
|
+
const i = n({
|
|
1349
1350
|
beforeCreate() {
|
|
1350
|
-
const
|
|
1351
|
-
t.hookNames ? t.hookNames.includes(_) && console.debug("[lifecycle]",
|
|
1351
|
+
const r = Q() ?? "", a = (t.nameRegex || /^[A-Z]/).test(r) ? (_) => {
|
|
1352
|
+
t.hookNames ? t.hookNames.includes(_) && console.debug("[lifecycle]", r, _) : Xe.includes(_) || console.debug("[lifecycle]", r, _);
|
|
1352
1353
|
} : x;
|
|
1353
1354
|
a("beforeCreate"), this.__life_impl = a;
|
|
1354
1355
|
},
|
|
@@ -1374,8 +1375,8 @@ const gt = /* @__PURE__ */ $(Ve, [["render", Ge]]), qe = {
|
|
|
1374
1375
|
this.__life("unmounted");
|
|
1375
1376
|
},
|
|
1376
1377
|
methods: {
|
|
1377
|
-
__life(
|
|
1378
|
-
this.__life_impl(
|
|
1378
|
+
__life(r) {
|
|
1379
|
+
this.__life_impl(r);
|
|
1379
1380
|
}
|
|
1380
1381
|
},
|
|
1381
1382
|
onCreate() {
|
|
@@ -1385,14 +1386,14 @@ const gt = /* @__PURE__ */ $(Ve, [["render", Ge]]), qe = {
|
|
|
1385
1386
|
this.__life("onDestroy");
|
|
1386
1387
|
}
|
|
1387
1388
|
});
|
|
1388
|
-
e.mixin(
|
|
1389
|
+
e.mixin(i);
|
|
1389
1390
|
}
|
|
1390
1391
|
}
|
|
1391
1392
|
}, kt = {
|
|
1392
1393
|
install(e, t) {
|
|
1393
|
-
|
|
1394
|
-
const
|
|
1395
|
-
|
|
1394
|
+
ce(t);
|
|
1395
|
+
const i = e.config.optionMergeStrategies;
|
|
1396
|
+
i[P] = i[I] = (r, o) => r ? [...new Set([].concat(r, o))] : Array.isArray(o) ? o : [o];
|
|
1396
1397
|
}
|
|
1397
1398
|
};
|
|
1398
1399
|
export {
|
|
@@ -1404,7 +1405,7 @@ export {
|
|
|
1404
1405
|
ut as TgCircle,
|
|
1405
1406
|
nt as TgCustomControl,
|
|
1406
1407
|
ft as TgElementOverlay,
|
|
1407
|
-
|
|
1408
|
+
mt as TgHeatmap,
|
|
1408
1409
|
yt as TgInfoBox,
|
|
1409
1410
|
vt as TgInfoWindow,
|
|
1410
1411
|
gt as TgLabel,
|
|
@@ -1418,7 +1419,7 @@ export {
|
|
|
1418
1419
|
Ct as TgRectangle,
|
|
1419
1420
|
ht as TgScaleControl,
|
|
1420
1421
|
dt as TgStreetViewControl,
|
|
1421
|
-
|
|
1422
|
+
ct as TgTrafficLayer,
|
|
1422
1423
|
pt as TgZoomControl,
|
|
1423
1424
|
S as callHook,
|
|
1424
1425
|
tt as computedSaveOnThis,
|
|
@@ -1427,12 +1428,12 @@ export {
|
|
|
1427
1428
|
st as createPropertyObjectTyped,
|
|
1428
1429
|
kt as default,
|
|
1429
1430
|
h as eventProp,
|
|
1430
|
-
|
|
1431
|
+
rt as extractVNodeFromSlotsByComponent,
|
|
1431
1432
|
U as findAncestorComponentByType,
|
|
1432
|
-
|
|
1433
|
+
it as findByComponentType,
|
|
1433
1434
|
R as isComponentByType,
|
|
1434
1435
|
s as optionalProp,
|
|
1435
|
-
|
|
1436
|
+
c as requiredProp,
|
|
1436
1437
|
Y as safeAsComponent,
|
|
1437
1438
|
Oe as splitAttrs,
|
|
1438
1439
|
u as stringEnumProp,
|