tg-map-vue3 3.7.10 → 3.8.0
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 +6 -0
- package/dist/src/components/TgMap.vue.d.ts +5 -17
- package/dist/src/components/TgMapWidget.vue.d.ts +1 -1
- package/dist/src/components/controls/TgCustomControl.vue.d.ts +1 -1
- package/dist/src/components/controls/TgMapTypeControl.vue.d.ts +1 -1
- package/dist/src/components/controls/TgScaleControl.vue.d.ts +1 -1
- package/dist/src/components/controls/TgStreetViewControl.vue.d.ts +1 -1
- package/dist/src/components/controls/TgZoomControl.vue.d.ts +1 -1
- package/dist/src/components/extra/TgHeatmap.vue.d.ts +37 -0
- package/dist/src/components/extra/TgMarkerClusterer.vue.d.ts +1 -1
- package/dist/src/components/index.d.ts +2 -0
- package/dist/src/components/layers/TgTrafficLayer.vue.d.ts +1 -1
- package/dist/src/components/map-mixin.d.ts +1 -1
- package/dist/src/components/overlays/TgCircle.vue.d.ts +1 -1
- package/dist/src/components/overlays/TgElementOverlay.vue.d.ts +1 -1
- package/dist/src/components/overlays/TgInfoBox.vue.d.ts +1 -1
- package/dist/src/components/overlays/TgInfoWindow.vue.d.ts +1 -1
- package/dist/src/components/overlays/TgLabel.vue.d.ts +1 -1
- package/dist/src/components/overlays/TgMarker.vue.d.ts +59 -115
- package/dist/src/components/overlays/TgPolygon.vue.d.ts +1 -1
- package/dist/src/components/overlays/TgPolyline.vue.d.ts +1 -1
- package/dist/src/components/overlays/TgRectangle.vue.d.ts +1 -1
- package/dist/src/map/lat-lng.d.ts +4 -0
- package/dist/src/map/map/baidu-map.d.ts +2 -0
- package/dist/src/map/map/extra/heatmap.d.ts +72 -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/utils/vue-utils.d.ts +9 -2
- package/dist/tg-map.js +2024 -1484
- package/dist/tg-map.js.map +1 -1
- package/dist/tg-map.umd.cjs +8 -8
- package/dist/tg-map.umd.cjs.map +1 -1
- package/package.json +27 -27
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/// <reference types="google.maps" />
|
|
2
|
+
import BHeatMapOverlay from 'bmaplib.heatmap';
|
|
3
|
+
import type { LatLng, WeightedLatLng } from '../../lat-lng';
|
|
4
|
+
import type { BaiduMap } from '../baidu-map';
|
|
5
|
+
import type { GoogleMap } from '../google-map';
|
|
6
|
+
import type { AbstractMap } from '../map';
|
|
7
|
+
type BHeatMapOverlay = InstanceType<typeof BHeatMapOverlay>;
|
|
8
|
+
export interface HeatmapOptions {
|
|
9
|
+
data: HeatmapData;
|
|
10
|
+
/**
|
|
11
|
+
* 透明度
|
|
12
|
+
*
|
|
13
|
+
* ## 不同效果
|
|
14
|
+
* - google: 正常
|
|
15
|
+
* - baidu: 设置透明度后模糊效果有问题, 感觉是bug
|
|
16
|
+
*/
|
|
17
|
+
opacity?: number;
|
|
18
|
+
/**
|
|
19
|
+
* 半径
|
|
20
|
+
*
|
|
21
|
+
* ## 默认半径的区别
|
|
22
|
+
* - google: 默认半径是10
|
|
23
|
+
* - baidu: 默认半径是40
|
|
24
|
+
*
|
|
25
|
+
* 这里统一成默认半径{@link RADIUS_DEFAULT}
|
|
26
|
+
*/
|
|
27
|
+
radius?: number;
|
|
28
|
+
/**
|
|
29
|
+
* ## 不同实现
|
|
30
|
+
* - google: 接收颜色数组, 不能设置插值的位置
|
|
31
|
+
* - baidu: 接收`{.1: 'red', .9: 'green'}`形式的颜色对象, 可以指定插值的位置
|
|
32
|
+
*/
|
|
33
|
+
gradient?: Record<number, string>;
|
|
34
|
+
maxIntensity?: number;
|
|
35
|
+
}
|
|
36
|
+
export type HeatmapData = (LatLng | WeightedLatLng)[];
|
|
37
|
+
export declare abstract class Heatmap {
|
|
38
|
+
abstract inner: google.maps.visualization.HeatmapLayer | BHeatMapOverlay;
|
|
39
|
+
abstract map: AbstractMap;
|
|
40
|
+
/** 只更新data */
|
|
41
|
+
abstract setData(data: HeatmapData): void;
|
|
42
|
+
/** 一次性更新所有options */
|
|
43
|
+
abstract setOptions(options: HeatmapOptions): void;
|
|
44
|
+
/**
|
|
45
|
+
* 从地图上移除
|
|
46
|
+
* 创建之后会被立即添加到地图上, 故只有remove方法
|
|
47
|
+
* */
|
|
48
|
+
abstract remove(): void;
|
|
49
|
+
}
|
|
50
|
+
export declare class GoogleHeatmap extends Heatmap {
|
|
51
|
+
map: GoogleMap;
|
|
52
|
+
inner: google.maps.visualization.HeatmapLayer;
|
|
53
|
+
constructor(map: GoogleMap, options: HeatmapOptions);
|
|
54
|
+
setData(data: HeatmapData): void;
|
|
55
|
+
setOptions(options: HeatmapOptions): void;
|
|
56
|
+
remove(): void;
|
|
57
|
+
}
|
|
58
|
+
export declare class BaiduHeatmap extends Heatmap {
|
|
59
|
+
map: BaiduMap;
|
|
60
|
+
inner: BHeatMapOverlay;
|
|
61
|
+
/**
|
|
62
|
+
* 当前的最大值
|
|
63
|
+
* 直接读取/修改`inner.data.max`, 实现类似google那种, 可以直接设置最大值的效果
|
|
64
|
+
* */
|
|
65
|
+
private get innerDataMax();
|
|
66
|
+
private set innerDataMax(value);
|
|
67
|
+
constructor(map: BaiduMap, options: HeatmapOptions);
|
|
68
|
+
setData(data: HeatmapData): void;
|
|
69
|
+
setOptions(options: HeatmapOptions): void;
|
|
70
|
+
remove(): void;
|
|
71
|
+
}
|
|
72
|
+
export {};
|
|
@@ -7,6 +7,7 @@ import { GoogleScaleControl } from './controls/scale.control';
|
|
|
7
7
|
import { GoogleStreetViewControl } from './controls/street-view.control';
|
|
8
8
|
import { GoogleZoomControl } from './controls/zoom.control';
|
|
9
9
|
import { Autocomplete, type AutocompleteOptions } from './extra/autocomplete';
|
|
10
|
+
import { type Heatmap, type HeatmapOptions } from './extra/heatmap';
|
|
10
11
|
import { type MapUrls, type MapUrlsOptions } from './extra/map-urls';
|
|
11
12
|
import { GoogleMarkerClusterer, type MarkerClustererOptions } from './extra/marker-clusterer';
|
|
12
13
|
import { type PlacesService, type PlacesServiceOptions } from './extra/places-service';
|
|
@@ -73,6 +74,7 @@ export declare class GoogleMap extends AbstractMap {
|
|
|
73
74
|
createStreetViewControl: typeof GoogleStreetViewControl.create;
|
|
74
75
|
createScaleControl: typeof GoogleScaleControl.create;
|
|
75
76
|
createMarkerClusterer(options: MarkerClustererOptions): GoogleMarkerClusterer;
|
|
77
|
+
createHeatmap(options: HeatmapOptions): Heatmap;
|
|
76
78
|
createAutocomplete(options: AutocompleteOptions): Autocomplete;
|
|
77
79
|
createSearchBox(options: SearchBoxOptions): SearchBox;
|
|
78
80
|
createPlacesService(options: PlacesServiceOptions): PlacesService;
|
|
@@ -7,6 +7,7 @@ import type { ScaleControlOptions } from './controls/scale.control';
|
|
|
7
7
|
import type { StreetViewControl, StreetViewControlOptions } from './controls/street-view.control';
|
|
8
8
|
import type { ZoomControl, ZoomControlOptions } from './controls/zoom.control';
|
|
9
9
|
import type { Autocomplete, AutocompleteOptions } from './extra/autocomplete';
|
|
10
|
+
import type { Heatmap, HeatmapOptions } from './extra/heatmap';
|
|
10
11
|
import type { MapUrls, MapUrlsOptions } from './extra/map-urls';
|
|
11
12
|
import type { MarkerClusterer, MarkerClustererOptions } from './extra/marker-clusterer';
|
|
12
13
|
import type { PlacesService, PlacesServiceOptions } from './extra/places-service';
|
|
@@ -57,6 +58,7 @@ export declare class HereMap extends AbstractMap {
|
|
|
57
58
|
removeOverlay(overlay: Overlay<unknown>): void;
|
|
58
59
|
createMarker(options: MarkerOptions): MarkerOverlay;
|
|
59
60
|
createMarkerClusterer(options: MarkerClustererOptions): MarkerClusterer;
|
|
61
|
+
createHeatmap(options: HeatmapOptions): Heatmap;
|
|
60
62
|
createAutocomplete(options: AutocompleteOptions): Autocomplete;
|
|
61
63
|
createSearchBox(options: SearchBoxOptions): SearchBox;
|
|
62
64
|
createPlacesService(options: PlacesServiceOptions): PlacesService;
|
|
@@ -10,6 +10,7 @@ import type { ScaleControlOptions } from './controls/scale.control';
|
|
|
10
10
|
import type { StreetViewControl, StreetViewControlOptions } from './controls/street-view.control';
|
|
11
11
|
import type { ZoomControl, ZoomControlOptions } from './controls/zoom.control';
|
|
12
12
|
import type { Autocomplete, AutocompleteOptions } from './extra/autocomplete';
|
|
13
|
+
import type { Heatmap, HeatmapOptions } from './extra/heatmap';
|
|
13
14
|
import type { MapUrls, MapUrlsOptions } from './extra/map-urls';
|
|
14
15
|
import type { MarkerClusterer, MarkerClustererOptions } from './extra/marker-clusterer';
|
|
15
16
|
import type { PlacesService, PlacesServiceOptions } from './extra/places-service';
|
|
@@ -136,6 +137,7 @@ export declare abstract class AbstractMap implements CoordTypeSupplier, Tg.Event
|
|
|
136
137
|
abstract removeOverlay(overlay: Overlay): void;
|
|
137
138
|
abstract createMarker(options: MarkerOptions): MarkerOverlay;
|
|
138
139
|
abstract createMarkerClusterer(options: MarkerClustererOptions): MarkerClusterer;
|
|
140
|
+
abstract createHeatmap(options: HeatmapOptions): Heatmap;
|
|
139
141
|
abstract createAutocomplete(options: AutocompleteOptions): Autocomplete;
|
|
140
142
|
abstract createSearchBox(options: SearchBoxOptions): SearchBox;
|
|
141
143
|
abstract createPlacesService(options: PlacesServiceOptions): PlacesService;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Component, type ComponentOptions, type ComponentPublicInstance, type Prop, type PropType, type RendererElement, type RendererNode, type Slots, type VNode, type WritableComputedOptions } from 'vue';
|
|
1
|
+
import { type Component, type ComponentOptions, type ComponentPublicInstance, type ComputedRef, type Prop, type PropType, type Ref, type RendererElement, type RendererNode, type Slots, type VNode, type WritableComputedOptions } from 'vue';
|
|
2
2
|
import type { AbstractConstructor, KeysMatching, StringEnumLike, StringEnumValue, Thing } from './mapped-types';
|
|
3
3
|
/** 组件选项中的hook名 */
|
|
4
4
|
export type VueHookName = ExcludeSubtype<KeysMatching<OmitStartsWith<RemoveIndex<ComponentOptions>, '_'>, {
|
|
@@ -149,7 +149,7 @@ export declare function splitAttrs(attrs: Record<string, unknown>, props?: Recor
|
|
|
149
149
|
listenerProps: Record<string, unknown>;
|
|
150
150
|
};
|
|
151
151
|
/** 响应式的{@link splitAttrs} */
|
|
152
|
-
export declare function useSplittedAttrs(attrs: Record<string, unknown>, props?: Record<string, unknown>):
|
|
152
|
+
export declare function useSplittedAttrs(attrs: Record<string, unknown>, props?: Record<string, unknown>): ComputedRef<{
|
|
153
153
|
/** class/style/未声明的属性 等 */
|
|
154
154
|
binds: Record<string, unknown>;
|
|
155
155
|
/** 未声明的事件 */
|
|
@@ -180,4 +180,11 @@ export declare const useEventLogMethods: () => {
|
|
|
180
180
|
eventLog: (event: Thing | null | undefined) => void;
|
|
181
181
|
eventLogLess: (this: any, event: Thing | null | undefined) => void;
|
|
182
182
|
};
|
|
183
|
+
/**
|
|
184
|
+
* 值可能是Ref的对象
|
|
185
|
+
* 可以用来给{@link reactive}的参数做类型约束
|
|
186
|
+
* */
|
|
187
|
+
export type MaybeWrapRefs<T> = {
|
|
188
|
+
[P in keyof T]: Ref<T[P]> | T[P] | ComputedRef<T[P]>;
|
|
189
|
+
};
|
|
183
190
|
export {};
|