tg-map-vue3 3.7.3 → 3.7.5
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 +42 -29
- package/dist/src/components/index.d.ts +2 -0
- package/dist/src/components/overlays/TgMarker.vue.d.ts +3 -3
- package/dist/src/map/map-loader.d.ts +5 -1
- package/dist/src/utils/objects.d.ts +10 -0
- package/dist/src/utils/utils.d.ts +4 -0
- package/dist/tg-map.js +882 -845
- package/dist/tg-map.js.map +1 -1
- package/dist/tg-map.umd.cjs +6 -6
- package/dist/tg-map.umd.cjs.map +1 -1
- package/package.json +2 -2
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,35 @@ 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>>; /**
|
|
73
|
+
* 仅用来获取center的值, 需要设置center的值请使用`center`属性
|
|
74
|
+
* @see center
|
|
75
|
+
* */
|
|
72
76
|
};
|
|
73
77
|
minZoom: {
|
|
74
|
-
type:
|
|
78
|
+
type: PropType<number>;
|
|
75
79
|
};
|
|
76
80
|
maxZoom: {
|
|
77
|
-
type:
|
|
81
|
+
type: PropType<number>;
|
|
78
82
|
};
|
|
79
83
|
mapStyle: {
|
|
80
|
-
type:
|
|
84
|
+
type: PropType<MapStyle>;
|
|
81
85
|
};
|
|
82
86
|
mapTypeId: {
|
|
83
|
-
type:
|
|
87
|
+
type: PropType<StringEnumValue<typeof BuildInMapTypeId>>; /**
|
|
88
|
+
* 仅用来获取center的值, 需要设置center的值请使用`center`属性
|
|
89
|
+
* @see center
|
|
90
|
+
* */
|
|
84
91
|
};
|
|
85
92
|
/** 地图类型对象, 优先级比mapTypeId高 */
|
|
86
93
|
mapType: {
|
|
87
|
-
type:
|
|
94
|
+
type: PropType<any>;
|
|
88
95
|
};
|
|
89
96
|
hideLogo: {
|
|
90
|
-
type:
|
|
97
|
+
type: PropType<boolean>;
|
|
91
98
|
};
|
|
92
99
|
onLoad: import("vue").Prop<import("../utils/vue-utils").EventCallback<AbstractMap>>;
|
|
93
100
|
'onUpdate:center': import("vue").Prop<import("../utils/vue-utils").EventCallback<LatLng>>;
|
|
@@ -112,7 +119,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
112
119
|
}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, EventEmits<AbstractMapEventMap & TgMapEmits>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
113
120
|
/** type没做响应式, 但外部可以把type作为tg-map的key, 让type修改时完全重建tg-map */
|
|
114
121
|
type: {
|
|
115
|
-
type:
|
|
122
|
+
type: PropType<StringEnumValue<typeof TgMapType>>;
|
|
116
123
|
default: TgMapType;
|
|
117
124
|
};
|
|
118
125
|
/**
|
|
@@ -124,7 +131,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
124
131
|
* @see AbstractMapEventMap.center-changed
|
|
125
132
|
* */
|
|
126
133
|
center: {
|
|
127
|
-
type:
|
|
134
|
+
type: PropType<LatLng>;
|
|
128
135
|
required: true;
|
|
129
136
|
};
|
|
130
137
|
/**
|
|
@@ -133,7 +140,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
133
140
|
* @see center
|
|
134
141
|
*/
|
|
135
142
|
centerSyncDelay: {
|
|
136
|
-
type:
|
|
143
|
+
type: PropType<number>;
|
|
137
144
|
default: number;
|
|
138
145
|
};
|
|
139
146
|
/**
|
|
@@ -141,17 +148,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
141
148
|
* @see center
|
|
142
149
|
* */
|
|
143
150
|
currentCenter: {
|
|
144
|
-
type:
|
|
151
|
+
type: PropType<LatLng>;
|
|
145
152
|
};
|
|
146
153
|
/**
|
|
147
154
|
* 仅用于获取tg-map销毁时的最后的center的值
|
|
148
155
|
* @see center
|
|
149
156
|
*/
|
|
150
157
|
lastCenter: {
|
|
151
|
-
type:
|
|
158
|
+
type: PropType<LatLng>;
|
|
152
159
|
};
|
|
153
160
|
zoom: {
|
|
154
|
-
type:
|
|
161
|
+
type: PropType<number>;
|
|
155
162
|
required: true;
|
|
156
163
|
};
|
|
157
164
|
/**
|
|
@@ -159,29 +166,35 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
159
166
|
* @see MapOptions.infoWindowMode
|
|
160
167
|
*/
|
|
161
168
|
infoWindowMode: {
|
|
162
|
-
type:
|
|
169
|
+
type: PropType<"single" | "multi">;
|
|
163
170
|
};
|
|
164
171
|
gestureHandling: {
|
|
165
|
-
type:
|
|
172
|
+
type: PropType<StringEnumValue<typeof GestureHandlingOptions>>; /**
|
|
173
|
+
* 仅用来获取center的值, 需要设置center的值请使用`center`属性
|
|
174
|
+
* @see center
|
|
175
|
+
* */
|
|
166
176
|
};
|
|
167
177
|
minZoom: {
|
|
168
|
-
type:
|
|
178
|
+
type: PropType<number>;
|
|
169
179
|
};
|
|
170
180
|
maxZoom: {
|
|
171
|
-
type:
|
|
181
|
+
type: PropType<number>;
|
|
172
182
|
};
|
|
173
183
|
mapStyle: {
|
|
174
|
-
type:
|
|
184
|
+
type: PropType<MapStyle>;
|
|
175
185
|
};
|
|
176
186
|
mapTypeId: {
|
|
177
|
-
type:
|
|
187
|
+
type: PropType<StringEnumValue<typeof BuildInMapTypeId>>; /**
|
|
188
|
+
* 仅用来获取center的值, 需要设置center的值请使用`center`属性
|
|
189
|
+
* @see center
|
|
190
|
+
* */
|
|
178
191
|
};
|
|
179
192
|
/** 地图类型对象, 优先级比mapTypeId高 */
|
|
180
193
|
mapType: {
|
|
181
|
-
type:
|
|
194
|
+
type: PropType<any>;
|
|
182
195
|
};
|
|
183
196
|
hideLogo: {
|
|
184
|
-
type:
|
|
197
|
+
type: PropType<boolean>;
|
|
185
198
|
};
|
|
186
199
|
onLoad: import("vue").Prop<import("../utils/vue-utils").EventCallback<AbstractMap>>;
|
|
187
200
|
'onUpdate:center': import("vue").Prop<import("../utils/vue-utils").EventCallback<LatLng>>;
|
|
@@ -20,8 +20,10 @@ export * from '../map/map/extra/marker-clusterer';
|
|
|
20
20
|
export * from '../map/map/extra/places-service';
|
|
21
21
|
export * from '../map/map/extra/search-box';
|
|
22
22
|
export * from '../map/map/map';
|
|
23
|
+
export * from '../map/map/map-options';
|
|
23
24
|
export * from '../map/map/map-type';
|
|
24
25
|
export * from '../map/map/overlay/circle';
|
|
26
|
+
export * from '../map/map/overlay/element-overlay';
|
|
25
27
|
export * from '../map/map/overlay/icon';
|
|
26
28
|
export * from '../map/map/overlay/info-box';
|
|
27
29
|
export * from '../map/map/overlay/info-window';
|
|
@@ -102,7 +102,7 @@ declare const TgMarker: import("vue").DefineComponent<{
|
|
|
102
102
|
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
103
103
|
[key: string]: any;
|
|
104
104
|
}>) => void)[] | undefined;
|
|
105
|
-
readonly mapPane?: import("../../utils/mapped-types").StringEnumValue<typeof import("
|
|
105
|
+
readonly mapPane?: import("../../utils/mapped-types").StringEnumValue<typeof import("..").MapPane> | undefined;
|
|
106
106
|
};
|
|
107
107
|
$attrs: {
|
|
108
108
|
[x: string]: unknown;
|
|
@@ -128,7 +128,7 @@ declare const TgMarker: import("vue").DefineComponent<{
|
|
|
128
128
|
type: PropType<number>;
|
|
129
129
|
};
|
|
130
130
|
mapPane: {
|
|
131
|
-
type: PropType<import("../../utils/mapped-types").StringEnumValue<typeof import("
|
|
131
|
+
type: PropType<import("../../utils/mapped-types").StringEnumValue<typeof import("..").MapPane>>;
|
|
132
132
|
};
|
|
133
133
|
}>> & {
|
|
134
134
|
onClick?: ((event: import("../../map/event").Tg.Event) => any) | undefined;
|
|
@@ -177,7 +177,7 @@ declare const TgMarker: import("vue").DefineComponent<{
|
|
|
177
177
|
type: PropType<number>;
|
|
178
178
|
};
|
|
179
179
|
mapPane: {
|
|
180
|
-
type: PropType<import("../../utils/mapped-types").StringEnumValue<typeof import("
|
|
180
|
+
type: PropType<import("../../utils/mapped-types").StringEnumValue<typeof import("..").MapPane>>;
|
|
181
181
|
};
|
|
182
182
|
}>> & {
|
|
183
183
|
onClick?: ((event: import("../../map/event").Tg.Event) => any) | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type TgMapConfig } from './map-config';
|
|
2
2
|
import { TgMapType } from './map-factory';
|
|
3
3
|
/**
|
|
4
4
|
* 使用类型映射的方式`TgMapConfig[T]`, 确定`type`的类型之后, 不会自动推断`config`的类型,
|
|
@@ -8,6 +8,10 @@ type LoadMapOptions<T extends TgMapType> = {
|
|
|
8
8
|
type: T;
|
|
9
9
|
config: TgMapConfig[T];
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* 加载缓存的地图, 保证一种地图只加载一次
|
|
13
|
+
*/
|
|
14
|
+
export declare function loadCachedMap(type: TgMapType): Promise<unknown>;
|
|
11
15
|
/** 载入地图库 */
|
|
12
16
|
export declare function loadMap<T extends TgMapType>(options: LoadMapOptions<T>): Promise<unknown>;
|
|
13
17
|
export declare function loadJsonp(url: string, callbackParamName?: string): Promise<unknown>;
|
|
@@ -8,10 +8,20 @@ export declare namespace Objects {
|
|
|
8
8
|
function toJsonSafely(value: any): string;
|
|
9
9
|
/** 删除obj中纯对象上的值为undefined的属性 */
|
|
10
10
|
function deleteUndefinedPropertyOnPlainObjectDeeply(obj: any): void;
|
|
11
|
+
/** 存在则返回, 不存在则新建 */
|
|
12
|
+
function putIfAbsent<K extends keyof any, V>(obj: Record<K, V>, key: K, ifAbsent: () => Exclude<V, undefined>): Exclude<V, undefined>;
|
|
11
13
|
/** @see Omit */
|
|
12
14
|
function omit<T, K extends keyof any>(obj: T, ...keys: K[]): Omit<T, K>;
|
|
13
15
|
/** @see Pick */
|
|
14
16
|
function pick<T, K extends keyof T>(obj: T, ...keys: K[]): Pick<T, K>;
|
|
17
|
+
/**
|
|
18
|
+
* 使用{@link keyPath}读取`obj`的字段
|
|
19
|
+
*
|
|
20
|
+
* @param keyPath `.`分隔的字段名 或 字段名数组
|
|
21
|
+
* @returns 若字段不存在, 则返回`undefined`
|
|
22
|
+
*/
|
|
23
|
+
function get(obj: any, keyPath: string | string[]): any;
|
|
24
|
+
function del(obj: any, keyPath: string | string[]): any;
|
|
15
25
|
}
|
|
16
26
|
/** 用于替代Vue2中的filter, 直接交给模板使用 */
|
|
17
27
|
export declare const stringify: typeof Objects.toJsonSafely;
|
|
@@ -14,3 +14,7 @@ export declare function isDef<T>(v: T | undefined | null): v is T;
|
|
|
14
14
|
* @see isDef
|
|
15
15
|
*/
|
|
16
16
|
export declare function isEntryValueDef<K, V>(entry: [K, V]): entry is [K, NonNullable<V>];
|
|
17
|
+
/**
|
|
18
|
+
* 创建一个异步初始化的单例, 保证只初始化成功一次
|
|
19
|
+
*/
|
|
20
|
+
export declare function createAsyncSingleton<T>(creator: () => Promise<T>): () => Promise<T>;
|