tg-map-vue3 3.8.9 → 3.9.3
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/README.md +8 -12
- package/dist/src/components/TgMap.vue.d.ts +33 -33
- package/dist/src/components/controls/TgCustomControl.vue.d.ts +1 -1
- package/dist/src/components/controls/TgMapTypeControl.vue.d.ts +6 -6
- package/dist/src/components/controls/TgScaleControl.vue.d.ts +3 -3
- package/dist/src/components/controls/TgStreetViewControl.vue.d.ts +3 -3
- package/dist/src/components/controls/TgZoomControl.vue.d.ts +3 -3
- package/dist/src/components/extra/TgHeatmap.vue.d.ts +2 -2
- package/dist/src/components/extra/TgMarkerClusterer.vue.d.ts +2 -2
- package/dist/src/components/index.d.ts +4 -5
- package/dist/src/components/overlays/TgCircle.vue.d.ts +12 -12
- package/dist/src/components/overlays/TgElementOverlay.vue.d.ts +4 -4
- package/dist/src/components/overlays/TgMarker.vue.d.ts +21 -21
- package/dist/src/components/overlays/TgPolygon.vue.d.ts +9 -9
- package/dist/src/components/overlays/TgPolyline.vue.d.ts +9 -9
- package/dist/src/components/overlays/TgRectangle.vue.d.ts +9 -9
- package/dist/src/map/lat-lng.d.ts +0 -3
- package/dist/src/map/map/controls/control.d.ts +0 -2
- package/dist/src/map/map/controls/map-type.control.d.ts +0 -1
- package/dist/src/map/map/controls/zoom.control.d.ts +0 -1
- package/dist/src/map/map/extra/autocomplete.d.ts +0 -1
- package/dist/src/map/map/extra/heatmap.d.ts +0 -1
- package/dist/src/map/map/extra/places-service.d.ts +0 -2
- package/dist/src/map/map/google-map.d.ts +0 -1
- package/dist/src/map/map/here-map.d.ts +0 -1
- package/dist/src/map/map/map-options.d.ts +0 -2
- package/dist/src/map/map/map-type.d.ts +0 -3
- package/dist/src/map/map/overlay/baidu-info-box.d.ts +1 -2
- package/dist/src/map/map/overlay/circle.d.ts +0 -2
- package/dist/src/map/map/overlay/element-overlay.d.ts +0 -2
- package/dist/src/map/map/overlay/google-label.d.ts +11 -12
- package/dist/src/map/map/overlay/icon.d.ts +0 -2
- package/dist/src/map/map/overlay/info-window.d.ts +0 -1
- package/dist/src/map/map/overlay/label.d.ts +0 -1
- package/dist/src/map/map/overlay/marker.d.ts +0 -1
- package/dist/src/map/map/overlay/polygon.d.ts +0 -2
- package/dist/src/map/map/overlay/polyline.d.ts +0 -3
- package/dist/src/map/map/overlay/rectangle.d.ts +0 -2
- package/dist/src/map/unions.d.ts +0 -5
- package/dist/src/utils/arrays.d.ts +1 -13
- package/dist/src/utils/google-utils.d.ts +0 -1
- package/dist/src/utils/mapped-types.d.ts +0 -7
- package/dist/src/utils/strings.d.ts +0 -5
- package/dist/src/utils/utils.d.ts +1 -8
- package/dist/tg-map.cjs +18 -0
- package/dist/tg-map.cjs.map +1 -0
- package/dist/tg-map.js +1318 -1369
- package/dist/tg-map.js.map +1 -1
- package/package.json +13 -7
- package/src/map/dts/baidu.d.ts +53 -0
- package/src/map/dts/google.d.ts +10 -0
- package/src/map/dts/here-v31.d.ts +16 -0
- package/src/map/dts/index.d.ts +4 -0
- package/src/map/dts/js-modules.d.ts +15 -0
- package/dist/src/utils/assert.d.ts +0 -9
- package/dist/tg-map.umd.cjs +0 -18
- package/dist/tg-map.umd.cjs.map +0 -1
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="google.maps" />
|
|
2
|
-
/// <reference types="baidumap-web-sdk" />
|
|
3
1
|
import { LatLng, LatLngBounds, Location, type AbstractMap } from '../../../components';
|
|
4
2
|
import type { UnionPlacesService } from '../../unions';
|
|
5
3
|
import type { BaiduMap } from '../baidu-map';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="baidumap-web-sdk" />
|
|
2
1
|
import { Point } from '../../types';
|
|
3
2
|
import './baidu-info-box.scss';
|
|
4
3
|
import type { BMarker } from './marker';
|
|
@@ -14,7 +13,7 @@ export declare function createBaiduInfoBox(content: HTMLElement, position?: BMap
|
|
|
14
13
|
offset: Point;
|
|
15
14
|
initialize(map: BMap.Map): HTMLElement;
|
|
16
15
|
draw(): void;
|
|
17
|
-
open(map: BMap.Map, anchor?: BMarker
|
|
16
|
+
open(map: BMap.Map, anchor?: BMarker): void;
|
|
18
17
|
attachMarker(marker: BMarker): void;
|
|
19
18
|
detachMarker(marker: BMarker): void;
|
|
20
19
|
close(): void;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { type Nullable } from '../../../components';
|
|
1
|
+
import { type Nullable } from 'tg-commons';
|
|
3
2
|
import type { Point } from '../../types';
|
|
4
3
|
import { MapPane } from './element-overlay';
|
|
5
4
|
export type GoogleLabel = InstanceType<ReturnType<typeof createGoogleLabelClass>>;
|
|
@@ -19,25 +18,25 @@ export declare function createGoogleLabel(element: HTMLElement, position: Nullab
|
|
|
19
18
|
getOffset(): Point | undefined;
|
|
20
19
|
getVisible(): boolean;
|
|
21
20
|
setVisible(visible: boolean): void;
|
|
22
|
-
getMap(): google.maps.Map | google.maps.StreetViewPanorama
|
|
21
|
+
getMap(): google.maps.Map | null | google.maps.StreetViewPanorama;
|
|
23
22
|
getPanes(): google.maps.MapPanes | null;
|
|
24
23
|
getProjection(): google.maps.MapCanvasProjection;
|
|
25
|
-
setMap(map: google.maps.Map | google.maps.StreetViewPanorama
|
|
24
|
+
setMap(map: google.maps.Map | null | google.maps.StreetViewPanorama): void;
|
|
26
25
|
addListener(eventName: string, handler: Function): google.maps.MapsEventListener;
|
|
27
|
-
bindTo(key: string, target: google.maps.MVCObject, targetKey?: string | null
|
|
26
|
+
bindTo(key: string, target: google.maps.MVCObject, targetKey?: string | null, noNotify?: boolean): void;
|
|
28
27
|
get(key: string): any;
|
|
29
28
|
notify(key: string): void;
|
|
30
29
|
set(key: string, value: any): void;
|
|
31
|
-
setValues(values?: object | null
|
|
30
|
+
setValues(values?: object | null): void;
|
|
32
31
|
unbind(key: string): void;
|
|
33
32
|
unbindAll(): void;
|
|
34
33
|
};
|
|
35
34
|
/** 打开页面时 google.maps.OverlayView 并没有加载, 故需要将GoogleLabel类写到方法中去 */
|
|
36
35
|
declare function createGoogleLabelClass(): {
|
|
37
|
-
new (element: HTMLElement, position: Nullable<google.maps.LatLng>, offset?: Point, _mapPane?: MapPane, zIndex?: number): {
|
|
36
|
+
new (element: HTMLElement, position: Nullable<google.maps.LatLng>, offset?: Point | undefined, _mapPane?: MapPane, zIndex?: number): {
|
|
38
37
|
container: HTMLElement;
|
|
39
38
|
position: Nullable<google.maps.LatLng>;
|
|
40
|
-
offset?: Point;
|
|
39
|
+
offset?: Point | undefined;
|
|
41
40
|
_mapPane: MapPane;
|
|
42
41
|
setZIndex(zIndex: number): void;
|
|
43
42
|
setElement(element: HTMLElement): void;
|
|
@@ -50,16 +49,16 @@ declare function createGoogleLabelClass(): {
|
|
|
50
49
|
getOffset(): Point | undefined;
|
|
51
50
|
getVisible(): boolean;
|
|
52
51
|
setVisible(visible: boolean): void;
|
|
53
|
-
getMap(): google.maps.Map | google.maps.StreetViewPanorama
|
|
52
|
+
getMap(): google.maps.Map | null | google.maps.StreetViewPanorama;
|
|
54
53
|
getPanes(): google.maps.MapPanes | null;
|
|
55
54
|
getProjection(): google.maps.MapCanvasProjection;
|
|
56
|
-
setMap(map: google.maps.Map | google.maps.StreetViewPanorama
|
|
55
|
+
setMap(map: google.maps.Map | null | google.maps.StreetViewPanorama): void;
|
|
57
56
|
addListener(eventName: string, handler: Function): google.maps.MapsEventListener;
|
|
58
|
-
bindTo(key: string, target: google.maps.MVCObject, targetKey?: string | null
|
|
57
|
+
bindTo(key: string, target: google.maps.MVCObject, targetKey?: string | null, noNotify?: boolean): void;
|
|
59
58
|
get(key: string): any;
|
|
60
59
|
notify(key: string): void;
|
|
61
60
|
set(key: string, value: any): void;
|
|
62
|
-
setValues(values?: object | null
|
|
61
|
+
setValues(values?: object | null): void;
|
|
63
62
|
unbind(key: string): void;
|
|
64
63
|
unbindAll(): void;
|
|
65
64
|
};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/// <reference types="baidumap-web-sdk" />
|
|
2
|
-
/// <reference types="baidumap-web-sdk" />
|
|
3
|
-
/// <reference types="google.maps" />
|
|
4
1
|
import type { Tg } from '../../event';
|
|
5
2
|
import { EventHubEventTargetDelegate } from '../../event-target';
|
|
6
3
|
import { LatLng } from '../../lat-lng';
|
package/dist/src/map/unions.d.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/// <reference types="google.maps" />
|
|
2
|
-
/// <reference types="heremaps" />
|
|
3
|
-
/// <reference types="baidumap-web-sdk" />
|
|
4
|
-
/// <reference types="baidumap-web-sdk" />
|
|
5
|
-
/// <reference types="baidumap-web-sdk" />
|
|
6
1
|
import type { BaiduInfoBox } from './map/overlay/baidu-info-box';
|
|
7
2
|
import type { GoogleLabel } from './map/overlay/google-label';
|
|
8
3
|
/**
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { type AnyFunction, type Constructor } from '../components';
|
|
1
|
+
import type { AnyFunction, Constructor } from './mapped-types';
|
|
3
2
|
export declare namespace Arrays {
|
|
4
|
-
/**
|
|
5
|
-
* 浅层比较
|
|
6
|
-
* @see https://stackoverflow.com/questions/7837456/how-to-compare-arrays-in-javascript
|
|
7
|
-
* */
|
|
8
|
-
function equals<T>(a: T[], b: T[]): boolean;
|
|
9
|
-
function remove<T>(arr: T[], item: T): T | undefined;
|
|
10
3
|
function findByType<T>(arr: any[], constructor: Constructor<T>): T | undefined;
|
|
11
4
|
/** 自动推断item的类型的{@link Array.includes} */
|
|
12
5
|
function includesTyped<T extends E, E>(arr: T[], item: E): item is T;
|
|
@@ -14,11 +7,6 @@ export declare namespace Arrays {
|
|
|
14
7
|
function at<T>(arr: T[], index: number, value: T): void;
|
|
15
8
|
/** 获取 指定位置的值 */
|
|
16
9
|
function at<T>(arr: T[], index: number): T | undefined;
|
|
17
|
-
/**
|
|
18
|
-
* 判断并推断数组非空
|
|
19
|
-
* @see https://stackoverflow.com/questions/56006111/is-it-possible-to-define-a-non-empty-array-type-in-typescript
|
|
20
|
-
*/
|
|
21
|
-
function isNotEmpty<T>(arr: T[]): arr is [T, ...T[]];
|
|
22
10
|
}
|
|
23
11
|
export declare namespace MVCArrays {
|
|
24
12
|
function indexOf<T>(arr: google.maps.MVCArray<T>, item: T): number;
|
|
@@ -19,13 +19,6 @@ export type AbstractConstructor<T = {}> = abstract new (...args: any[]) => T;
|
|
|
19
19
|
export type PrimitiveToWrapper<T> = T extends boolean ? Boolean : T extends string ? String : T extends number ? Number : T;
|
|
20
20
|
/** 包装类型=>原始类型 */
|
|
21
21
|
export type WrapperToPrimitive<T> = T extends Boolean ? boolean : T extends String ? string : T extends Number ? number : T;
|
|
22
|
-
/**
|
|
23
|
-
* 返回undefined但类型是指定的泛型T, 需要你自身保证在使用前先初始化
|
|
24
|
-
* 模仿了kotlin的lateinit关键字
|
|
25
|
-
* */
|
|
26
|
-
export declare function lateinit<T>(): T;
|
|
27
|
-
export declare function typed<T>(): T | undefined;
|
|
28
|
-
export declare function typed<T>(t: T): T;
|
|
29
22
|
/**
|
|
30
23
|
* `vue instanceof VueConstructor`时`vue`并不会自动转换成`VueConstructor`的子类, 用该方法可以实现这种转换
|
|
31
24
|
*/
|
|
@@ -19,8 +19,3 @@ export declare namespace Strings {
|
|
|
19
19
|
* */
|
|
20
20
|
function isInt(str: string): boolean;
|
|
21
21
|
}
|
|
22
|
-
/** @see https://github.com/browserify/path-browserify */
|
|
23
|
-
export declare const path: {
|
|
24
|
-
/** @see https://nodejs.org/docs/v10.3.0/api/path.html#path_path_basename_path_ext */
|
|
25
|
-
basename(path: string, ext?: string): string;
|
|
26
|
-
};
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
/** 抛异常是语句不是表达式, 使用该方法替换则可以在表达式中使用 */
|
|
2
|
-
export declare function throwError(msg?: string): never;
|
|
3
|
-
export declare function throwUnsupported(msg?: string): never;
|
|
4
1
|
export declare function todo(msg?: string): never;
|
|
5
2
|
export declare function debug(msg?: any): any;
|
|
6
|
-
/** 啥也不做 */
|
|
7
|
-
export declare function noop(...args: any[]): void;
|
|
8
|
-
/** 可以用在Array.filter(isDef)中, 用来过滤为空的值 */
|
|
9
|
-
export declare function isDef<T>(v: T | undefined | null): v is T;
|
|
10
3
|
/**
|
|
11
4
|
* entry的value是否定义了
|
|
12
5
|
*
|
|
13
6
|
* 可以用在Array.filter(isEntryValueDef)中, 用来过滤值为空的元素
|
|
14
|
-
* @see
|
|
7
|
+
* @see isNotNull
|
|
15
8
|
*/
|
|
16
9
|
export declare function isEntryValueDef<K, V>(entry: [K, V]): entry is [K, NonNullable<V>];
|
|
17
10
|
/**
|