tg-map-vue3 3.5.0 → 3.5.2
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 +4 -0
- package/dist/src/components/overlays/TgLabel.vue.d.ts +7 -0
- package/dist/src/components/overlays/TgMarker.vue.d.ts +7 -0
- package/dist/src/map/lat-lng.d.ts +1 -1
- package/dist/src/map/map/overlay/element-overlay.d.ts +5 -0
- package/dist/src/map/map/overlay/google-label.d.ts +5 -4
- package/dist/src/map/map/overlay/label.d.ts +7 -0
- package/dist/tg-map.js +691 -686
- 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 +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## 3.5.x
|
|
4
4
|
|
|
5
|
+
- fix: [LatLngBounds]为空时中心点计算问题
|
|
5
6
|
- ***BREAKING CHANGE***: `useTgMap` -> [useTgMapInner]
|
|
7
|
+
- ***BREAKING CHANGE***: 统一[TgLabel]在google和baidu上的默认显示层级, 都位于overlay上方
|
|
6
8
|
|
|
7
9
|
## 3.4.x
|
|
8
10
|
|
|
@@ -34,6 +36,7 @@
|
|
|
34
36
|
|
|
35
37
|
[TgMap]: src/components/TgMap.vue
|
|
36
38
|
[TgCircle]: src/components/overlays/TgCircle.vue
|
|
39
|
+
[TgLabel]: src/components/overlays/TgLabel.vue
|
|
37
40
|
[TgRectangle]: src/components/overlays/TgRectangle.vue
|
|
38
41
|
[TgPolygon]: src/components/overlays/TgPolygon.vue
|
|
39
42
|
[TgPolyline]: src/components/overlays/TgPolyline.vue
|
|
@@ -43,3 +46,4 @@
|
|
|
43
46
|
[Autocomplete]: src/map/map/extra/autocomplete.ts "自动完成"
|
|
44
47
|
[SearchBox]: src/map/map/extra/search-box.ts "搜索框"
|
|
45
48
|
[useTgMapInner]: src/components/map-hooks.ts
|
|
49
|
+
[LatLngBounds]: src/map/lat-lng.ts#L157
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LatLng } from '../../map/lat-lng';
|
|
2
|
+
import { MapPane } from '../../map/map/overlay/element-overlay';
|
|
2
3
|
import type { LabelEventMap, LabelOptions, LabelOverlay } from '../../map/map/overlay/label';
|
|
3
4
|
import type { Marker } from '../../map/map/overlay/marker';
|
|
4
5
|
import { type EventEmits } from '../../utils/vue-utils';
|
|
@@ -13,6 +14,9 @@ declare const TgLabel: import("vue").DefineComponent<{
|
|
|
13
14
|
zIndex: {
|
|
14
15
|
type: import("vue").PropType<number>;
|
|
15
16
|
};
|
|
17
|
+
mapPane: {
|
|
18
|
+
type: import("vue").PropType<import("../../utils/mapped-types").StringEnumValue<typeof MapPane>>;
|
|
19
|
+
};
|
|
16
20
|
}, {
|
|
17
21
|
attrs: import("vue").ComputedRef<{
|
|
18
22
|
binds: Record<string, unknown>;
|
|
@@ -37,6 +41,9 @@ declare const TgLabel: import("vue").DefineComponent<{
|
|
|
37
41
|
zIndex: {
|
|
38
42
|
type: import("vue").PropType<number>;
|
|
39
43
|
};
|
|
44
|
+
mapPane: {
|
|
45
|
+
type: import("vue").PropType<import("../../utils/mapped-types").StringEnumValue<typeof MapPane>>;
|
|
46
|
+
};
|
|
40
47
|
}>> & {
|
|
41
48
|
onClick?: ((event: import("../../map/event").Tg.Event) => any) | undefined;
|
|
42
49
|
}, {}, {}>;
|
|
@@ -61,6 +61,7 @@ declare const TgMarker: import("vue").DefineComponent<{
|
|
|
61
61
|
ref?: import("vue").VNodeRef | undefined;
|
|
62
62
|
ref_for?: boolean | undefined;
|
|
63
63
|
ref_key?: string | undefined;
|
|
64
|
+
readonly mapPane?: import("../../utils/mapped-types").StringEnumValue<typeof import("../../map/map/overlay/element-overlay").MapPane> | undefined;
|
|
64
65
|
onVnodeBeforeMount?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
65
66
|
[key: string]: any;
|
|
66
67
|
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
@@ -123,6 +124,9 @@ declare const TgMarker: import("vue").DefineComponent<{
|
|
|
123
124
|
zIndex: {
|
|
124
125
|
type: PropType<number>;
|
|
125
126
|
};
|
|
127
|
+
mapPane: {
|
|
128
|
+
type: PropType<import("../../utils/mapped-types").StringEnumValue<typeof import("../../map/map/overlay/element-overlay").MapPane>>;
|
|
129
|
+
};
|
|
126
130
|
}>> & {
|
|
127
131
|
onClick?: ((event: import("../../map/event").Tg.Event) => any) | undefined;
|
|
128
132
|
}, {
|
|
@@ -169,6 +173,9 @@ declare const TgMarker: import("vue").DefineComponent<{
|
|
|
169
173
|
zIndex: {
|
|
170
174
|
type: PropType<number>;
|
|
171
175
|
};
|
|
176
|
+
mapPane: {
|
|
177
|
+
type: PropType<import("../../utils/mapped-types").StringEnumValue<typeof import("../../map/map/overlay/element-overlay").MapPane>>;
|
|
178
|
+
};
|
|
172
179
|
}>> & {
|
|
173
180
|
onClick?: ((event: import("../../map/event").Tg.Event) => any) | undefined;
|
|
174
181
|
} & import("vue").ShallowUnwrapRef<{
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// <reference types="google.maps" />
|
|
3
3
|
/// <reference types="heremaps" />
|
|
4
4
|
import { type LngLatTuple } from 'coordtransform';
|
|
5
|
-
import { type StringEnumValue } from '../
|
|
5
|
+
import { type StringEnumValue } from '../utils/mapped-types';
|
|
6
6
|
export declare enum CoordType {
|
|
7
7
|
wgs84 = "wgs84",
|
|
8
8
|
gcj02 = "gcj02",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="google.maps" />
|
|
2
|
+
/// <reference types="baidumap-web-sdk" />
|
|
2
3
|
import { LatLng } from '../../lat-lng';
|
|
3
4
|
import { Point } from '../../types';
|
|
4
5
|
import type { AbstractMap } from '../map';
|
|
@@ -9,6 +10,10 @@ export declare enum MapPane {
|
|
|
9
10
|
overlayMouseTarget = "overlayMouseTarget",
|
|
10
11
|
float = "float"
|
|
11
12
|
}
|
|
13
|
+
export declare namespace MapPanes {
|
|
14
|
+
function toGoogle(mapPane: MapPane, panes: google.maps.MapPanes): Element;
|
|
15
|
+
function toBaidu(mapPane: MapPane, panes: BMap.MapPanes): HTMLElement | undefined;
|
|
16
|
+
}
|
|
12
17
|
export interface ElementOverlayOptions {
|
|
13
18
|
mapPane: MapPane;
|
|
14
19
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/// <reference types="google.maps" />
|
|
2
2
|
import { type Nullable } from '../../../components';
|
|
3
3
|
import type { Point } from '../../types';
|
|
4
|
+
import { MapPane } from './element-overlay';
|
|
4
5
|
export type GoogleLabel = InstanceType<ReturnType<typeof createGoogleLabelClass>>;
|
|
5
|
-
export declare function createGoogleLabel(element: HTMLElement, position: Nullable<google.maps.LatLng>, offset?: Point, zIndex?: number): {
|
|
6
|
+
export declare function createGoogleLabel(element: HTMLElement, position: Nullable<google.maps.LatLng>, offset?: Point, mapPane?: MapPane, zIndex?: number): {
|
|
6
7
|
container: HTMLElement;
|
|
7
8
|
position: Nullable<google.maps.LatLng>;
|
|
8
9
|
offset?: Point | undefined;
|
|
9
|
-
|
|
10
|
+
_mapPane: MapPane;
|
|
10
11
|
setZIndex(zIndex: number): void;
|
|
11
12
|
setElement(element: HTMLElement): void;
|
|
12
13
|
onAdd(): void;
|
|
@@ -33,11 +34,11 @@ export declare function createGoogleLabel(element: HTMLElement, position: Nullab
|
|
|
33
34
|
};
|
|
34
35
|
/** 打开页面时 google.maps.OverlayView 并没有加载, 故需要将GoogleLabel类写到方法中去 */
|
|
35
36
|
declare function createGoogleLabelClass(): {
|
|
36
|
-
new (element: HTMLElement, position: Nullable<google.maps.LatLng>, offset?: Point, zIndex?: number): {
|
|
37
|
+
new (element: HTMLElement, position: Nullable<google.maps.LatLng>, offset?: Point, _mapPane?: MapPane, zIndex?: number): {
|
|
37
38
|
container: HTMLElement;
|
|
38
39
|
position: Nullable<google.maps.LatLng>;
|
|
39
40
|
offset?: Point;
|
|
40
|
-
|
|
41
|
+
_mapPane: MapPane;
|
|
41
42
|
setZIndex(zIndex: number): void;
|
|
42
43
|
setElement(element: HTMLElement): void;
|
|
43
44
|
onAdd(): void;
|
|
@@ -4,6 +4,7 @@ import { CoordType, LatLng } from '../../lat-lng';
|
|
|
4
4
|
import { Point } from '../../types';
|
|
5
5
|
import type { BaiduMap } from '../baidu-map';
|
|
6
6
|
import type { GoogleMap } from '../google-map';
|
|
7
|
+
import { MapPane } from './element-overlay';
|
|
7
8
|
import { type GoogleLabel } from './google-label';
|
|
8
9
|
import type { BaiduSymbolIcon } from './icon';
|
|
9
10
|
import { BaiduOverlay, GoogleOverlay, Overlay } from './overlay';
|
|
@@ -27,6 +28,12 @@ export interface LabelOptions {
|
|
|
27
28
|
* - google: 依然有效, 但貌似是由于marker元素的opacity:0;的原因, 调整成比marker小的zIndex后, 依然不能位于marker后方...
|
|
28
29
|
* */
|
|
29
30
|
zIndex?: number;
|
|
31
|
+
/**
|
|
32
|
+
* ## 不同行为
|
|
33
|
+
* - baidu: 不支持该属性
|
|
34
|
+
* - google: 支持, 默认为{@link MapPane.overlayMouseTarget}
|
|
35
|
+
*/
|
|
36
|
+
mapPane?: MapPane;
|
|
30
37
|
}
|
|
31
38
|
/**
|
|
32
39
|
* ## 不同实现
|