tg-map-vue3 4.2.12 → 4.3.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/CHANGELOG.md +5 -0
- package/README.md +7 -0
- package/dist/src/components/TgMap.vue.d.ts +6 -2186
- package/dist/src/components/TgMapWidget.vue.d.ts +2 -2
- package/dist/src/components/overlays/TgInfoBox.vue.d.ts +2 -2
- package/dist/src/components/overlays/TgMarker.vue.d.ts +4 -4
- package/dist/src/components/overlays/TgPolygon.vue.d.ts +2 -2
- package/dist/src/components/overlays/TgRectangle.vue.d.ts +2 -2
- package/dist/tg-map.cjs +1 -1
- package/dist/tg-map.cjs.map +1 -1
- package/dist/tg-map.js +48 -47
- package/dist/tg-map.js.map +1 -1
- package/package.json +7 -5
package/dist/tg-map.js
CHANGED
|
@@ -29,7 +29,7 @@ function s(e, t) {
|
|
|
29
29
|
default: t
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function et(e) {
|
|
33
33
|
const t = {};
|
|
34
34
|
return Object.entries(e).forEach(([i, r]) => {
|
|
35
35
|
const o = `__${i}`;
|
|
@@ -59,7 +59,7 @@ function Te(e) {
|
|
|
59
59
|
typeof i == "function" ? (I.get = i, I.set = L, r = !0) : typeof i == "object" && typeof i.get == "function" && (I.get = i.get, I.set = i.set, r = !0), r && (e[t] = Object.defineProperty(e, t, I));
|
|
60
60
|
}), e;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function tt(e) {
|
|
63
63
|
return Te(e);
|
|
64
64
|
}
|
|
65
65
|
function E() {
|
|
@@ -71,12 +71,12 @@ function k(e, t) {
|
|
|
71
71
|
for (const r of i)
|
|
72
72
|
r.call(e);
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function st(e, t) {
|
|
75
75
|
for (const i of e)
|
|
76
76
|
if (i.$options.name === t.name)
|
|
77
77
|
return i;
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function it(e, t) {
|
|
80
80
|
if (!e.default) return;
|
|
81
81
|
const i = e.default();
|
|
82
82
|
for (const r of i)
|
|
@@ -104,7 +104,7 @@ function g(e, t) {
|
|
|
104
104
|
function h() {
|
|
105
105
|
return Function;
|
|
106
106
|
}
|
|
107
|
-
const
|
|
107
|
+
const rt = () => {
|
|
108
108
|
let e, t;
|
|
109
109
|
function i(o) {
|
|
110
110
|
console.log(o), e = o && o.type, t = Date.now();
|
|
@@ -151,7 +151,7 @@ const j = "$map", O = "onCreate", P = "onDestroy", p = n({
|
|
|
151
151
|
type: u(D, D.google),
|
|
152
152
|
/**
|
|
153
153
|
* 当对该属性使用双向绑定时, 改变center将触发update:center又反过来触发center改变, 最终导致无限循环...
|
|
154
|
-
* 当前通过
|
|
154
|
+
* 当前通过setCenterIfChanged()判断center是否有改变来避免该问题, 但为了避免可能存在的问题, 另外设计了如下机制:
|
|
155
155
|
* - :center-sync-delay="300": 延时同步center, 防止center的值更新过快
|
|
156
156
|
* - :current-center.sync="currentCenter": 实时获取center的值
|
|
157
157
|
* - :last-center.sync="center": 获取tg-map销毁时的最后的center的值, 使用这种方式可以做到type切换时保留中心点位置
|
|
@@ -218,6 +218,7 @@ const j = "$map", O = "onCreate", P = "onDestroy", p = n({
|
|
|
218
218
|
},
|
|
219
219
|
data() {
|
|
220
220
|
return {
|
|
221
|
+
// 类型用Raw标注, 防止tsc生成组件的类型文件时展开BaseMap的类型
|
|
221
222
|
map: M(),
|
|
222
223
|
isDestroyed: !1
|
|
223
224
|
};
|
|
@@ -301,7 +302,7 @@ const j = "$map", O = "onCreate", P = "onDestroy", p = n({
|
|
|
301
302
|
() => this.center
|
|
302
303
|
//
|
|
303
304
|
], ([o, a], [_, ee]) => {
|
|
304
|
-
o !== _ && t.setZoom(o), a !== ee &&
|
|
305
|
+
o !== _ && t.setZoom(o), a !== ee && t.setCenterIfChanged(a);
|
|
305
306
|
}), this.attrs.listenerProps["update:center"]) {
|
|
306
307
|
const o = () => this.$emit("update:center", t.getCenter());
|
|
307
308
|
t.addEventListener("center-changed", () => {
|
|
@@ -380,7 +381,7 @@ function Se(e, t, i, r, o, a) {
|
|
|
380
381
|
f(e.$slots, "default")
|
|
381
382
|
], 6);
|
|
382
383
|
}
|
|
383
|
-
const
|
|
384
|
+
const ot = /* @__PURE__ */ $(we, [["render", Se]]), Le = n({
|
|
384
385
|
name: "tg-custom-control",
|
|
385
386
|
mixins: [p],
|
|
386
387
|
props: {
|
|
@@ -416,7 +417,7 @@ function xe(e, t, i, r, o, a) {
|
|
|
416
417
|
f(e.$slots, "default")
|
|
417
418
|
], 2);
|
|
418
419
|
}
|
|
419
|
-
const
|
|
420
|
+
const at = /* @__PURE__ */ $(Le, [["render", xe]]), nt = n({
|
|
420
421
|
name: "tg-map-type-control",
|
|
421
422
|
mixins: [p],
|
|
422
423
|
props: {
|
|
@@ -449,7 +450,7 @@ const nt = /* @__PURE__ */ $(Le, [["render", xe]]), lt = n({
|
|
|
449
450
|
onDestroy() {
|
|
450
451
|
this.$map.removeControl(this.control);
|
|
451
452
|
}
|
|
452
|
-
}),
|
|
453
|
+
}), lt = n({
|
|
453
454
|
name: "tg-scale-control",
|
|
454
455
|
mixins: [p],
|
|
455
456
|
props: {
|
|
@@ -505,7 +506,7 @@ function F() {
|
|
|
505
506
|
}
|
|
506
507
|
};
|
|
507
508
|
}
|
|
508
|
-
const
|
|
509
|
+
const ht = n({
|
|
509
510
|
name: "tg-street-view-control",
|
|
510
511
|
props: {
|
|
511
512
|
position: u(m, m.RIGHT_BOTTOM)
|
|
@@ -521,7 +522,7 @@ const dt = n({
|
|
|
521
522
|
t.setPosition(d(a, m));
|
|
522
523
|
}), E;
|
|
523
524
|
}
|
|
524
|
-
}),
|
|
525
|
+
}), dt = n({
|
|
525
526
|
name: "tg-zoom-control",
|
|
526
527
|
props: {
|
|
527
528
|
position: u(m, m.RIGHT_BOTTOM),
|
|
@@ -540,7 +541,7 @@ const dt = n({
|
|
|
540
541
|
t.setShowZoomLevel(a ?? !0);
|
|
541
542
|
}), E;
|
|
542
543
|
}
|
|
543
|
-
}),
|
|
544
|
+
}), pt = n({
|
|
544
545
|
name: "tg-heatmap",
|
|
545
546
|
props: {
|
|
546
547
|
maxIntensity: s(Number),
|
|
@@ -636,7 +637,7 @@ function Be(e, t, i, r, o, a) {
|
|
|
636
637
|
f(e.$slots, "default")
|
|
637
638
|
], 2);
|
|
638
639
|
}
|
|
639
|
-
const Ee = /* @__PURE__ */ $(Ae, [["render", Be]]),
|
|
640
|
+
const Ee = /* @__PURE__ */ $(Ae, [["render", Be]]), mt = n({
|
|
640
641
|
name: "tg-traffic-layer",
|
|
641
642
|
mixins: [p],
|
|
642
643
|
// 请直接使用v-if来控制它的显隐
|
|
@@ -654,7 +655,7 @@ const Ee = /* @__PURE__ */ $(Ae, [["render", Be]]), ct = n({
|
|
|
654
655
|
onDestroy() {
|
|
655
656
|
this.$map.removeLayer(this.layer);
|
|
656
657
|
}
|
|
657
|
-
}),
|
|
658
|
+
}), ct = n({
|
|
658
659
|
name: "tg-circle",
|
|
659
660
|
mixins: [p],
|
|
660
661
|
inheritAttrs: !1,
|
|
@@ -792,7 +793,7 @@ function ze(e, t, i, r, o, a) {
|
|
|
792
793
|
f(e.$slots, "default")
|
|
793
794
|
], 16);
|
|
794
795
|
}
|
|
795
|
-
const
|
|
796
|
+
const ut = /* @__PURE__ */ $(De, [["render", ze]]), We = {
|
|
796
797
|
position: c(y),
|
|
797
798
|
title: s(String),
|
|
798
799
|
label: s(Object),
|
|
@@ -990,7 +991,7 @@ function je(e, t, i, r, o, a) {
|
|
|
990
991
|
f(e.$slots, "default")
|
|
991
992
|
], 16);
|
|
992
993
|
}
|
|
993
|
-
const
|
|
994
|
+
const ft = /* @__PURE__ */ $(Ue, [["render", je]]), Fe = n({
|
|
994
995
|
name: "tg-info-window",
|
|
995
996
|
mixins: [p],
|
|
996
997
|
inheritAttrs: !1,
|
|
@@ -1063,7 +1064,7 @@ function He(e, t, i, r, o, a) {
|
|
|
1063
1064
|
[_e, e.show]
|
|
1064
1065
|
]);
|
|
1065
1066
|
}
|
|
1066
|
-
const
|
|
1067
|
+
const yt = /* @__PURE__ */ $(Fe, [["render", He]]), Ve = n({
|
|
1067
1068
|
name: "tg-label",
|
|
1068
1069
|
mixins: [p],
|
|
1069
1070
|
inheritAttrs: !1,
|
|
@@ -1133,7 +1134,7 @@ function Ge(e, t, i, r, o, a) {
|
|
|
1133
1134
|
f(e.$slots, "default")
|
|
1134
1135
|
], 16);
|
|
1135
1136
|
}
|
|
1136
|
-
const
|
|
1137
|
+
const vt = /* @__PURE__ */ $(Ve, [["render", Ge]]), qe = {
|
|
1137
1138
|
paths: c(Array),
|
|
1138
1139
|
clickable: s(Boolean),
|
|
1139
1140
|
editable: s(Boolean),
|
|
@@ -1145,7 +1146,7 @@ const gt = /* @__PURE__ */ $(Ve, [["render", Ge]]), qe = {
|
|
|
1145
1146
|
fillColor: s(String),
|
|
1146
1147
|
fillOpacity: s(Number),
|
|
1147
1148
|
"onUpdate:paths": h()
|
|
1148
|
-
},
|
|
1149
|
+
}, gt = n({
|
|
1149
1150
|
name: "tg-polygon",
|
|
1150
1151
|
mixins: [p],
|
|
1151
1152
|
inheritAttrs: !1,
|
|
@@ -1206,7 +1207,7 @@ const gt = /* @__PURE__ */ $(Ve, [["render", Ge]]), qe = {
|
|
|
1206
1207
|
onDestroy() {
|
|
1207
1208
|
this.$map.removeOverlay(this.overlay);
|
|
1208
1209
|
}
|
|
1209
|
-
}),
|
|
1210
|
+
}), $t = n({
|
|
1210
1211
|
name: "tg-polyline",
|
|
1211
1212
|
mixins: [p],
|
|
1212
1213
|
inheritAttrs: !1,
|
|
@@ -1278,7 +1279,7 @@ const gt = /* @__PURE__ */ $(Ve, [["render", Ge]]), qe = {
|
|
|
1278
1279
|
onDestroy() {
|
|
1279
1280
|
this.overlay.remove();
|
|
1280
1281
|
}
|
|
1281
|
-
}),
|
|
1282
|
+
}), bt = n({
|
|
1282
1283
|
name: "tg-rectangle",
|
|
1283
1284
|
mixins: [p],
|
|
1284
1285
|
inheritAttrs: !1,
|
|
@@ -1348,7 +1349,7 @@ const gt = /* @__PURE__ */ $(Ve, [["render", Ge]]), qe = {
|
|
|
1348
1349
|
onDestroy() {
|
|
1349
1350
|
this.$map.removeOverlay(this.overlay);
|
|
1350
1351
|
}
|
|
1351
|
-
}), Xe = ["beforeUpdate", "updated"],
|
|
1352
|
+
}), Xe = ["beforeUpdate", "updated"], Ct = {
|
|
1352
1353
|
install(e, t = {}) {
|
|
1353
1354
|
if (t.enable !== !1) {
|
|
1354
1355
|
const i = n({
|
|
@@ -1394,7 +1395,7 @@ const gt = /* @__PURE__ */ $(Ve, [["render", Ge]]), qe = {
|
|
|
1394
1395
|
e.mixin(i);
|
|
1395
1396
|
}
|
|
1396
1397
|
}
|
|
1397
|
-
},
|
|
1398
|
+
}, _t = {
|
|
1398
1399
|
install(e, t) {
|
|
1399
1400
|
ce(t);
|
|
1400
1401
|
const i = e.config.optionMergeStrategies;
|
|
@@ -1402,40 +1403,40 @@ const gt = /* @__PURE__ */ $(Ve, [["render", Ge]]), qe = {
|
|
|
1402
1403
|
}
|
|
1403
1404
|
};
|
|
1404
1405
|
export {
|
|
1405
|
-
|
|
1406
|
+
Ct as LifecycleLogPlugin,
|
|
1406
1407
|
O as MIXIN_HOOK_CREATE,
|
|
1407
1408
|
P as MIXIN_HOOK_DESTROY,
|
|
1408
1409
|
j as MIXIN_MAP_NAME,
|
|
1409
1410
|
p as MapMixin,
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1411
|
+
ct as TgCircle,
|
|
1412
|
+
at as TgCustomControl,
|
|
1413
|
+
ut as TgElementOverlay,
|
|
1414
|
+
pt as TgHeatmap,
|
|
1415
|
+
ft as TgInfoBox,
|
|
1416
|
+
yt as TgInfoWindow,
|
|
1417
|
+
vt as TgLabel,
|
|
1417
1418
|
N as TgMap,
|
|
1418
|
-
|
|
1419
|
-
|
|
1419
|
+
nt as TgMapTypeControl,
|
|
1420
|
+
ot as TgMapWidget,
|
|
1420
1421
|
H as TgMarker,
|
|
1421
1422
|
Ee as TgMarkerClusterer,
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1423
|
+
gt as TgPolygon,
|
|
1424
|
+
$t as TgPolyline,
|
|
1425
|
+
bt as TgRectangle,
|
|
1426
|
+
lt as TgScaleControl,
|
|
1427
|
+
ht as TgStreetViewControl,
|
|
1428
|
+
mt as TgTrafficLayer,
|
|
1429
|
+
dt as TgZoomControl,
|
|
1429
1430
|
k as callHook,
|
|
1430
|
-
|
|
1431
|
+
et as computedSaveOnThis,
|
|
1431
1432
|
E as createEmptyVNode,
|
|
1432
1433
|
Te as createPropertyObject,
|
|
1433
|
-
|
|
1434
|
-
|
|
1434
|
+
tt as createPropertyObjectTyped,
|
|
1435
|
+
_t as default,
|
|
1435
1436
|
h as eventProp,
|
|
1436
|
-
|
|
1437
|
+
it as extractVNodeFromSlotsByComponent,
|
|
1437
1438
|
U as findAncestorComponentByType,
|
|
1438
|
-
|
|
1439
|
+
st as findByComponentType,
|
|
1439
1440
|
R as isComponentByType,
|
|
1440
1441
|
s as optionalProp,
|
|
1441
1442
|
c as requiredProp,
|
|
@@ -1443,7 +1444,7 @@ export {
|
|
|
1443
1444
|
Oe as splitAttrs,
|
|
1444
1445
|
u as stringEnumProp,
|
|
1445
1446
|
ke as stringUnionPropFromValues,
|
|
1446
|
-
|
|
1447
|
+
rt as useEventLogMethods,
|
|
1447
1448
|
g as useSplittedAttrs,
|
|
1448
1449
|
F as useTgMapInner
|
|
1449
1450
|
};
|