tg-map-vue3 3.7.4 → 3.7.6
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 +1 -0
- package/dist/src/components/TgMap.vue.d.ts +30 -29
- package/dist/src/components/overlays/TgMarker.vue.d.ts +19 -1
- package/dist/tg-map.js +10 -2
- package/dist/tg-map.js.map +1 -1
- package/dist/tg-map.umd.cjs +1 -1
- package/dist/tg-map.umd.cjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
1
2
|
import { LatLng } from '../map/lat-lng';
|
|
2
3
|
import { TgMapType } from '../map/map-factory';
|
|
3
4
|
import type { AbstractMap, AbstractMapEventMap } from '../map/map/map';
|
|
4
|
-
import { GestureHandlingOptions } from '../map/map/map-options';
|
|
5
|
+
import { GestureHandlingOptions, type MapStyle } from '../map/map/map-options';
|
|
5
6
|
import { BuildInMapTypeId, MapType } from '../map/map/map-type';
|
|
6
7
|
import { type StringEnumValue } from '../utils/mapped-types';
|
|
7
8
|
import { type EventEmits } from '../utils/vue-utils';
|
|
@@ -18,7 +19,7 @@ type TgMapEmits = {
|
|
|
18
19
|
declare const _default: import("vue").DefineComponent<{
|
|
19
20
|
/** type没做响应式, 但外部可以把type作为tg-map的key, 让type修改时完全重建tg-map */
|
|
20
21
|
type: {
|
|
21
|
-
type:
|
|
22
|
+
type: PropType<StringEnumValue<typeof TgMapType>>;
|
|
22
23
|
default: TgMapType;
|
|
23
24
|
};
|
|
24
25
|
/**
|
|
@@ -30,7 +31,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
30
31
|
* @see AbstractMapEventMap.center-changed
|
|
31
32
|
* */
|
|
32
33
|
center: {
|
|
33
|
-
type:
|
|
34
|
+
type: PropType<LatLng>;
|
|
34
35
|
required: true;
|
|
35
36
|
};
|
|
36
37
|
/**
|
|
@@ -39,7 +40,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
39
40
|
* @see center
|
|
40
41
|
*/
|
|
41
42
|
centerSyncDelay: {
|
|
42
|
-
type:
|
|
43
|
+
type: PropType<number>;
|
|
43
44
|
default: number;
|
|
44
45
|
};
|
|
45
46
|
/**
|
|
@@ -47,17 +48,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
47
48
|
* @see center
|
|
48
49
|
* */
|
|
49
50
|
currentCenter: {
|
|
50
|
-
type:
|
|
51
|
+
type: PropType<LatLng>;
|
|
51
52
|
};
|
|
52
53
|
/**
|
|
53
54
|
* 仅用于获取tg-map销毁时的最后的center的值
|
|
54
55
|
* @see center
|
|
55
56
|
*/
|
|
56
57
|
lastCenter: {
|
|
57
|
-
type:
|
|
58
|
+
type: PropType<LatLng>;
|
|
58
59
|
};
|
|
59
60
|
zoom: {
|
|
60
|
-
type:
|
|
61
|
+
type: PropType<number>;
|
|
61
62
|
required: true;
|
|
62
63
|
};
|
|
63
64
|
/**
|
|
@@ -65,29 +66,29 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
65
66
|
* @see MapOptions.infoWindowMode
|
|
66
67
|
*/
|
|
67
68
|
infoWindowMode: {
|
|
68
|
-
type:
|
|
69
|
+
type: PropType<"single" | "multi">;
|
|
69
70
|
};
|
|
70
71
|
gestureHandling: {
|
|
71
|
-
type:
|
|
72
|
+
type: PropType<StringEnumValue<typeof GestureHandlingOptions>>;
|
|
72
73
|
};
|
|
73
74
|
minZoom: {
|
|
74
|
-
type:
|
|
75
|
+
type: PropType<number>;
|
|
75
76
|
};
|
|
76
77
|
maxZoom: {
|
|
77
|
-
type:
|
|
78
|
+
type: PropType<number>;
|
|
78
79
|
};
|
|
79
80
|
mapStyle: {
|
|
80
|
-
type:
|
|
81
|
+
type: PropType<MapStyle>;
|
|
81
82
|
};
|
|
82
83
|
mapTypeId: {
|
|
83
|
-
type:
|
|
84
|
+
type: PropType<StringEnumValue<typeof BuildInMapTypeId>>;
|
|
84
85
|
};
|
|
85
86
|
/** 地图类型对象, 优先级比mapTypeId高 */
|
|
86
87
|
mapType: {
|
|
87
|
-
type:
|
|
88
|
+
type: PropType<any>;
|
|
88
89
|
};
|
|
89
90
|
hideLogo: {
|
|
90
|
-
type:
|
|
91
|
+
type: PropType<boolean>;
|
|
91
92
|
};
|
|
92
93
|
onLoad: import("vue").Prop<import("../utils/vue-utils").EventCallback<AbstractMap>>;
|
|
93
94
|
'onUpdate:center': import("vue").Prop<import("../utils/vue-utils").EventCallback<LatLng>>;
|
|
@@ -112,7 +113,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
112
113
|
}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, EventEmits<AbstractMapEventMap & TgMapEmits>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
113
114
|
/** type没做响应式, 但外部可以把type作为tg-map的key, 让type修改时完全重建tg-map */
|
|
114
115
|
type: {
|
|
115
|
-
type:
|
|
116
|
+
type: PropType<StringEnumValue<typeof TgMapType>>;
|
|
116
117
|
default: TgMapType;
|
|
117
118
|
};
|
|
118
119
|
/**
|
|
@@ -124,7 +125,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
124
125
|
* @see AbstractMapEventMap.center-changed
|
|
125
126
|
* */
|
|
126
127
|
center: {
|
|
127
|
-
type:
|
|
128
|
+
type: PropType<LatLng>;
|
|
128
129
|
required: true;
|
|
129
130
|
};
|
|
130
131
|
/**
|
|
@@ -133,7 +134,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
133
134
|
* @see center
|
|
134
135
|
*/
|
|
135
136
|
centerSyncDelay: {
|
|
136
|
-
type:
|
|
137
|
+
type: PropType<number>;
|
|
137
138
|
default: number;
|
|
138
139
|
};
|
|
139
140
|
/**
|
|
@@ -141,17 +142,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
141
142
|
* @see center
|
|
142
143
|
* */
|
|
143
144
|
currentCenter: {
|
|
144
|
-
type:
|
|
145
|
+
type: PropType<LatLng>;
|
|
145
146
|
};
|
|
146
147
|
/**
|
|
147
148
|
* 仅用于获取tg-map销毁时的最后的center的值
|
|
148
149
|
* @see center
|
|
149
150
|
*/
|
|
150
151
|
lastCenter: {
|
|
151
|
-
type:
|
|
152
|
+
type: PropType<LatLng>;
|
|
152
153
|
};
|
|
153
154
|
zoom: {
|
|
154
|
-
type:
|
|
155
|
+
type: PropType<number>;
|
|
155
156
|
required: true;
|
|
156
157
|
};
|
|
157
158
|
/**
|
|
@@ -159,29 +160,29 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
159
160
|
* @see MapOptions.infoWindowMode
|
|
160
161
|
*/
|
|
161
162
|
infoWindowMode: {
|
|
162
|
-
type:
|
|
163
|
+
type: PropType<"single" | "multi">;
|
|
163
164
|
};
|
|
164
165
|
gestureHandling: {
|
|
165
|
-
type:
|
|
166
|
+
type: PropType<StringEnumValue<typeof GestureHandlingOptions>>;
|
|
166
167
|
};
|
|
167
168
|
minZoom: {
|
|
168
|
-
type:
|
|
169
|
+
type: PropType<number>;
|
|
169
170
|
};
|
|
170
171
|
maxZoom: {
|
|
171
|
-
type:
|
|
172
|
+
type: PropType<number>;
|
|
172
173
|
};
|
|
173
174
|
mapStyle: {
|
|
174
|
-
type:
|
|
175
|
+
type: PropType<MapStyle>;
|
|
175
176
|
};
|
|
176
177
|
mapTypeId: {
|
|
177
|
-
type:
|
|
178
|
+
type: PropType<StringEnumValue<typeof BuildInMapTypeId>>;
|
|
178
179
|
};
|
|
179
180
|
/** 地图类型对象, 优先级比mapTypeId高 */
|
|
180
181
|
mapType: {
|
|
181
|
-
type:
|
|
182
|
+
type: PropType<any>;
|
|
182
183
|
};
|
|
183
184
|
hideLogo: {
|
|
184
|
-
type:
|
|
185
|
+
type: PropType<boolean>;
|
|
185
186
|
};
|
|
186
187
|
onLoad: import("vue").Prop<import("../utils/vue-utils").EventCallback<AbstractMap>>;
|
|
187
188
|
'onUpdate:center': import("vue").Prop<import("../utils/vue-utils").EventCallback<LatLng>>;
|
|
@@ -42,6 +42,14 @@ declare const TgMarker: import("vue").DefineComponent<{
|
|
|
42
42
|
normalizePositionForBaidu: {
|
|
43
43
|
type: PropType<boolean>;
|
|
44
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* 是否自动添加到TgMarkerClusterer中去
|
|
47
|
+
* @default true
|
|
48
|
+
*/
|
|
49
|
+
autoAddToClusterer: {
|
|
50
|
+
type: PropType<boolean>;
|
|
51
|
+
default: boolean;
|
|
52
|
+
};
|
|
45
53
|
'onUpdate:position': import("vue").Prop<import("../../utils/vue-utils").EventCallback<LatLng>>;
|
|
46
54
|
}, {
|
|
47
55
|
attrs: import("vue").ComputedRef<{
|
|
@@ -239,6 +247,14 @@ declare const TgMarker: import("vue").DefineComponent<{
|
|
|
239
247
|
normalizePositionForBaidu: {
|
|
240
248
|
type: PropType<boolean>;
|
|
241
249
|
};
|
|
250
|
+
/**
|
|
251
|
+
* 是否自动添加到TgMarkerClusterer中去
|
|
252
|
+
* @default true
|
|
253
|
+
*/
|
|
254
|
+
autoAddToClusterer: {
|
|
255
|
+
type: PropType<boolean>;
|
|
256
|
+
default: boolean;
|
|
257
|
+
};
|
|
242
258
|
'onUpdate:position': import("vue").Prop<import("../../utils/vue-utils").EventCallback<LatLng>>;
|
|
243
259
|
}>> & {
|
|
244
260
|
onClick?: ((event: import("../../map/event").Tg.MouseEvent) => any) | undefined;
|
|
@@ -253,7 +269,9 @@ declare const TgMarker: import("vue").DefineComponent<{
|
|
|
253
269
|
onDrag?: ((event: import("../../map/event").Tg.MouseEvent) => any) | undefined;
|
|
254
270
|
onDragend?: ((event: import("../../map/event").Tg.MouseEvent) => any) | undefined;
|
|
255
271
|
"onUpdate:position"?: ((event: LatLng) => any) | undefined;
|
|
256
|
-
}, {
|
|
272
|
+
}, {
|
|
273
|
+
autoAddToClusterer: boolean;
|
|
274
|
+
}, {}>;
|
|
257
275
|
type TgMarker = InstanceType<typeof TgMarker>;
|
|
258
276
|
export default TgMarker;
|
|
259
277
|
export type TgInfo = TgInfoWindow | TgInfoBox;
|
package/dist/tg-map.js
CHANGED
|
@@ -5503,6 +5503,11 @@ const ms = /* @__PURE__ */ K(ps, [["render", gs]]), fs = w({
|
|
|
5503
5503
|
zIndex: m(Number),
|
|
5504
5504
|
visible: m(Boolean),
|
|
5505
5505
|
normalizePositionForBaidu: m(Boolean),
|
|
5506
|
+
/**
|
|
5507
|
+
* 是否自动添加到TgMarkerClusterer中去
|
|
5508
|
+
* @default true
|
|
5509
|
+
*/
|
|
5510
|
+
autoAddToClusterer: m(Boolean, !0),
|
|
5506
5511
|
"onUpdate:position": L()
|
|
5507
5512
|
},
|
|
5508
5513
|
emits: void 0,
|
|
@@ -5550,15 +5555,18 @@ const ms = /* @__PURE__ */ K(ps, [["render", gs]]), fs = w({
|
|
|
5550
5555
|
},
|
|
5551
5556
|
normalizePositionForBaidu() {
|
|
5552
5557
|
this.recreate();
|
|
5558
|
+
},
|
|
5559
|
+
autoAddToClusterer() {
|
|
5560
|
+
this.recreate();
|
|
5553
5561
|
}
|
|
5554
5562
|
},
|
|
5555
5563
|
onCreate() {
|
|
5556
|
-
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), Y(this.attrs.listeners, this.marker), "update:position" in this.attrs.listenerProps && this.marker.addEventListener("dragend", (i) => {
|
|
5564
|
+
this.marker = this.$map.createMarker(this), this.label && this.marker.setLabel(this.label.overlay), this.$clusterer() && this.autoAddToClusterer ? this.$clusterer().onAddMarker(this.marker) : this.$map.addOverlay(this.marker), this.info && this.info.show && this.info.overlay.open(this.marker), Y(this.attrs.listeners, this.marker), "update:position" in this.attrs.listenerProps && this.marker.addEventListener("dragend", (i) => {
|
|
5557
5565
|
this.$emit("update:position", this.emittedPosition = i.position);
|
|
5558
5566
|
});
|
|
5559
5567
|
},
|
|
5560
5568
|
onDestroy() {
|
|
5561
|
-
this.$clusterer() ? this.$clusterer().onRemoveMarker(this.marker) : this.$map.removeOverlay(this.marker);
|
|
5569
|
+
this.$clusterer() && this.autoAddToClusterer ? this.$clusterer().onRemoveMarker(this.marker) : this.$map.removeOverlay(this.marker);
|
|
5562
5570
|
},
|
|
5563
5571
|
methods: {
|
|
5564
5572
|
$clusterer() {
|