@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.
Files changed (54) hide show
  1. package/dist/components/Control/CustomControl.d.ts +45 -0
  2. package/dist/components/Control/RawControl.d.ts +40 -0
  3. package/dist/components/Control/index.d.ts +4 -1
  4. package/dist/components/Layer/BaiduLayer.d.ts +11 -0
  5. package/dist/components/Layer/DOMLayer.d.ts +154 -0
  6. package/dist/components/Layer/FeatureLayer.d.ts +129 -0
  7. package/dist/components/Layer/FillLayer.d.ts +359 -0
  8. package/dist/components/Layer/LineLayer.d.ts +440 -0
  9. package/dist/components/Layer/PanoramaCoverageLayer.d.ts +4 -0
  10. package/dist/components/Layer/PixelLayer.d.ts +11 -0
  11. package/dist/components/Layer/PointIconLayer.d.ts +263 -0
  12. package/dist/components/Layer/PointShapeLayer.d.ts +193 -0
  13. package/dist/components/Layer/ThreeLayer.d.ts +238 -0
  14. package/dist/components/Layer/TrafficLayer.d.ts +77 -0
  15. package/dist/components/Layer/index.d.ts +22 -7
  16. package/dist/components/Map/Map.d.ts +18 -0
  17. package/dist/components/Map/index.d.ts +1 -1
  18. package/dist/components/Menu/index.d.ts +54 -0
  19. package/dist/components/Overlay/CustomOverlay.d.ts +215 -0
  20. package/dist/components/Overlay/MapMask.d.ts +73 -0
  21. package/dist/components/Overlay/PlaceDetail.d.ts +59 -0
  22. package/dist/components/Overlay/PlaceDetailPanel.d.ts +74 -0
  23. package/dist/components/Overlay/RawOverlay.d.ts +40 -0
  24. package/dist/components/Overlay/SimpleInfoWindow.d.ts +162 -0
  25. package/dist/components/Overlay/index.d.ts +11 -0
  26. package/dist/components/Panorama/PanoramaRef.d.ts +75 -0
  27. package/dist/components/Panorama/index.d.ts +306 -0
  28. package/dist/composables/index.d.ts +32 -0
  29. package/dist/composables/renderHelpers.d.ts +12 -0
  30. package/dist/composables/useAutocomplete.d.ts +37 -0
  31. package/dist/composables/useBoundary.d.ts +14 -0
  32. package/dist/composables/useBusLineSearch.d.ts +35 -0
  33. package/dist/composables/useConvertor.d.ts +13 -0
  34. package/dist/composables/useDrivingRoute.d.ts +64 -0
  35. package/dist/composables/useGeolocation.d.ts +16 -0
  36. package/dist/composables/useLocalCity.d.ts +12 -0
  37. package/dist/composables/useLocalSearch.d.ts +92 -0
  38. package/dist/composables/useMapStatus.d.ts +12 -0
  39. package/dist/composables/usePanoramaService.d.ts +16 -0
  40. package/dist/composables/usePlaceDetail.d.ts +19 -0
  41. package/dist/composables/useRawControl.d.ts +3 -0
  42. package/dist/composables/useRawOverlay.d.ts +3 -0
  43. package/dist/composables/useRenderMap.d.ts +4 -0
  44. package/dist/composables/useRidingRoute.d.ts +7 -0
  45. package/dist/composables/useTransitRoute.d.ts +16 -0
  46. package/dist/composables/useTruckRoute.d.ts +7 -0
  47. package/dist/composables/useWalkingRoute.d.ts +7 -0
  48. package/dist/index.cjs +1 -2
  49. package/dist/index.d.ts +13 -9
  50. package/dist/index.js +5751 -2402
  51. package/package.json +7 -2
  52. package/dist/index.cjs.map +0 -1
  53. package/dist/index.js.map +0 -1
  54. package/dist/types-skd.d.ts +0 -21
@@ -0,0 +1,75 @@
1
+ import { Point } from '../../types';
2
+ import { PanoramaPOIType, PanoramaSceneType } from '../../constants';
3
+
4
+ /** 全景视角:heading 水平角(正北 0/正东 90…),pitch 垂直角(可选) */
5
+ export interface PanoramaPov {
6
+ heading: number;
7
+ pitch?: number;
8
+ }
9
+ /** 全景可配置项(对应 SDK PanoramaOptions) */
10
+ export interface PanoramaOptions {
11
+ /** 是否显示导航控件,默认 true */
12
+ navigationControl?: boolean;
13
+ /** 是否显示道路指示控件,默认 true */
14
+ linksControl?: boolean;
15
+ /** 是否显示室内场景切换控件(仅室内景生效),默认 true */
16
+ indoorSceneSwitchControl?: boolean;
17
+ /** 是否显示相册控件,默认 false */
18
+ albumsControl?: boolean;
19
+ /** 相册控件配置 */
20
+ albumsControlOptions?: unknown;
21
+ }
22
+ /** <Panorama> 命令式句柄 */
23
+ export interface PanoramaRef {
24
+ getPosition(): Point | null;
25
+ getPov(): PanoramaPov | null;
26
+ getZoom(): number | null;
27
+ getId(): string | null;
28
+ getLinks(): unknown[];
29
+ getVisible(): boolean;
30
+ getSceneType(): PanoramaSceneType | null;
31
+ setPosition(point: Point): void;
32
+ setId(id: string, options?: unknown): void;
33
+ setPov(pov: PanoramaPov, options?: unknown): void;
34
+ setZoom(zoom: number, options?: unknown): void;
35
+ setOptions(options: PanoramaOptions): void;
36
+ setPanoramaPOIType(poiType: PanoramaPOIType): void;
37
+ show(): void;
38
+ hide(): void;
39
+ enableScrollWheelZoom(): void;
40
+ disableScrollWheelZoom(): void;
41
+ capture(options?: {
42
+ quality?: number;
43
+ type?: string;
44
+ }): string | undefined;
45
+ clearOverlays(): void;
46
+ /** 原生全景实例逃生舱 */
47
+ raw: unknown;
48
+ }
49
+ export declare class PanoramaRefImpl implements PanoramaRef {
50
+ private pano;
51
+ constructor(pano: any);
52
+ get raw(): unknown;
53
+ getPosition(): Point | null;
54
+ getPov(): PanoramaPov | null;
55
+ getZoom(): number | null;
56
+ getId(): string | null;
57
+ getLinks(): unknown[];
58
+ getVisible(): boolean;
59
+ getSceneType(): PanoramaSceneType | null;
60
+ setPosition(point: Point): void;
61
+ setId(id: string, options?: unknown): void;
62
+ setPov(pov: PanoramaPov, options?: unknown): void;
63
+ setZoom(zoom: number, options?: unknown): void;
64
+ setOptions(options: PanoramaOptions): void;
65
+ setPanoramaPOIType(poiType: PanoramaPOIType): void;
66
+ show(): void;
67
+ hide(): void;
68
+ enableScrollWheelZoom(): void;
69
+ disableScrollWheelZoom(): void;
70
+ capture(options?: {
71
+ quality?: number;
72
+ type?: string;
73
+ }): string | undefined;
74
+ clearOverlays(): void;
75
+ }
@@ -0,0 +1,306 @@
1
+ import { PropType, StyleValue } from 'vue';
2
+ import { Point } from '../../types';
3
+ import { PanoramaPOIType } from '../../constants';
4
+ import { PanoramaPov, PanoramaOptions } from './PanoramaRef';
5
+
6
+ export type { PanoramaRef, PanoramaPov, PanoramaOptions } from './PanoramaRef';
7
+ export interface PanoramaProps {
8
+ point?: Point;
9
+ /** 通过全景 id 展示(与 point 二选一) */
10
+ id?: string;
11
+ /** 全景视角(heading 必填,pitch 可选) */
12
+ pov?: PanoramaPov;
13
+ /** 缩放级别 */
14
+ zoom?: number;
15
+ /** 全景配置:导航/道路/室内切换/相册控件 */
16
+ options?: PanoramaOptions;
17
+ /** 显隐控制:true→show(),false→hide() */
18
+ visible?: boolean;
19
+ /** 鼠标滚轮缩放开关 */
20
+ enableScrollWheelZoom?: boolean;
21
+ /** 外景场景点内可见的 POI 类型 */
22
+ poiType?: PanoramaPOIType;
23
+ style?: StyleValue;
24
+ className?: string;
25
+ /** 全景位置变化回调(position_changed) */
26
+ onPositionChange?: (point: Point) => void;
27
+ /** 视角变化回调(pov_changed) */
28
+ onPovChange?: () => void;
29
+ /** 相邻道路数据变化回调(links_changed) */
30
+ onLinksChange?: () => void;
31
+ /** 缩放级别变化回调(zoom_changed) */
32
+ onZoomChange?: (zoom: number) => void;
33
+ /** 单击全景画面(click) */
34
+ onClick?: (e: unknown) => void;
35
+ /** 双击全景画面(dblclick) */
36
+ onDblClick?: (e: unknown) => void;
37
+ /** 单击道路链接(link_click) */
38
+ onLinkClick?: (e: unknown) => void;
39
+ /** 全景 id 变化(id_changed) */
40
+ onIdChange?: (id: string) => void;
41
+ /** 场景类型变化(scene_type_changed) */
42
+ onSceneTypeChange?: () => void;
43
+ /** 全景数据加载失败(pano_error) */
44
+ onError?: (e: unknown) => void;
45
+ /** 全景数据加载完成(dataload) */
46
+ onDataLoad?: (e: unknown) => void;
47
+ }
48
+ export declare const Panorama: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
49
+ point: {
50
+ type: PropType<Point>;
51
+ default: any;
52
+ };
53
+ id: {
54
+ type: StringConstructor;
55
+ default: any;
56
+ };
57
+ pov: {
58
+ type: PropType<PanoramaPov>;
59
+ default: any;
60
+ };
61
+ zoom: {
62
+ type: NumberConstructor;
63
+ default: any;
64
+ };
65
+ options: {
66
+ type: PropType<PanoramaOptions>;
67
+ default: any;
68
+ };
69
+ visible: {
70
+ type: BooleanConstructor;
71
+ default: any;
72
+ };
73
+ enableScrollWheelZoom: {
74
+ type: BooleanConstructor;
75
+ default: any;
76
+ };
77
+ poiType: {
78
+ type: PropType<PanoramaPOIType>;
79
+ default: any;
80
+ };
81
+ style: {
82
+ default: any;
83
+ };
84
+ className: {
85
+ type: StringConstructor;
86
+ default: any;
87
+ };
88
+ onPositionChange: {
89
+ type: PropType<(point: Point) => void>;
90
+ default: any;
91
+ };
92
+ onPovChange: {
93
+ type: PropType<() => void>;
94
+ default: any;
95
+ };
96
+ onLinksChange: {
97
+ type: PropType<() => void>;
98
+ default: any;
99
+ };
100
+ onZoomChange: {
101
+ type: PropType<(zoom: number) => void>;
102
+ default: any;
103
+ };
104
+ onClick: {
105
+ type: PropType<(e: unknown) => void>;
106
+ default: any;
107
+ };
108
+ onDblClick: {
109
+ type: PropType<(e: unknown) => void>;
110
+ default: any;
111
+ };
112
+ onLinkClick: {
113
+ type: PropType<(e: unknown) => void>;
114
+ default: any;
115
+ };
116
+ onIdChange: {
117
+ type: PropType<(id: string) => void>;
118
+ default: any;
119
+ };
120
+ onSceneTypeChange: {
121
+ type: PropType<() => void>;
122
+ default: any;
123
+ };
124
+ onError: {
125
+ type: PropType<(e: unknown) => void>;
126
+ default: any;
127
+ };
128
+ onDataLoad: {
129
+ type: PropType<(e: unknown) => void>;
130
+ default: any;
131
+ };
132
+ }>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
133
+ [key: string]: any;
134
+ }>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
135
+ point: {
136
+ type: PropType<Point>;
137
+ default: any;
138
+ };
139
+ id: {
140
+ type: StringConstructor;
141
+ default: any;
142
+ };
143
+ pov: {
144
+ type: PropType<PanoramaPov>;
145
+ default: any;
146
+ };
147
+ zoom: {
148
+ type: NumberConstructor;
149
+ default: any;
150
+ };
151
+ options: {
152
+ type: PropType<PanoramaOptions>;
153
+ default: any;
154
+ };
155
+ visible: {
156
+ type: BooleanConstructor;
157
+ default: any;
158
+ };
159
+ enableScrollWheelZoom: {
160
+ type: BooleanConstructor;
161
+ default: any;
162
+ };
163
+ poiType: {
164
+ type: PropType<PanoramaPOIType>;
165
+ default: any;
166
+ };
167
+ style: {
168
+ default: any;
169
+ };
170
+ className: {
171
+ type: StringConstructor;
172
+ default: any;
173
+ };
174
+ onPositionChange: {
175
+ type: PropType<(point: Point) => void>;
176
+ default: any;
177
+ };
178
+ onPovChange: {
179
+ type: PropType<() => void>;
180
+ default: any;
181
+ };
182
+ onLinksChange: {
183
+ type: PropType<() => void>;
184
+ default: any;
185
+ };
186
+ onZoomChange: {
187
+ type: PropType<(zoom: number) => void>;
188
+ default: any;
189
+ };
190
+ onClick: {
191
+ type: PropType<(e: unknown) => void>;
192
+ default: any;
193
+ };
194
+ onDblClick: {
195
+ type: PropType<(e: unknown) => void>;
196
+ default: any;
197
+ };
198
+ onLinkClick: {
199
+ type: PropType<(e: unknown) => void>;
200
+ default: any;
201
+ };
202
+ onIdChange: {
203
+ type: PropType<(id: string) => void>;
204
+ default: any;
205
+ };
206
+ onSceneTypeChange: {
207
+ type: PropType<() => void>;
208
+ default: any;
209
+ };
210
+ onError: {
211
+ type: PropType<(e: unknown) => void>;
212
+ default: any;
213
+ };
214
+ onDataLoad: {
215
+ type: PropType<(e: unknown) => void>;
216
+ default: any;
217
+ };
218
+ }>> & Readonly<{}>, {
219
+ visible: boolean;
220
+ point: Point;
221
+ style: unknown;
222
+ zoom: number;
223
+ enableScrollWheelZoom: boolean;
224
+ onError: (e: unknown) => void;
225
+ id: string;
226
+ onClick: (e: unknown) => void;
227
+ onDblClick: (e: unknown) => void;
228
+ options: PanoramaOptions;
229
+ onZoomChange: (zoom: number) => void;
230
+ className: string;
231
+ pov: PanoramaPov;
232
+ poiType: PanoramaPOIType;
233
+ onPositionChange: (point: Point) => void;
234
+ onPovChange: () => void;
235
+ onLinksChange: () => void;
236
+ onLinkClick: (e: unknown) => void;
237
+ onIdChange: (id: string) => void;
238
+ onSceneTypeChange: () => void;
239
+ onDataLoad: (e: unknown) => void;
240
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
241
+ export interface PanoramaLabelProps {
242
+ position: Point;
243
+ altitude?: number;
244
+ content?: string;
245
+ /** 是否显示标签到当前全景场景点的距离,默认 true */
246
+ displayDistance?: boolean;
247
+ /** 自定义标签 css 样式 */
248
+ customStyle?: StyleValue;
249
+ /** 点击标注回调 */
250
+ onClick?: (e: unknown) => void;
251
+ }
252
+ export declare const PanoramaLabel: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
253
+ position: {
254
+ type: PropType<Point>;
255
+ required: true;
256
+ };
257
+ altitude: {
258
+ type: NumberConstructor;
259
+ default: any;
260
+ };
261
+ content: {
262
+ type: StringConstructor;
263
+ default: any;
264
+ };
265
+ displayDistance: {
266
+ type: BooleanConstructor;
267
+ default: any;
268
+ };
269
+ customStyle: {
270
+ default: any;
271
+ };
272
+ onClick: {
273
+ type: PropType<(e: unknown) => void>;
274
+ default: any;
275
+ };
276
+ }>, () => any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
277
+ position: {
278
+ type: PropType<Point>;
279
+ required: true;
280
+ };
281
+ altitude: {
282
+ type: NumberConstructor;
283
+ default: any;
284
+ };
285
+ content: {
286
+ type: StringConstructor;
287
+ default: any;
288
+ };
289
+ displayDistance: {
290
+ type: BooleanConstructor;
291
+ default: any;
292
+ };
293
+ customStyle: {
294
+ default: any;
295
+ };
296
+ onClick: {
297
+ type: PropType<(e: unknown) => void>;
298
+ default: any;
299
+ };
300
+ }>> & Readonly<{}>, {
301
+ altitude: number;
302
+ content: string;
303
+ displayDistance: boolean;
304
+ customStyle: unknown;
305
+ onClick: (e: unknown) => void;
306
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -10,3 +10,35 @@ export { useGeocoder } from './useGeocoder';
10
10
  export type { GeocoderHookResult } from './useGeocoder';
11
11
  export { useServiceTimeout, serviceTimeoutError, SERVICE_TIMEOUT_MS } from './useServiceTimeout';
12
12
  export type { ServiceTimeoutControl } from './useServiceTimeout';
13
+ export { useDrivingRoute } from './useDrivingRoute';
14
+ export type { DrivingRouteOptions, DrivingRouteHookResult, DrivingRouteRenderOptions } from './useDrivingRoute';
15
+ export { useWalkingRoute } from './useWalkingRoute';
16
+ export type { WalkingRouteOptions, WalkingRouteHookResult } from './useWalkingRoute';
17
+ export { useRidingRoute } from './useRidingRoute';
18
+ export type { RidingRouteOptions, RidingRouteHookResult } from './useRidingRoute';
19
+ export { useTransitRoute } from './useTransitRoute';
20
+ export type { TransitRouteOptions, TransitRouteHookResult } from './useTransitRoute';
21
+ export { useTruckRoute } from './useTruckRoute';
22
+ export type { TruckRouteOptions, TruckRouteHookResult } from './useTruckRoute';
23
+ export { useLocalSearch } from './useLocalSearch';
24
+ export type { LocalSearchOptions, LocalSearchHookResult, LocalSearchRenderOptions } from './useLocalSearch';
25
+ export { useAutocomplete } from './useAutocomplete';
26
+ export type { AutocompleteOptions, AutocompleteHookResult } from './useAutocomplete';
27
+ export { useBusLineSearch } from './useBusLineSearch';
28
+ export type { BusLineSearchOptions, BusLineSearchHookResult } from './useBusLineSearch';
29
+ export { usePlaceDetail } from './usePlaceDetail';
30
+ export type { PlaceDetailOptions, PlaceDetailHookResult } from './usePlaceDetail';
31
+ export { useBoundary } from './useBoundary';
32
+ export type { BoundaryHookResult } from './useBoundary';
33
+ export { useLocalCity } from './useLocalCity';
34
+ export type { LocalCityHookResult } from './useLocalCity';
35
+ export { useConvertor } from './useConvertor';
36
+ export type { ConvertorHookResult } from './useConvertor';
37
+ export { useGeolocation } from './useGeolocation';
38
+ export type { GeolocationHookResult } from './useGeolocation';
39
+ export { usePanoramaService } from './usePanoramaService';
40
+ export type { PanoramaServiceHookResult } from './usePanoramaService';
41
+ export { useMapStatus } from './useMapStatus';
42
+ export type { MapSnapshot } from './useMapStatus';
43
+ export { useRawControl } from './useRawControl';
44
+ export { useRawOverlay } from './useRawOverlay';
@@ -0,0 +1,12 @@
1
+ import { BMapDriver } from '../drivers/types';
2
+
3
+ /**
4
+ * 缺省 location 时的回退值:
5
+ * - 正常(会渲染):用 renderMap(Map 实例)——与原生 `new BMap.XxxSearch(map, ...)` 一致
6
+ * - dataOnly(autoRender:false,仅取数据):用地图中心点 Point,避免把 Map 交给 SDK 触发自动渲染
7
+ * renderMap 为空时返回空串(交给 SDK 用默认区域)。
8
+ */
9
+ export declare function fallbackLocation(driver: BMapDriver, renderMap: {
10
+ __brand: string;
11
+ raw: unknown;
12
+ } | null | undefined, dataOnly: boolean): unknown;
@@ -0,0 +1,37 @@
1
+ import { Ref } from 'vue';
2
+
3
+ export interface AutocompleteOptions {
4
+ location?: unknown;
5
+ types?: string[];
6
+ input?: string | HTMLElement;
7
+ /** renderOptions.map 非必传:`<Map>` 内部自动取当前地图,外层需显式传已就绪 handle;见 `useMap`/`useMapReady`。 */
8
+ renderOptions?: {
9
+ map?: unknown;
10
+ panel?: string | HTMLElement;
11
+ };
12
+ onSearchComplete?: (results: unknown) => void;
13
+ /** 用户选中某条建议项时触发(对应 SDK 构造项 onConfirm / 原生 onconfirm 事件) */
14
+ onConfirm?: (item: unknown) => void;
15
+ /** 高亮项变化时触发(current, previous)(对应 SDK 构造项 onHighlight / 原生 onhighlight 事件) */
16
+ onHighlight?: (current: unknown, previous?: unknown) => void;
17
+ }
18
+ export interface AutocompleteHookResult {
19
+ data: Ref<unknown>;
20
+ loading: Ref<boolean>;
21
+ error: Ref<Error | null>;
22
+ supported: Ref<boolean>;
23
+ search: (keywords: string) => void;
24
+ show: () => void;
25
+ hide: () => void;
26
+ getResults: () => unknown;
27
+ /** 设置绑定输入框的值 */
28
+ setInputValue: (value: string) => void;
29
+ /** 运行时设置返回结果类型限定 */
30
+ setTypes: (types: string[]) => void;
31
+ /** 运行时设置检索城市/区域 */
32
+ setLocation: (location: unknown) => void;
33
+ /** 最近一次的状态码 */
34
+ getStatus: () => number | undefined;
35
+ cancel: () => void;
36
+ }
37
+ export declare function useAutocomplete(opts?: AutocompleteOptions): AutocompleteHookResult;
@@ -0,0 +1,14 @@
1
+ import { Ref } from 'vue';
2
+ import { BoundaryResult } from '../types/results';
3
+
4
+ export interface BoundaryHookResult {
5
+ data: Ref<BoundaryResult | undefined>;
6
+ loading: Ref<boolean>;
7
+ error: Ref<Error | null>;
8
+ supported: Ref<boolean>;
9
+ get: (name: string) => void;
10
+ /** 把 SDK 返回的边界字符串("lng,lat;lng,lat;…")解析成点集,对应 SDK parsebdStr,2.0.4 新增 */
11
+ parsebdStr: (boundaryStr: string) => unknown;
12
+ cancel: () => void;
13
+ }
14
+ export declare function useBoundary(): BoundaryHookResult;
@@ -0,0 +1,35 @@
1
+ import { Ref } from 'vue';
2
+
3
+ export interface BusLineSearchOptions {
4
+ location?: unknown;
5
+ /** renderOptions.map 非必传:`<Map>` 内部自动取当前地图,外层需显式传已就绪 handle;见 `useMap`/`useMapReady`。 */
6
+ renderOptions?: {
7
+ map?: unknown;
8
+ panel?: string | HTMLElement;
9
+ autoViewport?: boolean;
10
+ };
11
+ /** 是否自动在地图上渲染线路(默认 true)。传 false=仅取数据:不注入地图、缺省 location 用中心点,避免自动画线路。 */
12
+ autoRender?: boolean;
13
+ onGetBusListComplete?: (results: unknown) => void;
14
+ onGetBusLineComplete?: (results: unknown) => void;
15
+ }
16
+ export interface BusLineSearchHookResult {
17
+ data: Ref<unknown>;
18
+ loading: Ref<boolean>;
19
+ error: Ref<Error | null>;
20
+ supported: Ref<boolean>;
21
+ getBusList: (keyword: string) => void;
22
+ getBusLine: (item: unknown) => void;
23
+ /** 只清 hook 的 data 状态;SDK 无原生 clear,地图上已渲染的线路不受影响 */
24
+ clearResults: () => void;
25
+ /** 开启检索后自动调整视野 */
26
+ enableAutoViewport: () => void;
27
+ /** 关闭自动调整视野 */
28
+ disableAutoViewport: () => void;
29
+ /** 运行时设置检索城市/区域 */
30
+ setLocation: (location: unknown) => void;
31
+ /** 最近一次检索的状态码(BMAP_STATUS_*) */
32
+ getStatus: () => number | undefined;
33
+ cancel: () => void;
34
+ }
35
+ export declare function useBusLineSearch(opts?: BusLineSearchOptions): BusLineSearchHookResult;
@@ -0,0 +1,13 @@
1
+ import { Ref } from 'vue';
2
+ import { Point } from '../types';
3
+ import { TranslateResults } from '../types/results';
4
+
5
+ export interface ConvertorHookResult {
6
+ data: Ref<TranslateResults | undefined>;
7
+ loading: Ref<boolean>;
8
+ error: Ref<Error | null>;
9
+ supported: Ref<boolean>;
10
+ translate: (points: Point[], from?: number, to?: number) => void;
11
+ cancel: () => void;
12
+ }
13
+ export declare function useConvertor(): ConvertorHookResult;
@@ -0,0 +1,64 @@
1
+ import { Ref } from 'vue';
2
+ import { Point, MapHandle } from '../types';
3
+ import { DrivingRouteResult } from '../types/results';
4
+
5
+ export interface DrivingRouteRenderOptions {
6
+ /**
7
+ * 在地图上渲染路线用的 MapHandle。**非必传**:
8
+ * - composable 用在 `<Map>` **内部**(子树里)时,不传会自动取当前地图;
9
+ * - composable 用在 `<Map>` **外层**时,context 取不到,需显式传**已就绪**的 handle(非 null)。
10
+ * 显式传入始终优先于自动获取。
11
+ */
12
+ map?: MapHandle;
13
+ panel?: string | HTMLElement;
14
+ selectFirstResult?: boolean;
15
+ autoViewport?: boolean;
16
+ viewportOptions?: {
17
+ noAnimation?: boolean;
18
+ margins?: number[];
19
+ zoomFactor?: number;
20
+ };
21
+ /** 拖拽起终点重新规划(仅驾车/公交/货车生效;步行、骑行 SDK 内部强制关闭)。 */
22
+ enableDragging?: boolean;
23
+ }
24
+ export interface DrivingRouteOptions {
25
+ /**
26
+ * 检索上下文(城市/坐标/地图)。**非必传**:缺省时自动回退到当前 `<Map>`(或 `renderOptions.map`)。
27
+ * 只在需要指定特定城市时才显式传。
28
+ */
29
+ location?: string | MapHandle;
30
+ policy?: number;
31
+ /** 是否同时返回多条备选路线(对应 SDK DrivingRoute 构造项 alternatives)。仅驾车支持。 */
32
+ alternatives?: boolean;
33
+ /**
34
+ * 是否自动在地图上渲染路线(默认 true)。传 `false`=**仅取数据**:不注入 renderOptions.map,
35
+ * 缺省 location 时用地图中心点(而非 Map 实例)作检索上下文。
36
+ */
37
+ autoRender?: boolean;
38
+ renderOptions?: DrivingRouteRenderOptions;
39
+ onSearchComplete?: (results: DrivingRouteResult) => void;
40
+ onMarkersSet?: (pois: unknown[]) => void;
41
+ onInfoHtmlSet?: (poi: unknown, html: HTMLElement) => void;
42
+ onPolylinesSet?: (polylines: unknown[]) => void;
43
+ onResultsHtmlSet?: (container: HTMLElement) => void;
44
+ }
45
+ export interface DrivingRouteHookResult {
46
+ data: Ref<DrivingRouteResult | undefined>;
47
+ loading: Ref<boolean>;
48
+ error: Ref<Error | null>;
49
+ supported: Ref<boolean>;
50
+ /** 搜索(start/end 必须是 Point,不支持字符串地址) */
51
+ search: (start: Point, end: Point, options?: {
52
+ waypoints?: Point[];
53
+ }) => void;
54
+ clearResults: () => void;
55
+ enableAutoViewport: () => void;
56
+ disableAutoViewport: () => void;
57
+ setPolicy: (policy: number) => void;
58
+ setLocation: (location: string | MapHandle) => void;
59
+ /** 运行时设置路线折线样式(strokeColor / strokeWeight / strokeOpacity 等) */
60
+ setPolylineStyle: (style: Record<string, unknown>) => void;
61
+ getStatus: () => number | undefined;
62
+ cancel: () => void;
63
+ }
64
+ export declare function useDrivingRoute(opts?: DrivingRouteOptions): DrivingRouteHookResult;
@@ -0,0 +1,16 @@
1
+ import { Ref } from 'vue';
2
+
3
+ export interface GeolocationHookResult {
4
+ data: Ref<unknown>;
5
+ loading: Ref<boolean>;
6
+ error: Ref<Error | null>;
7
+ supported: Ref<boolean>;
8
+ getCurrentPosition: (options?: unknown) => void;
9
+ getStatus: () => number | undefined;
10
+ enableSDKLocation: () => void;
11
+ disableSDKLocation: () => void;
12
+ cancel: () => void;
13
+ }
14
+ export declare function useGeolocation(opts?: {
15
+ enableSDKLocation?: boolean;
16
+ }): GeolocationHookResult;
@@ -0,0 +1,12 @@
1
+ import { Ref } from 'vue';
2
+ import { LocalCityResult } from '../types/results';
3
+
4
+ export interface LocalCityHookResult {
5
+ data: Ref<LocalCityResult | undefined>;
6
+ loading: Ref<boolean>;
7
+ error: Ref<Error | null>;
8
+ supported: Ref<boolean>;
9
+ get: () => void;
10
+ cancel: () => void;
11
+ }
12
+ export declare function useLocalCity(): LocalCityHookResult;