@heycar/heycars-map 0.7.3 → 0.7.4-zone1
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 +306 -60
- package/dist/api/contants.d.ts +2 -0
- package/dist/business-components/GreenZone/GreenZone.d.ts +8 -0
- package/dist/business-components/GreenZone/index.d.ts +1 -0
- package/dist/hooks/useMapRecomendPlace.d.ts +18 -9
- package/dist/hooks-business/useBusinessRecomendPlaceMap.d.ts +7 -1
- package/dist/index.cjs +275 -46
- package/dist/index.js +275 -46
- package/dist/types/interface.d.ts +9 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,8 +16,38 @@ npm install @heycar/heycars-map --save
|
|
|
16
16
|
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
+
### 加载地图样式
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import "@heycar/heycars-map/dist/style.css";
|
|
23
|
+
```
|
|
24
|
+
|
|
19
25
|
### 使用
|
|
20
26
|
|
|
27
|
+
常用数据结构
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
export type Point = [number, number];
|
|
31
|
+
|
|
32
|
+
export type Place = {
|
|
33
|
+
lng: number;
|
|
34
|
+
lat: number;
|
|
35
|
+
name: string;
|
|
36
|
+
displayName: string;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export interface Zone {
|
|
40
|
+
name: string;
|
|
41
|
+
path: Point[];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface RecommendZonePlaces {
|
|
45
|
+
available?: boolean;
|
|
46
|
+
zone?: Zone;
|
|
47
|
+
places?: Place[];
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
21
51
|
#### 在 入口文件添加 `MapProvider`
|
|
22
52
|
|
|
23
53
|
- 对于 jsx/tsx 文件的例子
|
|
@@ -53,42 +83,261 @@ npm install @heycar/heycars-map --save
|
|
|
53
83
|
</MapProvider>
|
|
54
84
|
```
|
|
55
85
|
|
|
56
|
-
####
|
|
86
|
+
#### 在地图里可以使用的组件
|
|
87
|
+
|
|
88
|
+
为了方便集成,已经将常用业务逻辑集成在四个业务组件里面,下面是推荐使用的业务组件
|
|
57
89
|
|
|
58
|
-
-
|
|
90
|
+
- `BusinessRecomendPlaceMap`
|
|
91
|
+
- `BusinessQuotingMap`
|
|
92
|
+
- `BusinessTaxiServiceMap`
|
|
93
|
+
- `BusinessTaxiEndMap`
|
|
94
|
+
|
|
95
|
+
下面三个是推荐搭配使用的业务 hooks
|
|
96
|
+
|
|
97
|
+
- `useBusinessRecomendPlaceMap`
|
|
98
|
+
- `useBusinessQuotingMap`
|
|
99
|
+
- `useBusinessTaxiServiceMap`
|
|
100
|
+
|
|
101
|
+
#### 选择上车点和推荐点的地图组件 `BusinessRecomendPlaceMap`
|
|
102
|
+
|
|
103
|
+
对于 jsx/tsx 文件的例子
|
|
59
104
|
|
|
60
105
|
```jsx
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
106
|
+
import { defineComponent } from "vue";
|
|
107
|
+
import { BusinessRecomendPlaceMap, useBusinessRecomendPlaceMap } from "@heycar/heycars-map";
|
|
108
|
+
|
|
109
|
+
export default defineComponent({
|
|
110
|
+
setup() {
|
|
111
|
+
const {
|
|
112
|
+
centerPlace,
|
|
113
|
+
mapContext,
|
|
114
|
+
setCenterPlaceByUserSpecified,
|
|
115
|
+
setCenterPlaceByUserSpecifiedInZone,
|
|
116
|
+
} = useBusinessRecomendPlaceMap();
|
|
117
|
+
// 演示 setCenterPlaceByUserSpecifiedInZone 的用法
|
|
118
|
+
const demoForUsage = () => {
|
|
119
|
+
setCenterPlaceByUserSpecifiedInZone({
|
|
120
|
+
// 期望的地图中心点
|
|
121
|
+
place: {
|
|
122
|
+
lng: 139.56,
|
|
123
|
+
lat: 35.56,
|
|
124
|
+
name: "user specified place in zone",
|
|
125
|
+
displayName: "user specified place in zone",
|
|
126
|
+
},
|
|
127
|
+
// 推荐点和绿区信息
|
|
128
|
+
recommends: {
|
|
129
|
+
// 绿区
|
|
130
|
+
zone: {
|
|
131
|
+
name: "zone 1",
|
|
132
|
+
path: [
|
|
133
|
+
[139.569, 35.555],
|
|
134
|
+
[139.558, 35.55],
|
|
135
|
+
[139.56, 35.565],
|
|
136
|
+
],
|
|
137
|
+
},
|
|
138
|
+
// 绿区内的推荐点列表
|
|
139
|
+
places: [
|
|
140
|
+
{
|
|
141
|
+
lng: 139.56,
|
|
142
|
+
lat: 35.56,
|
|
143
|
+
name: "user specified place in zone",
|
|
144
|
+
displayName: "user specified place in zone",
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
lng: 139.562,
|
|
148
|
+
lat: 35.562,
|
|
149
|
+
name: "recommend place 2",
|
|
150
|
+
displayName: "recommend place 2",
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
return () => (
|
|
157
|
+
<BusinessRecomendPlaceMap
|
|
158
|
+
class={"demo"}
|
|
159
|
+
geoLoadingTitle={"正在获取您当前的位置"}
|
|
160
|
+
unavailableTitle={"当前区域暂未开通服务"}
|
|
161
|
+
recomendDescription={"您将在此处上车"}
|
|
162
|
+
geoDefaultPosition={[139.777777, 35.777777]}
|
|
163
|
+
mapContext={mapContext}
|
|
164
|
+
getRecomendPlace={async ({ lng, lat }) => {
|
|
165
|
+
// 向后端获取推荐点信息
|
|
166
|
+
return {
|
|
167
|
+
// 服务是否可用
|
|
168
|
+
available: true,
|
|
169
|
+
// 绿区
|
|
170
|
+
zone: {
|
|
171
|
+
name: "绿区名称",
|
|
172
|
+
path: [
|
|
173
|
+
[lng - 0.001, lat + 0.001],
|
|
174
|
+
[lng, lat - 0.001],
|
|
175
|
+
[lng + 0.001, lat + 0.0005],
|
|
176
|
+
],
|
|
177
|
+
},
|
|
178
|
+
// 推荐点列表
|
|
179
|
+
places: [
|
|
180
|
+
{ lat: lat - 0.00001, lng: lng + 0.0001, name: "place 1", displayName: "place 1" },
|
|
181
|
+
{ lat: lat - 0.0002, lng: lng + 0.0002, name: "place 2", displayName: "place 2" },
|
|
182
|
+
{ lat: lat - 0.0002, lng: lng - 0.0001, name: "place 3", displayName: "place 3" },
|
|
183
|
+
],
|
|
184
|
+
};
|
|
185
|
+
}}
|
|
186
|
+
getDefaultCenterPlace={async () => {
|
|
187
|
+
// 获取最后一次上车点
|
|
188
|
+
return {
|
|
189
|
+
lng: 139,
|
|
190
|
+
lat: 35,
|
|
191
|
+
name: "user last pickup place",
|
|
192
|
+
displayName: "user last pickup place",
|
|
193
|
+
};
|
|
194
|
+
}}
|
|
195
|
+
onChangeRecomandPlace={({ place, inputPlace, isInZone }) => {
|
|
196
|
+
console.log("用户操作地图,计算推荐点后得出的最终位置时触发,此时可以向后端查询城市信息");
|
|
197
|
+
console.log(
|
|
198
|
+
"计算推荐点之前的地址是: ",
|
|
199
|
+
inputPlace,
|
|
200
|
+
" 最终的地址是: ",
|
|
201
|
+
place,
|
|
202
|
+
" 是否在绿区内: ",
|
|
203
|
+
isInZone
|
|
204
|
+
);
|
|
205
|
+
}}
|
|
206
|
+
onClickLocator={() =>
|
|
207
|
+
console.log("用户点击了蓝色光标触发,此时可以执行用户点击起点输入框相同的逻辑")
|
|
208
|
+
}
|
|
209
|
+
onGeoError={() => {
|
|
210
|
+
console.log("获取GPS失败时触发,此时可以弹框告诉用户");
|
|
211
|
+
}}
|
|
212
|
+
/>
|
|
213
|
+
);
|
|
214
|
+
},
|
|
215
|
+
});
|
|
74
216
|
```
|
|
75
217
|
|
|
76
|
-
|
|
218
|
+
#### 询价业务的地图组件 `BusinessQuotingMap`
|
|
77
219
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
220
|
+
对于 jsx/tsx 文件的例子
|
|
221
|
+
|
|
222
|
+
```jsx
|
|
223
|
+
import { defineComponent } from "vue";
|
|
224
|
+
import { BusinessQuotingMap, useBusinessQuotingMap } from "@heycar/heycars-map";
|
|
225
|
+
|
|
226
|
+
export default defineComponent({
|
|
227
|
+
setup() {
|
|
228
|
+
const { setMap, registerFitVeiw } = useBusinessQuotingMap();
|
|
229
|
+
return () => (
|
|
230
|
+
<BusinessQuotingMap
|
|
231
|
+
class={"demo"}
|
|
232
|
+
from={{
|
|
233
|
+
displayName: "ARTS LINK零创国际艺术教育长宁区创业园区",
|
|
234
|
+
name: "上海市长宁区华阳路街道ARTS LINK零创国际艺术教育长宁区创业园区",
|
|
235
|
+
lat: 1.311295,
|
|
236
|
+
lng: 103.841974,
|
|
237
|
+
}}
|
|
238
|
+
to={{
|
|
239
|
+
displayName: "ARTS LINK零创国际艺术教育长宁区创业园区",
|
|
240
|
+
name: "上海市长宁区华阳路街道ARTS LINK零创国际艺术教育长宁区创业园区",
|
|
241
|
+
lat: 1.2966426,
|
|
242
|
+
lng: 103.7763939,
|
|
243
|
+
}}
|
|
244
|
+
fromDescription={"您将在此上车"}
|
|
245
|
+
renderDescription={({ distance, duration }) =>
|
|
246
|
+
`全程 *${distance / 1000}公里* 约行驶 *${duration}*`
|
|
247
|
+
}
|
|
248
|
+
mapRef={setMap}
|
|
249
|
+
registerOverlay={registerFitVeiw}
|
|
250
|
+
/>
|
|
251
|
+
);
|
|
252
|
+
},
|
|
253
|
+
});
|
|
84
254
|
```
|
|
85
255
|
|
|
86
|
-
####
|
|
256
|
+
#### 打车状态流转业务的地图组件 `BusinessTaxiServiceMap`
|
|
257
|
+
|
|
258
|
+
对于 jsx/tsx 文件的例子
|
|
87
259
|
|
|
88
|
-
|
|
260
|
+
```jsx
|
|
261
|
+
import { defineComponent } from "vue";
|
|
262
|
+
import { BusinessTaxiServiceMap, useBusinessTaxiServiceMap } from "@heycar/heycars-map";
|
|
263
|
+
|
|
264
|
+
export default defineComponent({
|
|
265
|
+
setup() {
|
|
266
|
+
const { setMap, registerFitVeiw } = useBusinessTaxiServiceMap();
|
|
267
|
+
return () => (
|
|
268
|
+
<BusinessTaxiServiceMap
|
|
269
|
+
class={css.adjustedDemo}
|
|
270
|
+
from={{
|
|
271
|
+
displayName: "ARTS LINK零创国际艺术教育长宁区创业园区",
|
|
272
|
+
name: "上海市长宁区华阳路街道ARTS LINK零创国际艺术教育长宁区创业园区",
|
|
273
|
+
lat: 1.311295,
|
|
274
|
+
lng: 103.841974,
|
|
275
|
+
}}
|
|
276
|
+
to={{
|
|
277
|
+
displayName: "ARTS LINK零创国际艺术教育长宁区创业园区",
|
|
278
|
+
name: "上海市长宁区华阳路街道ARTS LINK零创国际艺术教育长宁区创业园区",
|
|
279
|
+
lat: 1.2966426,
|
|
280
|
+
lng: 103.7763939,
|
|
281
|
+
}}
|
|
282
|
+
driverStatus={"driverArrived"}
|
|
283
|
+
bookDispatchingTitle="2月14日 11:00 用车"
|
|
284
|
+
dispatchingTitle="正在为您搜索附近司机"
|
|
285
|
+
driverArrivedTitle="司机已等待 00:35"
|
|
286
|
+
renderStartSerivceTitle={({ distance, duration }) =>
|
|
287
|
+
`距你*${distance}*公里, *${duration}*分钟`
|
|
288
|
+
}
|
|
289
|
+
renderInServiceTitle={({ distance, duration }) =>
|
|
290
|
+
`距离终点*${distance}*公里, 预计*${duration}*分钟`
|
|
291
|
+
}
|
|
292
|
+
getDriverPosition={async () => {
|
|
293
|
+
// 向后端请求司机位置和车头方向
|
|
294
|
+
return { position: [121.4036983, 31.216324], angle: 30 };
|
|
295
|
+
}}
|
|
296
|
+
interval={5000}
|
|
297
|
+
mapRef={setMap}
|
|
298
|
+
registerOverlay={registerFitVeiw}
|
|
299
|
+
/>
|
|
300
|
+
);
|
|
301
|
+
},
|
|
302
|
+
});
|
|
303
|
+
```
|
|
89
304
|
|
|
90
|
-
|
|
91
|
-
|
|
305
|
+
#### 服务结束的地图组件
|
|
306
|
+
|
|
307
|
+
对于 jsx/tsx 文件的例子
|
|
308
|
+
|
|
309
|
+
```jsx
|
|
310
|
+
import { defineComponent } from "vue";
|
|
311
|
+
import { BusinessTaxiEndMap } from "@heycar/heycars-map";
|
|
312
|
+
|
|
313
|
+
export default defineComponent({
|
|
314
|
+
setup() {
|
|
315
|
+
return () => (
|
|
316
|
+
<BusinessTaxiEndMap
|
|
317
|
+
class={"demo"}
|
|
318
|
+
from={{
|
|
319
|
+
displayName: "ARTS LINK零创国际艺术教育长宁区创业园区",
|
|
320
|
+
name: "上海市长宁区华阳路街道ARTS LINK零创国际艺术教育长宁区创业园区",
|
|
321
|
+
lat: 1.311295,
|
|
322
|
+
lng: 103.841974,
|
|
323
|
+
}}
|
|
324
|
+
to={{
|
|
325
|
+
displayName: "ARTS LINK零创国际艺术教育长宁区创业园区",
|
|
326
|
+
name: "上海市长宁区华阳路街道ARTS LINK零创国际艺术教育长宁区创业园区",
|
|
327
|
+
lat: 1.2966426,
|
|
328
|
+
lng: 103.7763939,
|
|
329
|
+
}}
|
|
330
|
+
/>
|
|
331
|
+
);
|
|
332
|
+
},
|
|
333
|
+
});
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
#### 下面是基础业务组件的使用方法,但是目前阶段不推荐使用
|
|
337
|
+
|
|
338
|
+
下列是一些更加基础的业务组件, 虽然导出了,但是目前阶段不推荐使用
|
|
339
|
+
|
|
340
|
+
- `AbsoluteAddressBox`
|
|
92
341
|
- `DrivingLine`
|
|
93
342
|
- `PassengerCircle`
|
|
94
343
|
- `PlaceCircle`
|
|
@@ -98,40 +347,7 @@ npm install @heycar/heycars-map --save
|
|
|
98
347
|
- `WaveCircle`
|
|
99
348
|
- `DrivingRoute`
|
|
100
349
|
- `WalkingRoute`
|
|
101
|
-
|
|
102
|
-
目前有下列组件可以使用下列 hooks
|
|
103
|
-
|
|
104
|
-
- `useBusinessMapRecomendPlace`
|
|
105
|
-
- `useBusinessMapAutoComplete`
|
|
106
|
-
|
|
107
|
-
目前有下列常用数据结构
|
|
108
|
-
|
|
109
|
-
```typescript
|
|
110
|
-
export type Point = [number, number];
|
|
111
|
-
|
|
112
|
-
export type Place = {
|
|
113
|
-
lng: number;
|
|
114
|
-
lat: number;
|
|
115
|
-
name: string;
|
|
116
|
-
cityName?: string;
|
|
117
|
-
cityId?: string;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
export interface AutoCompletePlace extends Place {
|
|
121
|
-
placeId?: string;
|
|
122
|
-
description: string;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export type Region = {
|
|
126
|
-
bound?: {
|
|
127
|
-
east: number;
|
|
128
|
-
north: number;
|
|
129
|
-
south: number;
|
|
130
|
-
west: number;
|
|
131
|
-
};
|
|
132
|
-
name: string;
|
|
133
|
-
};
|
|
134
|
-
```
|
|
350
|
+
- `PickupPoints`
|
|
135
351
|
|
|
136
352
|
#### 在地图里使用 `AddressBox` ,需要放在 `HeycarMap` 内部
|
|
137
353
|
|
|
@@ -155,3 +371,33 @@ export type Region = {
|
|
|
155
371
|
...
|
|
156
372
|
</HeycarMap>
|
|
157
373
|
```
|
|
374
|
+
|
|
375
|
+
#### `HeycarMap` 的基本用法
|
|
376
|
+
|
|
377
|
+
- 对于 jsx/tsx 文件的例子
|
|
378
|
+
|
|
379
|
+
```jsx
|
|
380
|
+
<HeycarMap
|
|
381
|
+
class="any class name"
|
|
382
|
+
// 地图加载失败要显示的内容
|
|
383
|
+
fallback={() => <div>error</div>}
|
|
384
|
+
// 地图还没有加载完成时要显示的内容
|
|
385
|
+
loading={() => <div>loading</div>}
|
|
386
|
+
// 地图中心点
|
|
387
|
+
center={[0, 0]}
|
|
388
|
+
// 地图放缩
|
|
389
|
+
zoom={3}
|
|
390
|
+
>
|
|
391
|
+
...
|
|
392
|
+
</HeycarMap>
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
- 对于 vue 文件的例子
|
|
396
|
+
|
|
397
|
+
```vue
|
|
398
|
+
<HeycarMap :center="[0, 0]" class="any class name" :zoom="3">
|
|
399
|
+
<template #fallback>error</template>
|
|
400
|
+
<template #loading>loading</template>
|
|
401
|
+
...
|
|
402
|
+
</HeycarMap>
|
|
403
|
+
```
|
package/dist/api/contants.d.ts
CHANGED
|
@@ -5,3 +5,5 @@ export declare const ZINDEX_START_END_LOGO_LAYER = 40;
|
|
|
5
5
|
export declare const ZINDEX_PLACE_LAYER = 30;
|
|
6
6
|
export declare const ZINDEX_CAR_LAYER = 21;
|
|
7
7
|
export declare const ZINDEX_PASSENGER_LAYER = 20;
|
|
8
|
+
export declare const ZINDEX_LINE_LAYER = 12;
|
|
9
|
+
export declare const ZINDEX_GREEN_ZONE = 10;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Point } from "../../types/interface";
|
|
2
|
+
interface GreenZoneProps {
|
|
3
|
+
path: Point[];
|
|
4
|
+
}
|
|
5
|
+
export declare const AGreenZone: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<GreenZoneProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<GreenZoneProps, Required<GreenZoneProps>>, never, GreenZoneProps, {}>;
|
|
6
|
+
export declare const GGreenZone: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<GreenZoneProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<GreenZoneProps, Required<GreenZoneProps>>, never, GreenZoneProps, {}>;
|
|
7
|
+
export declare const GreenZone: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<GreenZoneProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<GreenZoneProps, Required<GreenZoneProps>>, never, GreenZoneProps, {}>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./GreenZone";
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import { Ref } from "vue-demi";
|
|
2
|
-
import type { Place, Point } from "../types/interface";
|
|
2
|
+
import type { Place, Point, RecommendZonePlaces, Zone } from "../types/interface";
|
|
3
3
|
import { UseMapPlaceProps } from "./useMapPlace";
|
|
4
|
+
interface ValueOfOnChangeRecommendPlace {
|
|
5
|
+
place: Place;
|
|
6
|
+
inputPlace: Place;
|
|
7
|
+
isInZone: boolean;
|
|
8
|
+
}
|
|
4
9
|
export interface UseMapRecomendPlaceProps<C = Record<string, any>> {
|
|
5
10
|
pointRef: Ref<Point>;
|
|
6
11
|
context?: C;
|
|
7
12
|
emptyPlaceName: string;
|
|
8
13
|
getLimit: (context?: C) => number;
|
|
9
|
-
getRecomendPlace: (place: Place, context?: C) => Promise<
|
|
14
|
+
getRecomendPlace: (place: Place, context?: C) => Promise<RecommendZonePlaces | undefined>;
|
|
10
15
|
onChangePlace?: UseMapPlaceProps["onChange"];
|
|
11
|
-
onChange?: (place:
|
|
16
|
+
onChange?: (place: ValueOfOnChangeRecommendPlace) => any;
|
|
12
17
|
}
|
|
13
18
|
export declare const useAmapRecomendPlace: <C>(props: UseMapRecomendPlaceProps<C>) => {
|
|
19
|
+
zoneRef: Ref<Zone | undefined>;
|
|
14
20
|
recomendPlace: {
|
|
15
21
|
lng: number;
|
|
16
22
|
lat: number;
|
|
@@ -25,12 +31,13 @@ export declare const useAmapRecomendPlace: <C>(props: UseMapRecomendPlaceProps<C
|
|
|
25
31
|
}[]>;
|
|
26
32
|
availableRef: Ref<boolean>;
|
|
27
33
|
isElectedRef: import("vue-demi").ComputedRef<boolean>;
|
|
28
|
-
|
|
34
|
+
updateRecommendPlace: (place: Place) => void;
|
|
29
35
|
updatePlaceCandidates: (place: Place) => Promise<void>;
|
|
30
36
|
updatePlace: (value: Point) => void;
|
|
31
|
-
|
|
37
|
+
setPlaceCandidatesAndZone: ({ zone, places }: RecommendZonePlaces) => void;
|
|
32
38
|
};
|
|
33
39
|
export declare const useGmapRecomendPlace: <C>(props: UseMapRecomendPlaceProps<C>) => {
|
|
40
|
+
zoneRef: Ref<Zone | undefined>;
|
|
34
41
|
recomendPlace: {
|
|
35
42
|
lng: number;
|
|
36
43
|
lat: number;
|
|
@@ -45,12 +52,13 @@ export declare const useGmapRecomendPlace: <C>(props: UseMapRecomendPlaceProps<C
|
|
|
45
52
|
}[]>;
|
|
46
53
|
availableRef: Ref<boolean>;
|
|
47
54
|
isElectedRef: import("vue-demi").ComputedRef<boolean>;
|
|
48
|
-
|
|
55
|
+
updateRecommendPlace: (place: Place) => void;
|
|
49
56
|
updatePlaceCandidates: (place: Place) => Promise<void>;
|
|
50
57
|
updatePlace: (value: Point) => void;
|
|
51
|
-
|
|
58
|
+
setPlaceCandidatesAndZone: ({ zone, places }: RecommendZonePlaces) => void;
|
|
52
59
|
};
|
|
53
60
|
export declare const useMapRecomendPlace: <C>(props: UseMapRecomendPlaceProps<C>) => {
|
|
61
|
+
zoneRef: Ref<Zone | undefined>;
|
|
54
62
|
recomendPlace: {
|
|
55
63
|
lng: number;
|
|
56
64
|
lat: number;
|
|
@@ -65,8 +73,9 @@ export declare const useMapRecomendPlace: <C>(props: UseMapRecomendPlaceProps<C>
|
|
|
65
73
|
}[]>;
|
|
66
74
|
availableRef: Ref<boolean>;
|
|
67
75
|
isElectedRef: import("vue-demi").ComputedRef<boolean>;
|
|
68
|
-
|
|
76
|
+
updateRecommendPlace: (place: Place) => void;
|
|
69
77
|
updatePlaceCandidates: (place: Place) => Promise<void>;
|
|
70
78
|
updatePlace: (value: Point) => void;
|
|
71
|
-
|
|
79
|
+
setPlaceCandidatesAndZone: ({ zone, places }: RecommendZonePlaces) => void;
|
|
72
80
|
};
|
|
81
|
+
export {};
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import type { Place, Point } from "../types/interface";
|
|
1
|
+
import type { Place, Point, RecommendZonePlaces } from "../types/interface";
|
|
2
|
+
export interface SetCenterPlaceByUserSpecifiedInZoneProps {
|
|
3
|
+
place: Place;
|
|
4
|
+
recommends: RecommendZonePlaces;
|
|
5
|
+
}
|
|
2
6
|
export interface BusinessRecomendPlaceContext {
|
|
3
7
|
panToGeoPositionByRecomend: (value: Point) => void;
|
|
4
8
|
setCenterPlaceByUserSpecified: (value: Place) => void;
|
|
9
|
+
setCenterPlaceByUserSpecifiedInZone: (value: SetCenterPlaceByUserSpecifiedInZoneProps) => void;
|
|
5
10
|
onChangeCenterPlace: (value: Place) => void;
|
|
6
11
|
onChangeRecomendPlaces: (value: Place[]) => void;
|
|
7
12
|
}
|
|
@@ -21,6 +26,7 @@ export declare const useBusinessRecomendPlaceMap: () => {
|
|
|
21
26
|
}[]>;
|
|
22
27
|
panToGeoPositionByRecomend: (value: Point) => void;
|
|
23
28
|
setCenterPlaceByUserSpecified: (value: Place) => void;
|
|
29
|
+
setCenterPlaceByUserSpecifiedInZone: (value: SetCenterPlaceByUserSpecifiedInZoneProps) => void;
|
|
24
30
|
apiMapDistance: (from: Point, to: Point) => number | undefined;
|
|
25
31
|
apiMapInChina: (point: Point) => boolean;
|
|
26
32
|
};
|