tg-map-vue3 3.7.6 → 3.7.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/CHANGELOG.md CHANGED
@@ -3,6 +3,7 @@
3
3
  ## 3.7.x
4
4
 
5
5
  - feat: 添加[IconSequence]到[TgPolyline]中
6
+ - fix: 多个地图同时载入时报错的问题
6
7
  - feat: [TgMarker]添加`autoAddToClusterer`属性, 可以不被点聚合管理
7
8
  - ***BREAKING CHANGE***: [MapStyle]简化成纯对象, 方便使用
8
9
 
@@ -69,7 +69,10 @@ declare const _default: import("vue").DefineComponent<{
69
69
  type: PropType<"single" | "multi">;
70
70
  };
71
71
  gestureHandling: {
72
- type: PropType<StringEnumValue<typeof GestureHandlingOptions>>;
72
+ type: PropType<StringEnumValue<typeof GestureHandlingOptions>>; /**
73
+ * 仅用来获取center的值, 需要设置center的值请使用`center`属性
74
+ * @see center
75
+ * */
73
76
  };
74
77
  minZoom: {
75
78
  type: PropType<number>;
@@ -81,7 +84,10 @@ declare const _default: import("vue").DefineComponent<{
81
84
  type: PropType<MapStyle>;
82
85
  };
83
86
  mapTypeId: {
84
- type: PropType<StringEnumValue<typeof BuildInMapTypeId>>;
87
+ type: PropType<StringEnumValue<typeof BuildInMapTypeId>>; /**
88
+ * 仅用来获取center的值, 需要设置center的值请使用`center`属性
89
+ * @see center
90
+ * */
85
91
  };
86
92
  /** 地图类型对象, 优先级比mapTypeId高 */
87
93
  mapType: {
@@ -163,7 +169,10 @@ declare const _default: import("vue").DefineComponent<{
163
169
  type: PropType<"single" | "multi">;
164
170
  };
165
171
  gestureHandling: {
166
- type: PropType<StringEnumValue<typeof GestureHandlingOptions>>;
172
+ type: PropType<StringEnumValue<typeof GestureHandlingOptions>>; /**
173
+ * 仅用来获取center的值, 需要设置center的值请使用`center`属性
174
+ * @see center
175
+ * */
167
176
  };
168
177
  minZoom: {
169
178
  type: PropType<number>;
@@ -175,7 +184,10 @@ declare const _default: import("vue").DefineComponent<{
175
184
  type: PropType<MapStyle>;
176
185
  };
177
186
  mapTypeId: {
178
- type: PropType<StringEnumValue<typeof BuildInMapTypeId>>;
187
+ type: PropType<StringEnumValue<typeof BuildInMapTypeId>>; /**
188
+ * 仅用来获取center的值, 需要设置center的值请使用`center`属性
189
+ * @see center
190
+ * */
179
191
  };
180
192
  /** 地图类型对象, 优先级比mapTypeId高 */
181
193
  mapType: {
@@ -206,6 +206,7 @@ declare const TgMarker: import("vue").DefineComponent<{
206
206
  } & import("vue").ComponentCustomProperties & {}) | undefined;
207
207
  info: TgInfo | undefined;
208
208
  emittedPosition: LatLng | undefined;
209
+ autoAddToClustererWhenCreate: boolean;
209
210
  }, unknown, {}, {
210
211
  $clusterer(): TgMarkerClusterer | undefined;
211
212
  onAddLabel(label: TgLabel): void;
@@ -1,4 +1,4 @@
1
- import type { TgMapConfig } from './map-config';
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>;