react-native-map4d-services 1.0.2 → 1.1.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/ios/SRequest.m CHANGED
@@ -1,142 +1,112 @@
1
- //
2
- // SRequest.m
3
- // react-native-map4d-services
4
- //
5
- // Created by Huy Dang on 26/01/2022.
6
- //
7
-
8
- #import "SRequest.h"
9
- #import "SParamConvert.h"
10
-
11
- @implementation SRequest
12
-
13
- #pragma mark - Geocode
14
-
15
- + (MFServiceRequest *)buildGeocodingRequestWithData:(NSDictionary *)data {
16
- MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/v2/geocode"];
17
- MFGeocodeParams *params = [[MFGeocodeParams alloc] initWithAddress:data[@"address"]];
18
- params.location = [SParamConvert MFLocationComponent:data[@"location"]];
19
- params.viewbox = [SParamConvert MFViewboxComponent:data[@"viewbox"]];
20
-
21
- request.params = params;
22
- return request;
23
- }
24
-
25
- #pragma mark - Place
26
-
27
- + (MFServiceRequest *)buildPlaceDetailRequestWithId:(NSString *)placeId {
28
- NSString *path = [@"/sdk/place/detail/" stringByAppendingString:placeId];
29
- return [[MFServiceRequest alloc] initWithPath:path];
30
- }
31
-
32
- + (MFServiceRequest *)buildTextSearchRequestWithData:(NSDictionary *)data {
33
- MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/place/text-search"];
34
- MFTextSearchParams *params = [[MFTextSearchParams alloc] initWithText:data[@"text"]];
35
- params.types = [SParamConvert NSStringArray:data[@"types"]];
36
- params.location = [SParamConvert MFLocationComponent:data[@"location"]];
37
- params.datetime = [SParamConvert NSDate:data[@"datetime"]];
38
-
39
- request.params = params;
40
- return request;
41
- }
42
-
43
- + (MFServiceRequest *)buildNearbySearchRequestWithData:(NSDictionary *)data {
44
- MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/place/nearby-search"];
45
- MFNearbySearchParams *params = [[MFNearbySearchParams alloc] initWithLocation:[SParamConvert MFLocationComponent:data[@"location"]]
46
- radius:[SParamConvert NSUInteger:data[@"radius"]]
47
- text:[SParamConvert NSString:data[@"text"]]];
48
- params.types = [SParamConvert NSStringArray:data[@"types"]];
49
- params.tags = [SParamConvert NSStringArray:data[@"tags"]];
50
- params.datetime = [SParamConvert NSDate:data[@"datetime"]];
51
-
52
- request.params = params;
53
- return request;
54
- }
55
-
56
- + (MFServiceRequest *)buildViewboxSearchRequestWithData:(NSDictionary *)data {
57
- MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/place/viewbox-search"];
58
- MFViewboxSearchParams *params = [[MFViewboxSearchParams alloc] initWithViewbox:[SParamConvert MFViewboxComponent:data[@"viewbox"]]
59
- text:[SParamConvert NSString:data[@"text"]]];
60
- params.types = [SParamConvert NSStringArray:data[@"types"]];
61
- params.tags = [SParamConvert NSStringArray:data[@"tags"]];
62
- params.datetime = [SParamConvert NSDate:data[@"datetime"]];
63
-
64
- request.params = params;
65
- return request;
66
- }
67
-
68
- + (MFServiceRequest *)buildSuggestionsRequestWithData:(NSDictionary *)data {
69
- MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/autosuggest"];
70
- MFSuggestionParams *params = [[MFSuggestionParams alloc] initWithText:[SParamConvert NSString:data[@"text"]]];
71
- params.location = [SParamConvert MFLocationComponent:data[@"location"]];
72
- params.acronym = [SParamConvert BOOL:data[@"acronym"] fallback:params.acronym];
73
-
74
- request.params = params;
75
- return request;
76
- }
77
-
78
- #pragma mark - Route
79
-
80
- + (MFServiceRequest *)buildDirectionsRequestWithData:(NSDictionary *)data {
81
- MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/route"];
82
-
83
- MFLocationComponent *origin = [SParamConvert MFLocationComponent:data[@"origin"]];
84
- MFLocationComponent *destination = [SParamConvert MFLocationComponent:data[@"destination"]];
85
- MFDirectionsParams *params = [[MFDirectionsParams alloc] initWithOrigin:origin destination:destination];
86
- params.waypoints = [SParamConvert MFLocationComponentArray:data[@"points"]];
87
- params.mode = [SParamConvert MFTravelMode:data[@"mode"] fallback:params.mode];
88
- params.language = [SParamConvert MFLanguageResult:data[@"language"] fallback:params.language];
89
- params.weighting = [SParamConvert MFRouteWeighting:data[@"weighting"] fallback:params.weighting];
90
- params.restriction = [SParamConvert MFRouteRestriction:data[@"restriction"]];
91
-
92
- request.params = params;
93
- return request;
94
- }
95
-
96
- + (MFServiceRequest *)buildRouteETARequestWithData:(NSDictionary *)data {
97
- MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/route/eta"];
98
-
99
- NSArray<MFLocationComponent *> *origins = [SParamConvert MFLocationComponentArray:data[@"origins"]];
100
- MFLocationComponent *destination = [SParamConvert MFLocationComponent:data[@"destination"]];
101
- MFRouteETAParams *params = [[MFRouteETAParams alloc] initWithOrigins:origins destination:destination];
102
- params.mode = [SParamConvert MFTravelMode:data[@"mode"] fallback:params.mode];
103
- params.language = [SParamConvert MFLanguageResult:data[@"language"] fallback:params.language];
104
- params.weighting = [SParamConvert MFRouteWeighting:data[@"weighting"] fallback:params.weighting];
105
- params.restriction = [SParamConvert MFRouteRestriction:data[@"restriction"]];
106
-
107
- request.params = params;
108
- request.method = MFRequestMethodPost;
109
- return request;
110
- }
111
-
112
- + (MFServiceRequest *)buildDistanceMatrixRequestWithData:(NSDictionary *)data {
113
- MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/route/matrix"];
114
-
115
- NSArray<MFLocationComponent *> *origins = [SParamConvert MFLocationComponentArray:data[@"origins"]];
116
- NSArray<MFLocationComponent *> *destinations = [SParamConvert MFLocationComponentArray:data[@"destinations"]];
117
- MFDistanceMatrixParams *params = [[MFDistanceMatrixParams alloc] initWithOrigins:origins destinations:destinations];
118
- params.mode = [SParamConvert MFTravelMode:data[@"mode"] fallback:params.mode];
119
- params.language = [SParamConvert MFLanguageResult:data[@"language"] fallback:params.language];
120
- params.weighting = [SParamConvert MFRouteWeighting:data[@"weighting"] fallback:params.weighting];
121
- params.restriction = [SParamConvert MFRouteRestriction:data[@"restriction"]];
122
-
123
- request.params = params;
124
- return request;
125
- }
126
-
127
- + (MFServiceRequest *)buildGraphRouteRequestWithData:(NSDictionary *)data {
128
- MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/route/graph"];
129
-
130
- NSArray<MFLocationComponent *> *points = [SParamConvert MFLocationComponentArray:data[@"locations"]];
131
- MFGraphRouteParams *params = [[MFGraphRouteParams alloc] initWithLocations:points];
132
- params.mode = [SParamConvert MFTravelMode:data[@"mode"] fallback:params.mode];
133
- params.language = [SParamConvert MFLanguageResult:data[@"language"] fallback:params.language];
134
- params.weighting = [SParamConvert MFRouteWeighting:data[@"weighting"] fallback:params.weighting];
135
- params.restriction = [SParamConvert MFRouteRestriction:data[@"restriction"]];
136
-
137
- request.params = params;
138
- return request;
139
- }
140
-
141
- @end
142
-
1
+ //
2
+ // SRequest.m
3
+ // react-native-map4d-services
4
+ //
5
+ // Created by Huy Dang on 26/01/2022.
6
+ //
7
+
8
+ #import "SRequest.h"
9
+ #import "SParamConvert.h"
10
+
11
+ @implementation SRequest
12
+
13
+ #pragma mark - Geocode
14
+
15
+ + (MFServiceRequest *)buildGeocodingRequestWithData:(NSDictionary *)data {
16
+ MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/v2/geocode"];
17
+ MFGeocodeParams *params = [[MFGeocodeParams alloc] initWithAddress:data[@"address"]];
18
+ params.location = [SParamConvert MFLocationComponent:data[@"location"]];
19
+ params.viewbox = [SParamConvert MFViewboxComponent:data[@"viewbox"]];
20
+
21
+ request.params = params;
22
+ return request;
23
+ }
24
+
25
+ #pragma mark - Place
26
+
27
+ + (MFServiceRequest *)buildPlaceDetailRequestWithId:(NSString *)placeId {
28
+ NSString *path = [@"/sdk/place/detail/" stringByAppendingString:placeId];
29
+ return [[MFServiceRequest alloc] initWithPath:path];
30
+ }
31
+
32
+ + (MFServiceRequest *)buildTextSearchRequestWithData:(NSDictionary *)data {
33
+ MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/place/text-search"];
34
+ MFTextSearchParams *params = [[MFTextSearchParams alloc] initWithText:data[@"text"]];
35
+ params.types = [SParamConvert NSStringArray:data[@"types"]];
36
+ params.location = [SParamConvert MFLocationComponent:data[@"location"]];
37
+ params.datetime = [SParamConvert NSDate:data[@"datetime"]];
38
+
39
+ request.params = params;
40
+ return request;
41
+ }
42
+
43
+ + (MFServiceRequest *)buildNearbySearchRequestWithData:(NSDictionary *)data {
44
+ MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/place/nearby-search"];
45
+ MFNearbySearchParams *params = [[MFNearbySearchParams alloc] initWithLocation:[SParamConvert MFLocationComponent:data[@"location"]]
46
+ radius:[SParamConvert NSUInteger:data[@"radius"]]
47
+ text:[SParamConvert NSString:data[@"text"]]];
48
+ params.types = [SParamConvert NSStringArray:data[@"types"]];
49
+ params.tags = [SParamConvert NSStringArray:data[@"tags"]];
50
+ params.datetime = [SParamConvert NSDate:data[@"datetime"]];
51
+
52
+ request.params = params;
53
+ return request;
54
+ }
55
+
56
+ + (MFServiceRequest *)buildViewboxSearchRequestWithData:(NSDictionary *)data {
57
+ MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/place/viewbox-search"];
58
+ MFViewboxSearchParams *params = [[MFViewboxSearchParams alloc] initWithViewbox:[SParamConvert MFViewboxComponent:data[@"viewbox"]]
59
+ text:[SParamConvert NSString:data[@"text"]]];
60
+ params.types = [SParamConvert NSStringArray:data[@"types"]];
61
+ params.tags = [SParamConvert NSStringArray:data[@"tags"]];
62
+ params.datetime = [SParamConvert NSDate:data[@"datetime"]];
63
+
64
+ request.params = params;
65
+ return request;
66
+ }
67
+
68
+ + (MFServiceRequest *)buildSuggestionsRequestWithData:(NSDictionary *)data {
69
+ MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/autosuggest"];
70
+ MFSuggestionParams *params = [[MFSuggestionParams alloc] initWithText:[SParamConvert NSString:data[@"text"]]];
71
+ params.location = [SParamConvert MFLocationComponent:data[@"location"]];
72
+ params.acronym = [SParamConvert BOOL:data[@"acronym"] fallback:params.acronym];
73
+
74
+ request.params = params;
75
+ return request;
76
+ }
77
+
78
+ #pragma mark - Route
79
+
80
+ + (MFServiceRequest *)buildDirectionsRequestWithData:(NSDictionary *)data {
81
+ MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/route"];
82
+
83
+ MFLocationComponent *origin = [SParamConvert MFLocationComponent:data[@"origin"]];
84
+ MFLocationComponent *destination = [SParamConvert MFLocationComponent:data[@"destination"]];
85
+ MFDirectionsParams *params = [[MFDirectionsParams alloc] initWithOrigin:origin destination:destination];
86
+ params.waypoints = [SParamConvert MFLocationComponentArray:data[@"points"]];
87
+ params.mode = [SParamConvert MFTravelMode:data[@"mode"] fallback:params.mode];
88
+ params.language = [SParamConvert MFLanguageResult:data[@"language"] fallback:params.language];
89
+ params.weighting = [SParamConvert MFRouteWeighting:data[@"weighting"] fallback:params.weighting];
90
+ params.restriction = [SParamConvert MFRouteRestriction:data[@"restriction"]];
91
+
92
+ request.params = params;
93
+ return request;
94
+ }
95
+
96
+ + (MFServiceRequest *)buildDistanceMatrixRequestWithData:(NSDictionary *)data {
97
+ MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/route/matrix"];
98
+
99
+ NSArray<MFLocationComponent *> *origins = [SParamConvert MFLocationComponentArray:data[@"origins"]];
100
+ NSArray<MFLocationComponent *> *destinations = [SParamConvert MFLocationComponentArray:data[@"destinations"]];
101
+ MFDistanceMatrixParams *params = [[MFDistanceMatrixParams alloc] initWithOrigins:origins destinations:destinations];
102
+ params.mode = [SParamConvert MFTravelMode:data[@"mode"] fallback:params.mode];
103
+ params.language = [SParamConvert MFLanguageResult:data[@"language"] fallback:params.language];
104
+ params.weighting = [SParamConvert MFRouteWeighting:data[@"weighting"] fallback:params.weighting];
105
+ params.restriction = [SParamConvert MFRouteRestriction:data[@"restriction"]];
106
+
107
+ request.params = params;
108
+ return request;
109
+ }
110
+
111
+ @end
112
+
@@ -7,10 +7,8 @@ exports.MFTravelMode = exports.MFRouteWeighting = exports.MFRouteType = exports.
7
7
  exports.fetchDirections = fetchDirections;
8
8
  exports.fetchDistanceMatrix = fetchDistanceMatrix;
9
9
  exports.fetchGeocode = fetchGeocode;
10
- exports.fetchGraphRoute = fetchGraphRoute;
11
10
  exports.fetchNearbySearch = fetchNearbySearch;
12
11
  exports.fetchPlaceDetail = fetchPlaceDetail;
13
- exports.fetchRouteETA = fetchRouteETA;
14
12
  exports.fetchSuggestion = fetchSuggestion;
15
13
  exports.fetchTextSearch = fetchTextSearch;
16
14
  exports.fetchViewboxSearch = fetchViewboxSearch;
@@ -93,15 +91,7 @@ function fetchDirections(params) {
93
91
  return Map4dServices.fetchDirections(params);
94
92
  }
95
93
 
96
- function fetchRouteETA(params) {
97
- return Map4dServices.fetchRouteETA(params);
98
- }
99
-
100
94
  function fetchDistanceMatrix(params) {
101
95
  return Map4dServices.fetchDistanceMatrix(params);
102
96
  }
103
-
104
- function fetchGraphRoute(params) {
105
- return Map4dServices.fetchGraphRoute(params);
106
- }
107
97
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.tsx"],"names":["LINKING_ERROR","Platform","select","ios","default","Map4dServices","NativeModules","Proxy","get","Error","MFTravelMode","MFRouteWeighting","MFLanguageResult","MFRouteType","fetchSuggestion","params","fetchPlaceDetail","placeId","fetchTextSearch","fetchNearbySearch","fetchViewboxSearch","fetchGeocode","fetchDirections","fetchRouteETA","fetchDistanceMatrix","fetchGraphRoute"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AAEA,MAAMA,aAAa,GAChB,sFAAD,GACAC,sBAASC,MAAT,CAAgB;AAAEC,EAAAA,GAAG,EAAE,gCAAP;AAAyCC,EAAAA,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6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MAA3B,CAAP;AACD;;AAEM,SAASO,eAAT,CAAyBP,MAAzB,EAAmE;AACxE,SAAOV,aAAa,CAACiB,eAAd,CAA8BP,MAA9B,CAAP;AACD;;AAEM,SAASQ,aAAT,CAAuBR,MAAvB,EAA+D;AACpE,SAAOV,aAAa,CAACkB,aAAd,CAA4BR,MAA5B,CAAP;AACD;;AAEM,SAASS,mBAAT,CAA6BT,MAA7B,EAA2E;AAChF,SAAOV,aAAa,CAACmB,mBAAd,CAAkCT,MAAlC,CAAP;AACD;;AAEM,SAASU,eAAT,CAAyBV,MAAzB,EAAmE;AACxE,SAAOV,aAAa,CAACoB,eAAd,CAA8BV,MAA9B,CAAP;AACD","sourcesContent":["import { NativeModules, Platform } from 'react-native';\r\n\r\nconst LINKING_ERROR =\r\n `The package 'react-native-map4d-services' doesn't seem to be linked. Make sure: \\n\\n` +\r\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\r\n '- You rebuilt the app after installing the package\\n' +\r\n '- You are not using Expo managed workflow\\n';\r\n\r\nconst Map4dServices = NativeModules.Map4dServices\r\n ? NativeModules.Map4dServices\r\n : new Proxy(\r\n {},\r\n {\r\n get() {\r\n throw new Error(LINKING_ERROR);\r\n },\r\n }\r\n );\r\n\r\nexport type MFLocationComponent = {\r\n latitude: number,\r\n longitude: number,\r\n alias?: string,\r\n}\r\n\r\nexport type MFViewboxComponent = {\r\n southwest: MFLocationComponent,\r\n northeast: MFLocationComponent,\r\n}\r\n\r\nexport enum MFTravelMode {\r\n car = 'car',\r\n bike = 'bike',\r\n foot = 'foot',\r\n motorcycle = 'motorcycle',\r\n}\r\n\r\nexport enum MFRouteWeighting {\r\n shortest = 'shortest',\r\n fastest = 'fastest',\r\n balance = 'balance',\r\n}\r\n\r\nexport enum MFLanguageResult {\r\n en = 'en',\r\n vi = 'vi',\r\n}\r\n\r\nexport enum MFRouteType {\r\n motorway = 'motorway',\r\n trunk = 'trunk',\r\n ferry = 'ferry',\r\n bridge = 'bridge',\r\n tunnel = 'tunnel',\r\n}\r\n\r\nexport type MFRouteRestriction = {\r\n location?: MFLocationComponent,\r\n radius?: number,\r\n viewbox?: MFViewboxComponent,\r\n path?: MFLocationComponent[],\r\n types?: MFRouteType[] | string[]\r\n}\r\n\r\nexport type MFSuggestionParams = {\r\n text: string,\r\n location?: MFLocationComponent,\r\n acronym?: boolean,\r\n}\r\n\r\nexport type MFTextSearchParams = {\r\n text: string,\r\n types?: string[],\r\n datetime?: number,\r\n location?: MFLocationComponent,\r\n}\r\n\r\nexport type MFNearbySearchParams = {\r\n location: MFLocationComponent,\r\n radius: number,\r\n text?: string,\r\n types?: string[],\r\n tags?: string[],\r\n datetime?: number,\r\n}\r\n\r\nexport type MFViewboxSearchParams = {\r\n viewbox: MFViewboxComponent,\r\n text?: string,\r\n types?: string[],\r\n tags?: string[],\r\n datetime?: number,\r\n}\r\n\r\nexport type MFGeocodeParams = {\r\n location?: MFLocationComponent,\r\n address?: string,\r\n viewbox?: MFViewboxComponent,\r\n}\r\n\r\nexport type MFDirectionsParams = {\r\n origin: MFLocationComponent,\r\n destination: MFLocationComponent,\r\n waypoints?: MFLocationComponent[],\r\n mode?: MFTravelMode | string,\r\n weighting?: MFRouteWeighting | string,\r\n language?: MFLanguageResult | string,\r\n restriction?: MFRouteRestriction,\r\n}\r\n\r\nexport type MFRouteETAParams = {\r\n origins: MFLocationComponent[],\r\n destination: MFLocationComponent,\r\n mode?: MFTravelMode | string,\r\n weighting?: MFRouteWeighting | string,\r\n language?: MFLanguageResult | string,\r\n restriction?: MFRouteRestriction,\r\n}\r\n\r\nexport type MFDistanceMatrixParams = {\r\n origins: MFLocationComponent[],\r\n destinations: MFLocationComponent[],\r\n mode?: MFTravelMode | string,\r\n weighting?: MFRouteWeighting | string,\r\n language?: MFLanguageResult | string,\r\n restriction?: MFRouteRestriction,\r\n}\r\n\r\nexport type MFGraphRouteParams = {\r\n locations: MFLocationComponent[],\r\n mode?: MFTravelMode | string,\r\n weighting?: MFRouteWeighting | string,\r\n language?: MFLanguageResult | string,\r\n restriction?: MFRouteRestriction,\r\n}\r\n\r\nexport function fetchSuggestion(params: MFSuggestionParams): Promise<any> {\r\n return Map4dServices.fetchSuggestion(params);\r\n}\r\n\r\nexport function fetchPlaceDetail(placeId: string): Promise<any> {\r\n return Map4dServices.fetchPlaceDetail(placeId);\r\n}\r\n\r\nexport function fetchTextSearch(params: MFTextSearchParams): Promise<any> {\r\n return Map4dServices.fetchTextSearch(params);\r\n}\r\n\r\nexport function fetchNearbySearch(params: MFNearbySearchParams): Promise<any> {\r\n return Map4dServices.fetchNearbySearch(params);\r\n}\r\n\r\nexport function fetchViewboxSearch(params: MFViewboxSearchParams): Promise<any> {\r\n return Map4dServices.fetchViewboxSearch(params);\r\n}\r\n\r\nexport function fetchGeocode(params: MFGeocodeParams): Promise<any> {\r\n return Map4dServices.fetchGeocode(params);\r\n}\r\n\r\nexport function fetchDirections(params: MFDirectionsParams): Promise<any> {\r\n return Map4dServices.fetchDirections(params);\r\n}\r\n\r\nexport function fetchRouteETA(params: MFRouteETAParams): Promise<any> {\r\n return Map4dServices.fetchRouteETA(params);\r\n}\r\n\r\nexport function fetchDistanceMatrix(params: MFDistanceMatrixParams): Promise<any> {\r\n return Map4dServices.fetchDistanceMatrix(params);\r\n}\r\n\r\nexport function fetchGraphRoute(params: MFGraphRouteParams): Promise<any> {\r\n return Map4dServices.fetchGraphRoute(params);\r\n}"]}
1
+ {"version":3,"sources":["index.tsx"],"names":["LINKING_ERROR","Platform","select","ios","default","Map4dServices","NativeModules","Proxy","get","Error","MFTravelMode","MFRouteWeighting","MFLanguageResult","MFRouteType","fetchSuggestion","params","fetchPlaceDetail","placeId","fetchTextSearch","fetchNearbySearch","fetchViewboxSearch","fetchGeocode","fetchDirections","fetchDistanceMatrix"],"mappings":";;;;;;;;;;;;;;;AAAA;;AAEA,MAAMA,aAAa,GAChB,sFAAD,GACAC,sBAASC,MAAT,CAAgB;AAAEC,EAAAA,GAAG,EAAE,gC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M,YAAT,CAAsBN,MAAtB,EAA6D;AAClE,SAAOV,aAAa,CAACgB,YAAd,CAA2BN,MAA3B,CAAP;AACD;;AAEM,SAASO,eAAT,CAAyBP,MAAzB,EAAmE;AACxE,SAAOV,aAAa,CAACiB,eAAd,CAA8BP,MAA9B,CAAP;AACD;;AAEM,SAASQ,mBAAT,CAA6BR,MAA7B,EAA2E;AAChF,SAAOV,aAAa,CAACkB,mBAAd,CAAkCR,MAAlC,CAAP;AACD","sourcesContent":["import { NativeModules, Platform } from 'react-native';\n\nconst LINKING_ERROR =\n `The package 'react-native-map4d-services' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst Map4dServices = NativeModules.Map4dServices\n ? NativeModules.Map4dServices\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport type MFLocationComponent = {\n latitude: number,\n longitude: number,\n alias?: string,\n}\n\nexport type MFViewboxComponent = {\n southwest: MFLocationComponent,\n northeast: MFLocationComponent,\n}\n\nexport enum MFTravelMode {\n car = 'car',\n bike = 'bike',\n foot = 'foot',\n motorcycle = 'motorcycle',\n}\n\nexport enum MFRouteWeighting {\n shortest = 'shortest',\n fastest = 'fastest',\n balance = 'balance',\n}\n\nexport enum MFLanguageResult {\n en = 'en',\n vi = 'vi',\n}\n\nexport enum MFRouteType {\n motorway = 'motorway',\n trunk = 'trunk',\n ferry = 'ferry',\n bridge = 'bridge',\n tunnel = 'tunnel',\n}\n\nexport type MFRouteRestriction = {\n location?: MFLocationComponent,\n radius?: number,\n viewbox?: MFViewboxComponent,\n path?: MFLocationComponent[],\n types?: MFRouteType[] | string[]\n}\n\nexport type MFSuggestionParams = {\n text: string,\n location?: MFLocationComponent,\n acronym?: boolean,\n}\n\nexport type MFTextSearchParams = {\n text: string,\n types?: string[],\n datetime?: number,\n location?: MFLocationComponent,\n}\n\nexport type MFNearbySearchParams = {\n location: MFLocationComponent,\n radius: number,\n text?: string,\n types?: string[],\n tags?: string[],\n datetime?: number,\n}\n\nexport type MFViewboxSearchParams = {\n viewbox: MFViewboxComponent,\n text?: string,\n types?: string[],\n tags?: string[],\n datetime?: number,\n}\n\nexport type MFGeocodeParams = {\n location?: MFLocationComponent,\n address?: string,\n viewbox?: MFViewboxComponent,\n}\n\nexport type MFDirectionsParams = {\n origin: MFLocationComponent,\n destination: MFLocationComponent,\n waypoints?: MFLocationComponent[],\n mode?: MFTravelMode | string,\n weighting?: MFRouteWeighting | string,\n language?: MFLanguageResult | string,\n restriction?: MFRouteRestriction,\n}\n\nexport type MFDistanceMatrixParams = {\n origins: MFLocationComponent[],\n destinations: MFLocationComponent[],\n mode?: MFTravelMode | string,\n weighting?: MFRouteWeighting | string,\n language?: MFLanguageResult | string,\n restriction?: MFRouteRestriction,\n}\n\nexport function fetchSuggestion(params: MFSuggestionParams): Promise<any> {\n return Map4dServices.fetchSuggestion(params);\n}\n\nexport function fetchPlaceDetail(placeId: string): Promise<any> {\n return Map4dServices.fetchPlaceDetail(placeId);\n}\n\nexport function fetchTextSearch(params: MFTextSearchParams): Promise<any> {\n return Map4dServices.fetchTextSearch(params);\n}\n\nexport function fetchNearbySearch(params: MFNearbySearchParams): Promise<any> {\n return Map4dServices.fetchNearbySearch(params);\n}\n\nexport function fetchViewboxSearch(params: MFViewboxSearchParams): Promise<any> {\n return Map4dServices.fetchViewboxSearch(params);\n}\n\nexport function fetchGeocode(params: MFGeocodeParams): Promise<any> {\n return Map4dServices.fetchGeocode(params);\n}\n\nexport function fetchDirections(params: MFDirectionsParams): Promise<any> {\n return Map4dServices.fetchDirections(params);\n}\n\nexport function fetchDistanceMatrix(params: MFDistanceMatrixParams): Promise<any> {\n return Map4dServices.fetchDistanceMatrix(params);\n}\n"]}
@@ -64,13 +64,7 @@ export function fetchGeocode(params) {
64
64
  export function fetchDirections(params) {
65
65
  return Map4dServices.fetchDirections(params);
66
66
  }
67
- export function fetchRouteETA(params) {
68
- return Map4dServices.fetchRouteETA(params);
69
- }
70
67
  export function fetchDistanceMatrix(params) {
71
68
  return Map4dServices.fetchDistanceMatrix(params);
72
69
  }
73
- export function fetchGraphRoute(params) {
74
- return Map4dServices.fetchGraphRoute(params);
75
- }
76
70
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.tsx"],"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","Map4dServices","Proxy","get","Error","MFTravelMode","MFRouteWeighting","MFLanguageResult","MFRouteType","fetchSuggestion","params","fetchPlaceDetail","placeId","fetchTextSearch","fetchNearbySearch","fetchViewboxSearch","fetchGeocode","fetchDirections","fetchRouteETA","fetchDistanceMatrix","fetchGraphRoute"],"mappings":"AAAA,SAASA,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC;AAEA,MAAMC,aAAa,GAChB,sFAAD,GACAD,QAAQ,CAACE,MAAT,CAAgB;AAAEC,EAAAA,GAAG,EAAE,gCAAP;AAAyCC,EAAAA,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,aAAa,GAAGN,aAAa,CAACM,aAAd,GAClBN,aAAa,CAACM,aADI,GAElB,IAAIC,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUP,aAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AAsBA,WAAYQ,YAAZ;;WAAYA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;GAAAA,Y,KAAAA,Y;;AAOZ,WAAYC,gBAAZ;;WAAYA,gB;AAAAA,EAAAA,gB;AAAAA,EAAAA,gB;AAAAA,EAAAA,gB;GAAAA,gB,KAAAA,gB;;AAMZ,WAAYC,gBAAZ;;WAAYA,gB;AAAAA,EAAAA,gB;AAAAA,EAAAA,gB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import { NativeModules, Platform } from 'react-native';\r\n\r\nconst LINKING_ERROR =\r\n `The package 'react-native-map4d-services' doesn't seem to be linked. Make sure: \\n\\n` +\r\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\r\n '- You rebuilt the app after installing the package\\n' +\r\n '- You are not using Expo managed workflow\\n';\r\n\r\nconst Map4dServices = NativeModules.Map4dServices\r\n ? NativeModules.Map4dServices\r\n : new Proxy(\r\n {},\r\n {\r\n get() {\r\n throw new Error(LINKING_ERROR);\r\n },\r\n }\r\n );\r\n\r\nexport type MFLocationComponent = {\r\n latitude: number,\r\n longitude: number,\r\n alias?: string,\r\n}\r\n\r\nexport type MFViewboxComponent = {\r\n southwest: MFLocationComponent,\r\n northeast: MFLocationComponent,\r\n}\r\n\r\nexport enum MFTravelMode {\r\n car = 'car',\r\n bike = 'bike',\r\n foot = 'foot',\r\n motorcycle = 'motorcycle',\r\n}\r\n\r\nexport enum MFRouteWeighting {\r\n shortest = 'shortest',\r\n fastest = 'fastest',\r\n balance = 'balance',\r\n}\r\n\r\nexport enum MFLanguageResult {\r\n en = 'en',\r\n vi = 'vi',\r\n}\r\n\r\nexport enum MFRouteType {\r\n motorway = 'motorway',\r\n trunk = 'trunk',\r\n ferry = 'ferry',\r\n bridge = 'bridge',\r\n tunnel = 'tunnel',\r\n}\r\n\r\nexport type MFRouteRestriction = {\r\n location?: MFLocationComponent,\r\n radius?: number,\r\n viewbox?: MFViewboxComponent,\r\n path?: MFLocationComponent[],\r\n types?: MFRouteType[] | string[]\r\n}\r\n\r\nexport type MFSuggestionParams = {\r\n text: string,\r\n location?: MFLocationComponent,\r\n acronym?: boolean,\r\n}\r\n\r\nexport type MFTextSearchParams = {\r\n text: string,\r\n types?: string[],\r\n datetime?: number,\r\n location?: MFLocationComponent,\r\n}\r\n\r\nexport type MFNearbySearchParams = {\r\n location: MFLocationComponent,\r\n radius: number,\r\n text?: string,\r\n types?: string[],\r\n tags?: string[],\r\n datetime?: number,\r\n}\r\n\r\nexport type MFViewboxSearchParams = {\r\n viewbox: MFViewboxComponent,\r\n text?: string,\r\n types?: string[],\r\n tags?: string[],\r\n datetime?: number,\r\n}\r\n\r\nexport type MFGeocodeParams = {\r\n location?: MFLocationComponent,\r\n address?: string,\r\n viewbox?: MFViewboxComponent,\r\n}\r\n\r\nexport type MFDirectionsParams = {\r\n origin: MFLocationComponent,\r\n destination: MFLocationComponent,\r\n waypoints?: MFLocationComponent[],\r\n mode?: MFTravelMode | string,\r\n weighting?: MFRouteWeighting | string,\r\n language?: MFLanguageResult | string,\r\n restriction?: MFRouteRestriction,\r\n}\r\n\r\nexport type MFRouteETAParams = {\r\n origins: MFLocationComponent[],\r\n destination: MFLocationComponent,\r\n mode?: MFTravelMode | string,\r\n weighting?: MFRouteWeighting | string,\r\n language?: MFLanguageResult | string,\r\n restriction?: MFRouteRestriction,\r\n}\r\n\r\nexport type MFDistanceMatrixParams = {\r\n origins: MFLocationComponent[],\r\n destinations: MFLocationComponent[],\r\n mode?: MFTravelMode | string,\r\n weighting?: MFRouteWeighting | string,\r\n language?: MFLanguageResult | string,\r\n restriction?: MFRouteRestriction,\r\n}\r\n\r\nexport type MFGraphRouteParams = {\r\n locations: MFLocationComponent[],\r\n mode?: MFTravelMode | string,\r\n weighting?: MFRouteWeighting | string,\r\n language?: MFLanguageResult | string,\r\n restriction?: MFRouteRestriction,\r\n}\r\n\r\nexport function fetchSuggestion(params: MFSuggestionParams): Promise<any> {\r\n return Map4dServices.fetchSuggestion(params);\r\n}\r\n\r\nexport function fetchPlaceDetail(placeId: string): Promise<any> {\r\n return Map4dServices.fetchPlaceDetail(placeId);\r\n}\r\n\r\nexport function fetchTextSearch(params: MFTextSearchParams): Promise<any> {\r\n return Map4dServices.fetchTextSearch(params);\r\n}\r\n\r\nexport function fetchNearbySearch(params: MFNearbySearchParams): Promise<any> {\r\n return Map4dServices.fetchNearbySearch(params);\r\n}\r\n\r\nexport function fetchViewboxSearch(params: MFViewboxSearchParams): Promise<any> {\r\n return Map4dServices.fetchViewboxSearch(params);\r\n}\r\n\r\nexport function fetchGeocode(params: MFGeocodeParams): Promise<any> {\r\n return Map4dServices.fetchGeocode(params);\r\n}\r\n\r\nexport function fetchDirections(params: MFDirectionsParams): Promise<any> {\r\n return Map4dServices.fetchDirections(params);\r\n}\r\n\r\nexport function fetchRouteETA(params: MFRouteETAParams): Promise<any> {\r\n return Map4dServices.fetchRouteETA(params);\r\n}\r\n\r\nexport function fetchDistanceMatrix(params: MFDistanceMatrixParams): Promise<any> {\r\n return Map4dServices.fetchDistanceMatrix(params);\r\n}\r\n\r\nexport function fetchGraphRoute(params: MFGraphRouteParams): Promise<any> {\r\n return Map4dServices.fetchGraphRoute(params);\r\n}"]}
1
+ {"version":3,"sources":["index.tsx"],"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","Map4dServices","Proxy","get","Error","MFTravelMode","MFRouteWeighting","MFLanguageResult","MFRouteType","fetchSuggestion","params","fetchPlaceDetail","placeId","fetchTextSearch","fetchNearbySearch","fetchViewboxSearch","fetchGeocode","fetchDirections","fetchDistanceMatrix"],"mappings":"AAAA,SAASA,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC;AAEA,MAAMC,aAAa,GAChB,sFAAD,GACAD,QAAQ,CAACE,MAAT,CAAgB;AAAEC,EAAAA,GAAG,EAAE,gCAAP;AAAyCC,EAAAA,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,aAAa,GAAGN,aAAa,CAACM,aAAd,GAClBN,aAAa,CAACM,aADI,GAElB,IAAIC,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUP,aAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AAsBA,WAAYQ,YAAZ;;WAAYA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;GAAAA,Y,KAAAA,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n\nconst LINKING_ERROR =\n `The package 'react-native-map4d-services' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst Map4dServices = NativeModules.Map4dServices\n ? NativeModules.Map4dServices\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport type MFLocationComponent = {\n latitude: number,\n longitude: number,\n alias?: string,\n}\n\nexport type MFViewboxComponent = {\n southwest: MFLocationComponent,\n northeast: MFLocationComponent,\n}\n\nexport enum MFTravelMode {\n car = 'car',\n bike = 'bike',\n foot = 'foot',\n motorcycle = 'motorcycle',\n}\n\nexport enum MFRouteWeighting {\n shortest = 'shortest',\n fastest = 'fastest',\n balance = 'balance',\n}\n\nexport enum MFLanguageResult {\n en = 'en',\n vi = 'vi',\n}\n\nexport enum MFRouteType {\n motorway = 'motorway',\n trunk = 'trunk',\n ferry = 'ferry',\n bridge = 'bridge',\n tunnel = 'tunnel',\n}\n\nexport type MFRouteRestriction = {\n location?: MFLocationComponent,\n radius?: number,\n viewbox?: MFViewboxComponent,\n path?: MFLocationComponent[],\n types?: MFRouteType[] | string[]\n}\n\nexport type MFSuggestionParams = {\n text: string,\n location?: MFLocationComponent,\n acronym?: boolean,\n}\n\nexport type MFTextSearchParams = {\n text: string,\n types?: string[],\n datetime?: number,\n location?: MFLocationComponent,\n}\n\nexport type MFNearbySearchParams = {\n location: MFLocationComponent,\n radius: number,\n text?: string,\n types?: string[],\n tags?: string[],\n datetime?: number,\n}\n\nexport type MFViewboxSearchParams = {\n viewbox: MFViewboxComponent,\n text?: string,\n types?: string[],\n tags?: string[],\n datetime?: number,\n}\n\nexport type MFGeocodeParams = {\n location?: MFLocationComponent,\n address?: string,\n viewbox?: MFViewboxComponent,\n}\n\nexport type MFDirectionsParams = {\n origin: MFLocationComponent,\n destination: MFLocationComponent,\n waypoints?: MFLocationComponent[],\n mode?: MFTravelMode | string,\n weighting?: MFRouteWeighting | string,\n language?: MFLanguageResult | string,\n restriction?: MFRouteRestriction,\n}\n\nexport type MFDistanceMatrixParams = {\n origins: MFLocationComponent[],\n destinations: MFLocationComponent[],\n mode?: MFTravelMode | string,\n weighting?: MFRouteWeighting | string,\n language?: MFLanguageResult | string,\n restriction?: MFRouteRestriction,\n}\n\nexport function fetchSuggestion(params: MFSuggestionParams): Promise<any> {\n return Map4dServices.fetchSuggestion(params);\n}\n\nexport function fetchPlaceDetail(placeId: string): Promise<any> {\n return Map4dServices.fetchPlaceDetail(placeId);\n}\n\nexport function fetchTextSearch(params: MFTextSearchParams): Promise<any> {\n return Map4dServices.fetchTextSearch(params);\n}\n\nexport function fetchNearbySearch(params: MFNearbySearchParams): Promise<any> {\n return Map4dServices.fetchNearbySearch(params);\n}\n\nexport function fetchViewboxSearch(params: MFViewboxSearchParams): Promise<any> {\n return Map4dServices.fetchViewboxSearch(params);\n}\n\nexport function fetchGeocode(params: MFGeocodeParams): Promise<any> {\n return Map4dServices.fetchGeocode(params);\n}\n\nexport function fetchDirections(params: MFDirectionsParams): Promise<any> {\n return Map4dServices.fetchDirections(params);\n}\n\nexport function fetchDistanceMatrix(params: MFDistanceMatrixParams): Promise<any> {\n return Map4dServices.fetchDistanceMatrix(params);\n}\n"]}
@@ -1,111 +1,94 @@
1
- export declare type MFLocationComponent = {
2
- latitude: number;
3
- longitude: number;
4
- alias?: string;
5
- };
6
- export declare type MFViewboxComponent = {
7
- southwest: MFLocationComponent;
8
- northeast: MFLocationComponent;
9
- };
10
- export declare enum MFTravelMode {
11
- car = "car",
12
- bike = "bike",
13
- foot = "foot",
14
- motorcycle = "motorcycle"
15
- }
16
- export declare enum MFRouteWeighting {
17
- shortest = "shortest",
18
- fastest = "fastest",
19
- balance = "balance"
20
- }
21
- export declare enum MFLanguageResult {
22
- en = "en",
23
- vi = "vi"
24
- }
25
- export declare enum MFRouteType {
26
- motorway = "motorway",
27
- trunk = "trunk",
28
- ferry = "ferry",
29
- bridge = "bridge",
30
- tunnel = "tunnel"
31
- }
32
- export declare type MFRouteRestriction = {
33
- location?: MFLocationComponent;
34
- radius?: number;
35
- viewbox?: MFViewboxComponent;
36
- path?: MFLocationComponent[];
37
- types?: MFRouteType[] | string[];
38
- };
39
- export declare type MFSuggestionParams = {
40
- text: string;
41
- location?: MFLocationComponent;
42
- acronym?: boolean;
43
- };
44
- export declare type MFTextSearchParams = {
45
- text: string;
46
- types?: string[];
47
- datetime?: number;
48
- location?: MFLocationComponent;
49
- };
50
- export declare type MFNearbySearchParams = {
51
- location: MFLocationComponent;
52
- radius: number;
53
- text?: string;
54
- types?: string[];
55
- tags?: string[];
56
- datetime?: number;
57
- };
58
- export declare type MFViewboxSearchParams = {
59
- viewbox: MFViewboxComponent;
60
- text?: string;
61
- types?: string[];
62
- tags?: string[];
63
- datetime?: number;
64
- };
65
- export declare type MFGeocodeParams = {
66
- location?: MFLocationComponent;
67
- address?: string;
68
- viewbox?: MFViewboxComponent;
69
- };
70
- export declare type MFDirectionsParams = {
71
- origin: MFLocationComponent;
72
- destination: MFLocationComponent;
73
- waypoints?: MFLocationComponent[];
74
- mode?: MFTravelMode | string;
75
- weighting?: MFRouteWeighting | string;
76
- language?: MFLanguageResult | string;
77
- restriction?: MFRouteRestriction;
78
- };
79
- export declare type MFRouteETAParams = {
80
- origins: MFLocationComponent[];
81
- destination: MFLocationComponent;
82
- mode?: MFTravelMode | string;
83
- weighting?: MFRouteWeighting | string;
84
- language?: MFLanguageResult | string;
85
- restriction?: MFRouteRestriction;
86
- };
87
- export declare type MFDistanceMatrixParams = {
88
- origins: MFLocationComponent[];
89
- destinations: MFLocationComponent[];
90
- mode?: MFTravelMode | string;
91
- weighting?: MFRouteWeighting | string;
92
- language?: MFLanguageResult | string;
93
- restriction?: MFRouteRestriction;
94
- };
95
- export declare type MFGraphRouteParams = {
96
- locations: MFLocationComponent[];
97
- mode?: MFTravelMode | string;
98
- weighting?: MFRouteWeighting | string;
99
- language?: MFLanguageResult | string;
100
- restriction?: MFRouteRestriction;
101
- };
102
- export declare function fetchSuggestion(params: MFSuggestionParams): Promise<any>;
103
- export declare function fetchPlaceDetail(placeId: string): Promise<any>;
104
- export declare function fetchTextSearch(params: MFTextSearchParams): Promise<any>;
105
- export declare function fetchNearbySearch(params: MFNearbySearchParams): Promise<any>;
106
- export declare function fetchViewboxSearch(params: MFViewboxSearchParams): Promise<any>;
107
- export declare function fetchGeocode(params: MFGeocodeParams): Promise<any>;
108
- export declare function fetchDirections(params: MFDirectionsParams): Promise<any>;
109
- export declare function fetchRouteETA(params: MFRouteETAParams): Promise<any>;
110
- export declare function fetchDistanceMatrix(params: MFDistanceMatrixParams): Promise<any>;
111
- export declare function fetchGraphRoute(params: MFGraphRouteParams): Promise<any>;
1
+ export declare type MFLocationComponent = {
2
+ latitude: number;
3
+ longitude: number;
4
+ alias?: string;
5
+ };
6
+ export declare type MFViewboxComponent = {
7
+ southwest: MFLocationComponent;
8
+ northeast: MFLocationComponent;
9
+ };
10
+ export declare enum MFTravelMode {
11
+ car = "car",
12
+ bike = "bike",
13
+ foot = "foot",
14
+ motorcycle = "motorcycle"
15
+ }
16
+ export declare enum MFRouteWeighting {
17
+ shortest = "shortest",
18
+ fastest = "fastest",
19
+ balance = "balance"
20
+ }
21
+ export declare enum MFLanguageResult {
22
+ en = "en",
23
+ vi = "vi"
24
+ }
25
+ export declare enum MFRouteType {
26
+ motorway = "motorway",
27
+ trunk = "trunk",
28
+ ferry = "ferry",
29
+ bridge = "bridge",
30
+ tunnel = "tunnel"
31
+ }
32
+ export declare type MFRouteRestriction = {
33
+ location?: MFLocationComponent;
34
+ radius?: number;
35
+ viewbox?: MFViewboxComponent;
36
+ path?: MFLocationComponent[];
37
+ types?: MFRouteType[] | string[];
38
+ };
39
+ export declare type MFSuggestionParams = {
40
+ text: string;
41
+ location?: MFLocationComponent;
42
+ acronym?: boolean;
43
+ };
44
+ export declare type MFTextSearchParams = {
45
+ text: string;
46
+ types?: string[];
47
+ datetime?: number;
48
+ location?: MFLocationComponent;
49
+ };
50
+ export declare type MFNearbySearchParams = {
51
+ location: MFLocationComponent;
52
+ radius: number;
53
+ text?: string;
54
+ types?: string[];
55
+ tags?: string[];
56
+ datetime?: number;
57
+ };
58
+ export declare type MFViewboxSearchParams = {
59
+ viewbox: MFViewboxComponent;
60
+ text?: string;
61
+ types?: string[];
62
+ tags?: string[];
63
+ datetime?: number;
64
+ };
65
+ export declare type MFGeocodeParams = {
66
+ location?: MFLocationComponent;
67
+ address?: string;
68
+ viewbox?: MFViewboxComponent;
69
+ };
70
+ export declare type MFDirectionsParams = {
71
+ origin: MFLocationComponent;
72
+ destination: MFLocationComponent;
73
+ waypoints?: MFLocationComponent[];
74
+ mode?: MFTravelMode | string;
75
+ weighting?: MFRouteWeighting | string;
76
+ language?: MFLanguageResult | string;
77
+ restriction?: MFRouteRestriction;
78
+ };
79
+ export declare type MFDistanceMatrixParams = {
80
+ origins: MFLocationComponent[];
81
+ destinations: MFLocationComponent[];
82
+ mode?: MFTravelMode | string;
83
+ weighting?: MFRouteWeighting | string;
84
+ language?: MFLanguageResult | string;
85
+ restriction?: MFRouteRestriction;
86
+ };
87
+ export declare function fetchSuggestion(params: MFSuggestionParams): Promise<any>;
88
+ export declare function fetchPlaceDetail(placeId: string): Promise<any>;
89
+ export declare function fetchTextSearch(params: MFTextSearchParams): Promise<any>;
90
+ export declare function fetchNearbySearch(params: MFNearbySearchParams): Promise<any>;
91
+ export declare function fetchViewboxSearch(params: MFViewboxSearchParams): Promise<any>;
92
+ export declare function fetchGeocode(params: MFGeocodeParams): Promise<any>;
93
+ export declare function fetchDirections(params: MFDirectionsParams): Promise<any>;
94
+ export declare function fetchDistanceMatrix(params: MFDistanceMatrixParams): Promise<any>;