-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathDummyApi.ts
47 lines (41 loc) · 1.11 KB
/
DummyApi.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import Api from '@/api/Api'
import {
ApiInfo,
GeocodingResult,
ReverseGeocodingHit,
RoutingArgs,
RoutingResult,
RoutingResultInfo,
Bbox,
} from '@/api/graphhopper'
import { POIAndQuery, POIQuery } from '@/pois/AddressParseResult'
export default class DummyApi implements Api {
geocode(query: string): Promise<GeocodingResult> {
return Promise.resolve({
took: 0,
hits: [],
})
}
reverseGeocode(query: POIQuery, bbox: Bbox): Promise<ReverseGeocodingHit[]> {
return Promise.resolve([])
}
info(): Promise<ApiInfo> {
return Promise.resolve({
bbox: [0, 0, 0, 0],
elevation: false,
version: '',
profiles: [],
encoded_values: [],
})
}
route(args: RoutingArgs): Promise<RoutingResult> {
return Promise.resolve({
info: { took: 0, road_data_timestamp: '', copyright: [] } as RoutingResultInfo,
paths: [],
})
}
routeWithDispatch(args: RoutingArgs): void {}
supportsGeocoding(): boolean {
return true
}
}