@baidumap/vue-bmap 1.0.0 → 1.0.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/dist/components/Control/CustomControl.d.ts +45 -0
- package/dist/components/Control/RawControl.d.ts +40 -0
- package/dist/components/Control/index.d.ts +4 -1
- package/dist/components/Layer/BaiduLayer.d.ts +11 -0
- package/dist/components/Layer/DOMLayer.d.ts +154 -0
- package/dist/components/Layer/FeatureLayer.d.ts +129 -0
- package/dist/components/Layer/FillLayer.d.ts +359 -0
- package/dist/components/Layer/LineLayer.d.ts +440 -0
- package/dist/components/Layer/PanoramaCoverageLayer.d.ts +4 -0
- package/dist/components/Layer/PixelLayer.d.ts +11 -0
- package/dist/components/Layer/PointIconLayer.d.ts +263 -0
- package/dist/components/Layer/PointShapeLayer.d.ts +193 -0
- package/dist/components/Layer/ThreeLayer.d.ts +238 -0
- package/dist/components/Layer/TrafficLayer.d.ts +77 -0
- package/dist/components/Layer/index.d.ts +22 -7
- package/dist/components/Map/Map.d.ts +18 -0
- package/dist/components/Map/index.d.ts +1 -1
- package/dist/components/Menu/index.d.ts +54 -0
- package/dist/components/Overlay/CustomOverlay.d.ts +215 -0
- package/dist/components/Overlay/MapMask.d.ts +73 -0
- package/dist/components/Overlay/PlaceDetail.d.ts +59 -0
- package/dist/components/Overlay/PlaceDetailPanel.d.ts +74 -0
- package/dist/components/Overlay/RawOverlay.d.ts +40 -0
- package/dist/components/Overlay/SimpleInfoWindow.d.ts +162 -0
- package/dist/components/Overlay/index.d.ts +11 -0
- package/dist/components/Panorama/PanoramaRef.d.ts +75 -0
- package/dist/components/Panorama/index.d.ts +306 -0
- package/dist/composables/index.d.ts +32 -0
- package/dist/composables/renderHelpers.d.ts +12 -0
- package/dist/composables/useAutocomplete.d.ts +37 -0
- package/dist/composables/useBoundary.d.ts +14 -0
- package/dist/composables/useBusLineSearch.d.ts +35 -0
- package/dist/composables/useConvertor.d.ts +13 -0
- package/dist/composables/useDrivingRoute.d.ts +64 -0
- package/dist/composables/useGeolocation.d.ts +16 -0
- package/dist/composables/useLocalCity.d.ts +12 -0
- package/dist/composables/useLocalSearch.d.ts +92 -0
- package/dist/composables/useMapStatus.d.ts +12 -0
- package/dist/composables/usePanoramaService.d.ts +16 -0
- package/dist/composables/usePlaceDetail.d.ts +19 -0
- package/dist/composables/useRawControl.d.ts +3 -0
- package/dist/composables/useRawOverlay.d.ts +3 -0
- package/dist/composables/useRenderMap.d.ts +4 -0
- package/dist/composables/useRidingRoute.d.ts +7 -0
- package/dist/composables/useTransitRoute.d.ts +16 -0
- package/dist/composables/useTruckRoute.d.ts +7 -0
- package/dist/composables/useWalkingRoute.d.ts +7 -0
- package/dist/index.cjs +1 -2
- package/dist/index.d.ts +13 -9
- package/dist/index.js +5751 -2402
- package/package.json +7 -2
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/types-skd.d.ts +0 -21
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { Point, Bounds } from '../types';
|
|
3
|
+
|
|
4
|
+
export interface LocalSearchRenderOptions {
|
|
5
|
+
/**
|
|
6
|
+
* 在地图上渲染结果用的 MapHandle。**非必传**:composable 在 `<Map>` 内部会自动取当前地图;
|
|
7
|
+
* 在 `<Map>` 外层则需显式传**已就绪**的 handle(用 `useMap`/`useMapReady` 拿)。显式传入优先。
|
|
8
|
+
*/
|
|
9
|
+
map?: {
|
|
10
|
+
__brand: string;
|
|
11
|
+
raw: unknown;
|
|
12
|
+
};
|
|
13
|
+
panel?: string | HTMLElement;
|
|
14
|
+
selectFirstResult?: boolean;
|
|
15
|
+
autoViewport?: boolean;
|
|
16
|
+
viewportOptions?: {
|
|
17
|
+
noAnimation?: boolean;
|
|
18
|
+
margins?: number[];
|
|
19
|
+
zoomFactor?: number;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface LocalSearchOptions {
|
|
23
|
+
/** 搜索城市/区域,可为字符串、Point 或 Map。**非必传**:缺省时自动回退到当前 `<Map>`(或 `renderOptions.map`),与原生 `new BMap.LocalSearch(map, {...})` 一致 */
|
|
24
|
+
location?: string | Point | {
|
|
25
|
+
__brand: string;
|
|
26
|
+
raw: unknown;
|
|
27
|
+
};
|
|
28
|
+
/** 每页结果数(1-100) */
|
|
29
|
+
pageCapacity?: number;
|
|
30
|
+
/** 页码(v4+) */
|
|
31
|
+
pageNum?: number;
|
|
32
|
+
/**
|
|
33
|
+
* 是否自动在地图上渲染检索结果(默认 true,与原生一致)。
|
|
34
|
+
* 传 `false`=**仅取数据**:不把地图注入 renderOptions.map,且缺省 location 时用地图中心点(而非 Map 实例)
|
|
35
|
+
* 作检索区域——避免 SDK 因拿到 Map 引用而自动画默认标注。适合"取数据后自绘标注"(如门店选址)。
|
|
36
|
+
*/
|
|
37
|
+
autoRender?: boolean;
|
|
38
|
+
/** 渲染选项 */
|
|
39
|
+
renderOptions?: LocalSearchRenderOptions;
|
|
40
|
+
/** 搜索完成回调 */
|
|
41
|
+
onSearchComplete?: (results: unknown) => void;
|
|
42
|
+
/** 标注设置回调 */
|
|
43
|
+
onMarkersSet?: (pois: unknown[]) => void;
|
|
44
|
+
/** 信息窗回调 */
|
|
45
|
+
onInfoHtmlSet?: (poi: unknown, html: HTMLElement) => void;
|
|
46
|
+
/** 结果面板回调 */
|
|
47
|
+
onResultsHtmlSet?: (container: HTMLElement) => void;
|
|
48
|
+
/** 折线添加完成回调(对应 setPolylinesSetCallback) */
|
|
49
|
+
onPolylinesSet?: (polylines: unknown[]) => void;
|
|
50
|
+
}
|
|
51
|
+
export interface LocalSearchHookResult<T = unknown> {
|
|
52
|
+
data: Ref<T | undefined>;
|
|
53
|
+
loading: Ref<boolean>;
|
|
54
|
+
error: Ref<Error | null>;
|
|
55
|
+
supported: Ref<boolean>;
|
|
56
|
+
/** 搜索(支持多关键词数组) */
|
|
57
|
+
search: (keyword: string | string[], option?: {
|
|
58
|
+
forceLocal?: boolean;
|
|
59
|
+
}) => void;
|
|
60
|
+
/** 周边搜索 */
|
|
61
|
+
searchNearby: (keyword: string | string[], center: string | Point, radius: number) => void;
|
|
62
|
+
/** 范围搜索 */
|
|
63
|
+
searchInBounds: (keyword: string | string[], bounds: Bounds) => void;
|
|
64
|
+
/** 翻页 */
|
|
65
|
+
gotoPage: (page: number) => void;
|
|
66
|
+
/** 清空结果 */
|
|
67
|
+
clearResults: () => void;
|
|
68
|
+
/** 选中/高亮某条结果并打开其信息窗;index 为结果索引 */
|
|
69
|
+
select: (index: number) => void;
|
|
70
|
+
/** 取消选中:关掉信息窗 + 清结果列表选中态 */
|
|
71
|
+
clearSelected: () => void;
|
|
72
|
+
/** 运行时设置检索城市/区域(字符串 / Point / Map) */
|
|
73
|
+
setLocation: (location: string | Point | {
|
|
74
|
+
__brand: string;
|
|
75
|
+
raw: unknown;
|
|
76
|
+
}) => void;
|
|
77
|
+
/** 开启检索后自动调整视野 */
|
|
78
|
+
enableAutoViewport: () => void;
|
|
79
|
+
/** 关闭自动调整视野 */
|
|
80
|
+
disableAutoViewport: () => void;
|
|
81
|
+
/** 开启「自动选中第一个结果」 */
|
|
82
|
+
enableFirstResultSelection: () => void;
|
|
83
|
+
/** 关闭「自动选中第一个结果」 */
|
|
84
|
+
disableFirstResultSelection: () => void;
|
|
85
|
+
/** 运行时设置每页结果数(1-100) */
|
|
86
|
+
setPageCapacity: (n: number) => void;
|
|
87
|
+
/** 最近一次检索的状态码(BMAP_STATUS_*) */
|
|
88
|
+
getStatus: () => number | undefined;
|
|
89
|
+
/** 取消当前请求 */
|
|
90
|
+
cancel: () => void;
|
|
91
|
+
}
|
|
92
|
+
export declare function useLocalSearch<T = unknown>(opts?: LocalSearchOptions): LocalSearchHookResult<T>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ShallowRef } from 'vue';
|
|
2
|
+
import { Bounds, Point, Size } from '../types';
|
|
3
|
+
|
|
4
|
+
export interface MapSnapshot {
|
|
5
|
+
center: Point | null;
|
|
6
|
+
zoom: number | null;
|
|
7
|
+
bounds: Bounds | null;
|
|
8
|
+
size: Size | null;
|
|
9
|
+
heading: number | null;
|
|
10
|
+
tilt: number | null;
|
|
11
|
+
}
|
|
12
|
+
export declare function useMapStatus(): Readonly<ShallowRef<MapSnapshot | null>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { Point } from '../types';
|
|
3
|
+
|
|
4
|
+
export interface PanoramaServiceHookResult {
|
|
5
|
+
data: Ref<unknown>;
|
|
6
|
+
loading: Ref<boolean>;
|
|
7
|
+
error: Ref<Error | null>;
|
|
8
|
+
supported: Ref<boolean>;
|
|
9
|
+
getPanoramaById: (id: string) => void;
|
|
10
|
+
/** radius 可选,缺省走 SDK 默认(约 50 米) */
|
|
11
|
+
getPanoramaByLocation: (point: Point, radius?: number) => void;
|
|
12
|
+
/** 按 POI id 查询全景(部分版本 SDK 支持;运行时不支持时置 error) */
|
|
13
|
+
getPanoramaByPOIId: (poiId: string) => void;
|
|
14
|
+
cancel: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function usePanoramaService(): PanoramaServiceHookResult;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
|
|
3
|
+
export interface PlaceDetailOptions {
|
|
4
|
+
container?: HTMLElement;
|
|
5
|
+
compact?: boolean;
|
|
6
|
+
renderOptions?: unknown;
|
|
7
|
+
/** 必须传**已就绪**的 MapHandle(非 null);见 `useMap`/`useMapReady` 时序说明。 */
|
|
8
|
+
map?: unknown;
|
|
9
|
+
}
|
|
10
|
+
export interface PlaceDetailHookResult {
|
|
11
|
+
data: Ref<unknown>;
|
|
12
|
+
loading: Ref<boolean>;
|
|
13
|
+
error: Ref<Error | null>;
|
|
14
|
+
supported: Ref<boolean>;
|
|
15
|
+
render: (uid: string) => void;
|
|
16
|
+
rerender: () => void;
|
|
17
|
+
dispose: () => void;
|
|
18
|
+
}
|
|
19
|
+
export declare function usePlaceDetail(opts?: PlaceDetailOptions): PlaceDetailHookResult;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DrivingRouteOptions, DrivingRouteHookResult } from './useDrivingRoute';
|
|
2
|
+
|
|
3
|
+
export type RidingRouteOptions = Omit<DrivingRouteOptions, 'policy' | 'alternatives'>;
|
|
4
|
+
export type RidingRouteHookResult = Omit<DrivingRouteHookResult, 'setPolicy'> & {
|
|
5
|
+
setPolicy?: never;
|
|
6
|
+
};
|
|
7
|
+
export declare function useRidingRoute(opts?: RidingRouteOptions): RidingRouteHookResult;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DrivingRouteOptions, DrivingRouteHookResult } from './useDrivingRoute';
|
|
2
|
+
|
|
3
|
+
export type TransitRouteOptions = Omit<DrivingRouteOptions, 'alternatives'> & {
|
|
4
|
+
/** 跨城公交换乘策略(BMAP_INTERCITY_POLICY_*) */
|
|
5
|
+
intercityPolicy?: number;
|
|
6
|
+
/** 跨城公交交通方式(BMAP_TRANSIT_TYPE_POLICY_*:火车/飞机/大巴) */
|
|
7
|
+
transitTypePolicy?: number;
|
|
8
|
+
};
|
|
9
|
+
export type TransitRouteHookResult = DrivingRouteHookResult & {
|
|
10
|
+
setPageCapacity: (n: number) => void;
|
|
11
|
+
/** 设置跨城换乘策略 */
|
|
12
|
+
setIntercityPolicy: (policy: number) => void;
|
|
13
|
+
/** 设置跨城交通方式(火车/飞机/大巴) */
|
|
14
|
+
setTransitTypePolicy: (policy: number) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare function useTransitRoute(opts?: TransitRouteOptions): TransitRouteHookResult;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DrivingRouteOptions, DrivingRouteHookResult } from './useDrivingRoute';
|
|
2
|
+
|
|
3
|
+
export type TruckRouteOptions = Omit<DrivingRouteOptions, 'alternatives'>;
|
|
4
|
+
export type TruckRouteHookResult = DrivingRouteHookResult & {
|
|
5
|
+
setPageCapacity: (n: number) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare function useTruckRoute(opts?: TruckRouteOptions): TruckRouteHookResult;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DrivingRouteOptions, DrivingRouteHookResult } from './useDrivingRoute';
|
|
2
|
+
|
|
3
|
+
export type WalkingRouteOptions = Omit<DrivingRouteOptions, 'policy' | 'alternatives'>;
|
|
4
|
+
export type WalkingRouteHookResult = Omit<DrivingRouteHookResult, 'setPolicy'> & {
|
|
5
|
+
setPolicy?: never;
|
|
6
|
+
};
|
|
7
|
+
export declare function useWalkingRoute(opts?: WalkingRouteOptions): WalkingRouteHookResult;
|