tg-map-vue3 3.7.7 → 3.7.9
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 +3 -0
- package/dist/src/components/TgMap.vue.d.ts +16 -4
- package/dist/src/components/controls/TgStreetViewControl.vue.d.ts +19 -0
- package/dist/src/components/index.d.ts +3 -1
- package/dist/src/map/map/baidu-map.d.ts +2 -0
- package/dist/src/map/map/controls/control.d.ts +13 -0
- package/dist/src/map/map/controls/street-view.control.d.ts +20 -0
- package/dist/src/map/map/google-map.d.ts +2 -0
- package/dist/src/map/map/here-map.d.ts +2 -0
- package/dist/src/map/map/map.d.ts +2 -0
- package/dist/src/map/map-loader.d.ts +5 -1
- package/dist/src/map/unions.d.ts +1 -0
- package/dist/src/utils/objects.d.ts +10 -0
- package/dist/src/utils/utils.d.ts +4 -0
- package/dist/tg-map.js +1170 -1081
- package/dist/tg-map.js.map +1 -1
- package/dist/tg-map.umd.cjs +7 -7
- package/dist/tg-map.umd.cjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
## 3.7.x
|
|
4
4
|
|
|
5
5
|
- feat: 添加[IconSequence]到[TgPolyline]中
|
|
6
|
+
- fix: 多个地图同时载入时报错的问题
|
|
6
7
|
- feat: [TgMarker]添加`autoAddToClusterer`属性, 可以不被点聚合管理
|
|
7
8
|
- ***BREAKING CHANGE***: [MapStyle]简化成纯对象, 方便使用
|
|
9
|
+
- ***BREAKING CHANGE***: 增加[TgStreetViewControl], 默认关闭google的街景控制按钮
|
|
8
10
|
|
|
9
11
|
## 3.6.x
|
|
10
12
|
|
|
@@ -58,6 +60,7 @@
|
|
|
58
60
|
[TgMarker]: src/components/overlays/TgMarker.vue
|
|
59
61
|
[TgInfoBox]: src/components/overlays/TgInfoBox.vue
|
|
60
62
|
[TgInfoWindow]: src/components/overlays/TgInfoWindow.vue
|
|
63
|
+
[TgStreetViewControl]: src/components/controls/TgStreetViewControl.vue
|
|
61
64
|
[Icon]: src/map/map/overlay/icon.ts#L18 "图标"
|
|
62
65
|
[SymbolIcon]: src/map/map/overlay/icon.ts#L139 "Svg图标"
|
|
63
66
|
[IconSequence]: src/map/map/overlay/icon.ts#L55 "Svg图标序列"
|
|
@@ -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: {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ControlPosition } from '../../map/map/controls/control';
|
|
2
|
+
import { createEmptyVNode } from '../../utils/vue-utils';
|
|
3
|
+
/**
|
|
4
|
+
* 街景控件, 当前只有google支持
|
|
5
|
+
* */
|
|
6
|
+
declare const _default: import("vue").DefineComponent<{
|
|
7
|
+
position: {
|
|
8
|
+
type: import("vue").PropType<import("../../utils/mapped-types").StringEnumValue<typeof ControlPosition>>;
|
|
9
|
+
default: ControlPosition;
|
|
10
|
+
};
|
|
11
|
+
}, typeof createEmptyVNode, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
12
|
+
position: {
|
|
13
|
+
type: import("vue").PropType<import("../../utils/mapped-types").StringEnumValue<typeof ControlPosition>>;
|
|
14
|
+
default: ControlPosition;
|
|
15
|
+
};
|
|
16
|
+
}>>, {
|
|
17
|
+
position: import("../../utils/mapped-types").StringEnumValue<typeof ControlPosition>;
|
|
18
|
+
}, {}>;
|
|
19
|
+
export default _default;
|
|
@@ -13,6 +13,7 @@ export * from '../map/map-factory';
|
|
|
13
13
|
export * from '../map/map/controls/control';
|
|
14
14
|
export * from '../map/map/controls/map-type.control';
|
|
15
15
|
export * from '../map/map/controls/scale.control';
|
|
16
|
+
export * from '../map/map/controls/street-view.control';
|
|
16
17
|
export * from '../map/map/controls/zoom.control';
|
|
17
18
|
export * from '../map/map/extra/autocomplete';
|
|
18
19
|
export * from '../map/map/extra/map-urls';
|
|
@@ -47,6 +48,7 @@ export { default as TgMapWidget } from './TgMapWidget.vue';
|
|
|
47
48
|
export { default as TgCustomControl } from './controls/TgCustomControl.vue';
|
|
48
49
|
export { default as TgMapTypeControl } from './controls/TgMapTypeControl.vue';
|
|
49
50
|
export { default as TgScaleControl } from './controls/TgScaleControl.vue';
|
|
51
|
+
export { default as TgStreetViewControl } from './controls/TgStreetViewControl.vue';
|
|
50
52
|
export { default as TgZoomControl } from './controls/TgZoomControl.vue';
|
|
51
53
|
export { default as TgMarkerClusterer } from './extra/TgMarkerClusterer.vue';
|
|
52
54
|
export { default as TgTrafficLayer } from './layers/TgTrafficLayer.vue';
|
|
@@ -60,4 +62,4 @@ export { default as TgMarker } from './overlays/TgMarker.vue';
|
|
|
60
62
|
export { default as TgPolygon } from './overlays/TgPolygon.vue';
|
|
61
63
|
export { default as TgPolyline } from './overlays/TgPolyline.vue';
|
|
62
64
|
export { default as TgRectangle } from './overlays/TgRectangle.vue';
|
|
63
|
-
export {
|
|
65
|
+
export { LifecycleLogPlugin, MIXIN_HOOK_CREATE, MIXIN_HOOK_DESTROY, MIXIN_MAP_NAME, MapMixin, getTgMapConfig, setTgMapConfig, type LifecycleLogOptions, type PartialTgMapConfig, type TgMapConfig, };
|
|
@@ -3,6 +3,7 @@ import type { Padding, Point } from '../types';
|
|
|
3
3
|
import { CustomControl } from './controls/control';
|
|
4
4
|
import { BaiduMapTypeControl } from './controls/map-type.control';
|
|
5
5
|
import { BaiduScaleControl } from './controls/scale.control';
|
|
6
|
+
import { BaiduStreetViewControl } from './controls/street-view.control';
|
|
6
7
|
import { BaiduZoomControl } from './controls/zoom.control';
|
|
7
8
|
import { type Autocomplete, type AutocompleteOptions } from './extra/autocomplete';
|
|
8
9
|
import { type MapUrls, type MapUrlsOptions } from './extra/map-urls';
|
|
@@ -69,6 +70,7 @@ export declare class BaiduMap extends AbstractMap {
|
|
|
69
70
|
createMarker: typeof BaiduMarker.create;
|
|
70
71
|
createMapTypeControl: typeof BaiduMapTypeControl.create;
|
|
71
72
|
createZoomControl: typeof BaiduZoomControl.create;
|
|
73
|
+
createStreetViewControl: typeof BaiduStreetViewControl.create;
|
|
72
74
|
createScaleControl: typeof BaiduScaleControl.create;
|
|
73
75
|
createMarkerClusterer(options: MarkerClustererOptions): BaiduMarkerClusterer;
|
|
74
76
|
createAutocomplete(options: AutocompleteOptions): Autocomplete;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="google.maps" />
|
|
2
|
+
/// <reference types="baidumap-web-sdk" />
|
|
2
3
|
import { KeyValue } from '../../../utils/values';
|
|
3
4
|
import type { UnionControl } from '../../unions';
|
|
4
5
|
import type { BaiduMap } from '../baidu-map';
|
|
@@ -48,6 +49,18 @@ export declare abstract class AbstractControl {
|
|
|
48
49
|
abstract addTo(map: AbstractMap): void;
|
|
49
50
|
abstract removeFrom(map: AbstractMap): void;
|
|
50
51
|
}
|
|
52
|
+
/** Control的空实现 */
|
|
53
|
+
export declare class EmptyControl extends AbstractControl {
|
|
54
|
+
private visible;
|
|
55
|
+
private position;
|
|
56
|
+
constructor(visible: boolean, position: ControlPosition);
|
|
57
|
+
isVisible(): boolean;
|
|
58
|
+
setVisible(visible: boolean): void;
|
|
59
|
+
getPosition(): ControlPosition;
|
|
60
|
+
setPosition(position: ControlPosition): void;
|
|
61
|
+
addTo(_map: AbstractMap): void;
|
|
62
|
+
removeFrom(_map: AbstractMap): void;
|
|
63
|
+
}
|
|
51
64
|
/**
|
|
52
65
|
* baidu内置的Control
|
|
53
66
|
* - NavigationControl
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BaiduMap } from '../baidu-map';
|
|
2
|
+
import type { GoogleMap } from '../google-map';
|
|
3
|
+
import { AbstractControl, ControlPosition, EmptyControl, GoogleControl } from './control';
|
|
4
|
+
/**
|
|
5
|
+
* ## 不同实现
|
|
6
|
+
* - google: 支持街景控件
|
|
7
|
+
* - baidu: 不支持, {@link BaiduStreetViewControl}是一个空实现
|
|
8
|
+
*/
|
|
9
|
+
export interface StreetViewControl extends AbstractControl {
|
|
10
|
+
}
|
|
11
|
+
export interface StreetViewControlOptions {
|
|
12
|
+
position?: ControlPosition;
|
|
13
|
+
}
|
|
14
|
+
export declare class BaiduStreetViewControl extends EmptyControl implements StreetViewControl {
|
|
15
|
+
static create(this: BaiduMap, options: StreetViewControlOptions): BaiduStreetViewControl;
|
|
16
|
+
}
|
|
17
|
+
export declare class GoogleStreetViewControl extends GoogleControl implements StreetViewControl {
|
|
18
|
+
static create(this: GoogleMap, options: StreetViewControlOptions): GoogleStreetViewControl;
|
|
19
|
+
constructor(position?: ControlPosition);
|
|
20
|
+
}
|
|
@@ -4,6 +4,7 @@ import { Point, type Padding } from '../types';
|
|
|
4
4
|
import { CustomControl } from './controls/control';
|
|
5
5
|
import { GoogleMapTypeControl } from './controls/map-type.control';
|
|
6
6
|
import { GoogleScaleControl } from './controls/scale.control';
|
|
7
|
+
import { GoogleStreetViewControl } from './controls/street-view.control';
|
|
7
8
|
import { GoogleZoomControl } from './controls/zoom.control';
|
|
8
9
|
import { Autocomplete, type AutocompleteOptions } from './extra/autocomplete';
|
|
9
10
|
import { type MapUrls, type MapUrlsOptions } from './extra/map-urls';
|
|
@@ -69,6 +70,7 @@ export declare class GoogleMap extends AbstractMap {
|
|
|
69
70
|
createMarker: typeof GoogleMarker.create;
|
|
70
71
|
createMapTypeControl: typeof GoogleMapTypeControl.create;
|
|
71
72
|
createZoomControl: typeof GoogleZoomControl.create;
|
|
73
|
+
createStreetViewControl: typeof GoogleStreetViewControl.create;
|
|
72
74
|
createScaleControl: typeof GoogleScaleControl.create;
|
|
73
75
|
createMarkerClusterer(options: MarkerClustererOptions): GoogleMarkerClusterer;
|
|
74
76
|
createAutocomplete(options: AutocompleteOptions): Autocomplete;
|
|
@@ -4,6 +4,7 @@ import type { Padding, Point } from '../types';
|
|
|
4
4
|
import type { CustomControl } from './controls/control';
|
|
5
5
|
import type { MapTypeControl, MapTypeControlOptions } from './controls/map-type.control';
|
|
6
6
|
import type { ScaleControlOptions } from './controls/scale.control';
|
|
7
|
+
import type { StreetViewControl, StreetViewControlOptions } from './controls/street-view.control';
|
|
7
8
|
import type { ZoomControl, ZoomControlOptions } from './controls/zoom.control';
|
|
8
9
|
import type { Autocomplete, AutocompleteOptions } from './extra/autocomplete';
|
|
9
10
|
import type { MapUrls, MapUrlsOptions } from './extra/map-urls';
|
|
@@ -71,5 +72,6 @@ export declare class HereMap extends AbstractMap {
|
|
|
71
72
|
removeCustomControl(control: CustomControl): void;
|
|
72
73
|
createMapTypeControl(options: MapTypeControlOptions): MapTypeControl;
|
|
73
74
|
createZoomControl(options: ZoomControlOptions): ZoomControl;
|
|
75
|
+
createStreetViewControl(options: StreetViewControlOptions): StreetViewControl;
|
|
74
76
|
createScaleControl(options: ScaleControlOptions): ZoomControl;
|
|
75
77
|
}
|
|
@@ -7,6 +7,7 @@ import type { UnionMap } from '../unions';
|
|
|
7
7
|
import type { AbstractControl, CustomControl } from './controls/control';
|
|
8
8
|
import type { MapTypeControl, MapTypeControlOptions } from './controls/map-type.control';
|
|
9
9
|
import type { ScaleControlOptions } from './controls/scale.control';
|
|
10
|
+
import type { StreetViewControl, StreetViewControlOptions } from './controls/street-view.control';
|
|
10
11
|
import type { ZoomControl, ZoomControlOptions } from './controls/zoom.control';
|
|
11
12
|
import type { Autocomplete, AutocompleteOptions } from './extra/autocomplete';
|
|
12
13
|
import type { MapUrls, MapUrlsOptions } from './extra/map-urls';
|
|
@@ -155,6 +156,7 @@ export declare abstract class AbstractMap implements CoordTypeSupplier, Tg.Event
|
|
|
155
156
|
abstract removeCustomControl(control: CustomControl): void;
|
|
156
157
|
abstract createMapTypeControl(options: MapTypeControlOptions): MapTypeControl;
|
|
157
158
|
abstract createZoomControl(options: ZoomControlOptions): ZoomControl;
|
|
159
|
+
abstract createStreetViewControl(options: StreetViewControlOptions): StreetViewControl;
|
|
158
160
|
abstract createScaleControl(options: ScaleControlOptions): ZoomControl;
|
|
159
161
|
addControl(control: AbstractControl): void;
|
|
160
162
|
removeControl(control: AbstractControl): void;
|
|
@@ -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>;
|
package/dist/src/map/unions.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/// <reference types="heremaps" />
|
|
3
3
|
/// <reference types="baidumap-web-sdk" />
|
|
4
4
|
/// <reference types="baidumap-web-sdk" />
|
|
5
|
+
/// <reference types="baidumap-web-sdk" />
|
|
5
6
|
import type { BaiduInfoBox } from './map/overlay/baidu-info-box';
|
|
6
7
|
import type { GoogleLabel } from './map/overlay/google-label';
|
|
7
8
|
/**
|
|
@@ -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>;
|