react-native-map4d-services 0.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/LICENSE +21 -0
- package/README.md +24 -0
- package/android/.gradle/7.1.1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.1.1/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.1.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.1.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.1.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.1.1/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/build.gradle +59 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/reactnativemap4dservices/Map4dServicesModule.java +34 -0
- package/android/src/main/java/com/reactnativemap4dservices/Map4dServicesPackage.java +28 -0
- package/ios/.DS_Store +0 -0
- package/ios/Map4dServices.h +5 -0
- package/ios/Map4dServices.m +81 -0
- package/ios/Map4dServices.xcodeproj/project.pbxproj +282 -0
- package/ios/Map4dServices.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -0
- package/ios/RCTConvert+Services.h +33 -0
- package/ios/RCTConvert+Services.m +146 -0
- package/ios/SClient.h +23 -0
- package/ios/SClient.m +47 -0
- package/ios/SRequest.h +40 -0
- package/ios/SRequest.m +143 -0
- package/lib/commonjs/index.js +107 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/index.js +76 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/index.d.ts +111 -0
- package/package.json +150 -0
- package/react-native-map4d-services.podspec +20 -0
- package/src/index.tsx +175 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RCTConvert+Services.m
|
|
3
|
+
// react-native-map4d-services
|
|
4
|
+
//
|
|
5
|
+
// Created by Huy Dang on 26/01/2022.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <React/RCTConvert+CoreLocation.h>
|
|
9
|
+
#import "RCTConvert+Services.h"
|
|
10
|
+
|
|
11
|
+
@implementation RCTConvert (Services)
|
|
12
|
+
|
|
13
|
+
+ (MFLocationComponent *)MFLocationComponent:(id)json {
|
|
14
|
+
if (json == nil) {
|
|
15
|
+
return nil;
|
|
16
|
+
}
|
|
17
|
+
CLLocationCoordinate2D coordinate = [RCTConvert CLLocationCoordinate2D:json];
|
|
18
|
+
return [[MFLocationComponent alloc] initWithCoordinate:coordinate alias:json[@"alias"]];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
RCT_ARRAY_CONVERTER(MFLocationComponent);
|
|
22
|
+
|
|
23
|
+
+ (MFViewboxComponent *)MFViewboxComponent:(id)json {
|
|
24
|
+
if (json == nil) {
|
|
25
|
+
return nil;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
MFLocationComponent *southwest = [RCTConvert MFLocationComponent:json[@"southwest"]];
|
|
29
|
+
MFLocationComponent *northeast = [RCTConvert MFLocationComponent:json[@"northeast"]];
|
|
30
|
+
return [[MFViewboxComponent alloc] initWithSouthwest:southwest.coordinate northeast:northeast.coordinate];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
+ (MFRouteRestriction *)MFRouteRestriction:(id)json {
|
|
34
|
+
if (json == nil) {
|
|
35
|
+
return nil;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
MFLocationComponent *location = [RCTConvert MFLocationComponent:json[@"location"]];
|
|
39
|
+
NSUInteger radius = json[@"radius"] != nil ? [RCTConvert NSUInteger:json[@"radius"]] : 0;
|
|
40
|
+
MFViewboxComponent *viewbox = [RCTConvert MFViewboxComponent:json[@"viewbox"]];
|
|
41
|
+
NSArray<MFLocationComponent *> *path = [RCTConvert MFLocationComponentArray:json[@"path"]];
|
|
42
|
+
NSArray<NSString *> *types = [RCTConvert NSStringArray:json[@"types"]];
|
|
43
|
+
|
|
44
|
+
MFRouteRestriction *result = nil;
|
|
45
|
+
if (location != nil) {
|
|
46
|
+
result = [[MFRouteRestriction alloc] initWithLocation:location radius:radius];
|
|
47
|
+
}
|
|
48
|
+
else if (viewbox != nil) {
|
|
49
|
+
result = [[MFRouteRestriction alloc] initWithViewbox:viewbox];
|
|
50
|
+
}
|
|
51
|
+
else if (path != nil) {
|
|
52
|
+
result = [[MFRouteRestriction alloc] initWithPath:path];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (types != nil && types.count > 0) {
|
|
56
|
+
if (result != nil) {
|
|
57
|
+
for (NSUInteger i = 0; i < types.count; i++) {
|
|
58
|
+
if ([RCTConvert isMFRouteType:types[i]]) {
|
|
59
|
+
[result avoidRouteType:[RCTConvert MFRouteType:types[i]]];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
result = [[MFRouteRestriction alloc] initWithRouteType:[RCTConvert MFRouteType:types[0]]];
|
|
65
|
+
for (NSUInteger i = 1; i < types.count; i++) {
|
|
66
|
+
if ([RCTConvert isMFRouteType:types[i]]) {
|
|
67
|
+
[result avoidRouteType:[RCTConvert MFRouteType:types[i]]];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return result;
|
|
74
|
+
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
+ (MFTravelMode)MFTravelMode:(id)json {
|
|
78
|
+
NSString *mode = [RCTConvert NSString:json];
|
|
79
|
+
if ([@"motorcycle" isEqualToString:mode]) {
|
|
80
|
+
return MFTravelModeMotorcycle;
|
|
81
|
+
}
|
|
82
|
+
else if ([@"foot" isEqualToString:mode]) {
|
|
83
|
+
return MFTravelModeFoot;
|
|
84
|
+
}
|
|
85
|
+
else if ([@"bike" isEqualToString:mode]) {
|
|
86
|
+
return MFTravelModeBike;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
return MFTravelModeCar;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
+ (MFRouteWeighting)MFRouteWeighting:(id)json {
|
|
94
|
+
NSString *weighting = [RCTConvert NSString:json];
|
|
95
|
+
if ([@"shortest" isEqualToString:weighting]) {
|
|
96
|
+
return MFRouteWeightingShortest;
|
|
97
|
+
}
|
|
98
|
+
else if ([@"balance" isEqualToString:weighting]) {
|
|
99
|
+
return MFRouteWeightingBalance;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
return MFRouteWeightingFastest;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
+ (MFLanguageResult)MFLanguageResult:(id)json {
|
|
107
|
+
NSString *language = [RCTConvert NSString:json];
|
|
108
|
+
if ([@"en" isEqualToString:language]) {
|
|
109
|
+
return MFLanguageResultEnglish;
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
return MFLanguageResultVietnamese;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
+ (BOOL)isMFRouteType:(NSString *)type {
|
|
117
|
+
if ([@"motorway" isEqualToString:type] ||
|
|
118
|
+
[@"trunk" isEqualToString:type] ||
|
|
119
|
+
[@"ferry" isEqualToString:type] ||
|
|
120
|
+
[@"bridge" isEqualToString:type] ||
|
|
121
|
+
[@"tunnel" isEqualToString:type]) {
|
|
122
|
+
return YES;
|
|
123
|
+
}
|
|
124
|
+
return NO;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
+ (MFRouteType)MFRouteType:(NSString *)type {
|
|
128
|
+
if ([@"motorway" isEqualToString:type]) {
|
|
129
|
+
return MFRouteTypeMotorway;
|
|
130
|
+
}
|
|
131
|
+
else if ([@"trunk" isEqualToString:type]) {
|
|
132
|
+
return MFRouteTypeTrunk;
|
|
133
|
+
}
|
|
134
|
+
else if ([@"ferry" isEqualToString:type]) {
|
|
135
|
+
return MFRouteTypeFerry;
|
|
136
|
+
}
|
|
137
|
+
else if ([@"bridge" isEqualToString:type]) {
|
|
138
|
+
return MFRouteTypeBridge;
|
|
139
|
+
}
|
|
140
|
+
else if ([@"tunnel" isEqualToString:type]) {
|
|
141
|
+
return MFRouteTypeTunnel;
|
|
142
|
+
}
|
|
143
|
+
return 0;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@end
|
package/ios/SClient.h
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// SClient.h
|
|
3
|
+
// react-native-map4d-services
|
|
4
|
+
//
|
|
5
|
+
// Created by Huy Dang on 26/01/2022.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#ifndef SClient_h
|
|
9
|
+
#define SClient_h
|
|
10
|
+
|
|
11
|
+
#import <React/RCTBridgeModule.h>
|
|
12
|
+
#import <Map4dServices/Map4dServices.h>
|
|
13
|
+
|
|
14
|
+
@interface SClient : NSObject
|
|
15
|
+
|
|
16
|
+
+ (void)fireRequest:(MFServiceRequest *)request
|
|
17
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
18
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
19
|
+
|
|
20
|
+
@end
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
#endif /* SClient_h */
|
package/ios/SClient.m
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//
|
|
2
|
+
// SClient.m
|
|
3
|
+
// react-native-map4d-services
|
|
4
|
+
//
|
|
5
|
+
// Created by Huy Dang on 26/01/2022.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import "SClient.h"
|
|
9
|
+
|
|
10
|
+
@implementation SClient
|
|
11
|
+
|
|
12
|
+
static MFServices *_services = nil;
|
|
13
|
+
|
|
14
|
+
+ (MFServices *)services {
|
|
15
|
+
if (_services == nil) {
|
|
16
|
+
_services = [[MFServices alloc] init];
|
|
17
|
+
}
|
|
18
|
+
return _services;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
+ (void)fireRequest:(MFServiceRequest *)request
|
|
22
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
23
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
24
|
+
[SClient.services dataTaskWithRequest:request
|
|
25
|
+
completionHandler:^(NSData * _Nullable data, id<MFServiceError> _Nullable error) {
|
|
26
|
+
if (error != nil) {
|
|
27
|
+
resolve(@{
|
|
28
|
+
@"code": error.code,
|
|
29
|
+
@"message": error.message
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
NSError *parseError = nil;
|
|
34
|
+
NSDictionary *dictionary = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&parseError];
|
|
35
|
+
|
|
36
|
+
if (parseError != nil) {
|
|
37
|
+
resolve(@{
|
|
38
|
+
@"code": [NSString stringWithFormat:@"%ld", parseError.code],
|
|
39
|
+
@"message": parseError.localizedDescription
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
resolve(dictionary);
|
|
44
|
+
}];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@end
|
package/ios/SRequest.h
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//
|
|
2
|
+
// SRequest.h
|
|
3
|
+
// react-native-map4d-services
|
|
4
|
+
//
|
|
5
|
+
// Created by Huy Dang on 26/01/2022.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#ifndef SRequest_h
|
|
9
|
+
#define SRequest_h
|
|
10
|
+
|
|
11
|
+
#import <Foundation/Foundation.h>
|
|
12
|
+
|
|
13
|
+
@class MFServiceRequest;
|
|
14
|
+
|
|
15
|
+
@interface SRequest : NSObject
|
|
16
|
+
|
|
17
|
+
+ (MFServiceRequest *)buildGeocodingRequestWithData:(NSDictionary *)data;
|
|
18
|
+
|
|
19
|
+
+ (MFServiceRequest *)buildPlaceDetailRequestWithId:(NSString *)placeId;
|
|
20
|
+
|
|
21
|
+
+ (MFServiceRequest *)buildTextSearchRequestWithData:(NSDictionary *)data;
|
|
22
|
+
|
|
23
|
+
+ (MFServiceRequest *)buildNearbySearchRequestWithData:(NSDictionary *)data;
|
|
24
|
+
|
|
25
|
+
+ (MFServiceRequest *)buildViewboxSearchRequestWithData:(NSDictionary *)data;
|
|
26
|
+
|
|
27
|
+
+ (MFServiceRequest *)buildSuggestionsRequestWithData:(NSDictionary *)data;
|
|
28
|
+
|
|
29
|
+
+ (MFServiceRequest *)buildDirectionsRequestWithData:(NSDictionary *)data;
|
|
30
|
+
|
|
31
|
+
+ (MFServiceRequest *)buildRouteETARequestWithData:(NSDictionary *)data;
|
|
32
|
+
|
|
33
|
+
+ (MFServiceRequest *)buildDistanceMatrixRequestWithData:(NSDictionary *)data;
|
|
34
|
+
|
|
35
|
+
+ (MFServiceRequest *)buildGraphRouteRequestWithData:(NSDictionary *)data;
|
|
36
|
+
|
|
37
|
+
@end
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
#endif /* SRequest_h */
|
package/ios/SRequest.m
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
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 "RCTConvert+Services.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 = [RCTConvert MFLocationComponent:data[@"location"]];
|
|
19
|
+
params.viewbox = [RCTConvert 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
|
+
|
|
36
|
+
params.types = data[@"types"];
|
|
37
|
+
params.location = [RCTConvert MFLocationComponent:data[@"location"]];
|
|
38
|
+
params.datetime = [RCTConvert NSDate:data[@"datetime"]];
|
|
39
|
+
|
|
40
|
+
request.params = params;
|
|
41
|
+
return request;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
+ (MFServiceRequest *)buildNearbySearchRequestWithData:(NSDictionary *)data {
|
|
45
|
+
MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/place/nearby-search"];
|
|
46
|
+
MFNearbySearchParams *params = [[MFNearbySearchParams alloc] initWithLocation:[RCTConvert MFLocationComponent:data[@"location"]]
|
|
47
|
+
radius:[RCTConvert NSUInteger:data[@"radius"]]
|
|
48
|
+
text:data[@"text"]];
|
|
49
|
+
params.types = data[@"types"];
|
|
50
|
+
params.tags = data[@"tags"];
|
|
51
|
+
params.datetime = [RCTConvert NSDate:data[@"datetime"]];
|
|
52
|
+
|
|
53
|
+
request.params = params;
|
|
54
|
+
return request;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
+ (MFServiceRequest *)buildViewboxSearchRequestWithData:(NSDictionary *)data {
|
|
58
|
+
MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/place/viewbox-search"];
|
|
59
|
+
MFViewboxSearchParams *params = [[MFViewboxSearchParams alloc] initWithViewbox:[RCTConvert MFViewboxComponent:data[@"viewbox"]]
|
|
60
|
+
text:data[@"text"]];
|
|
61
|
+
params.types = data[@"types"];
|
|
62
|
+
params.tags = data[@"tags"];
|
|
63
|
+
params.datetime = [RCTConvert NSDate:data[@"datetime"]];
|
|
64
|
+
|
|
65
|
+
request.params = params;
|
|
66
|
+
return request;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
+ (MFServiceRequest *)buildSuggestionsRequestWithData:(NSDictionary *)data {
|
|
70
|
+
MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/autosuggest"];
|
|
71
|
+
MFSuggestionParams *params = [[MFSuggestionParams alloc] initWithText:data[@"text"]];
|
|
72
|
+
params.acronym = [RCTConvert BOOL:data[@"acronym"]];
|
|
73
|
+
params.location = [RCTConvert MFLocationComponent:data[@"location"]];
|
|
74
|
+
|
|
75
|
+
request.params = params;
|
|
76
|
+
return request;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
#pragma mark - Route
|
|
80
|
+
|
|
81
|
+
+ (MFServiceRequest *)buildDirectionsRequestWithData:(NSDictionary *)data {
|
|
82
|
+
MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/route"];
|
|
83
|
+
|
|
84
|
+
MFLocationComponent *origin = [RCTConvert MFLocationComponent:data[@"origin"]];
|
|
85
|
+
MFLocationComponent *destination = [RCTConvert MFLocationComponent:data[@"destination"]];
|
|
86
|
+
MFDirectionsParams *params = [[MFDirectionsParams alloc] initWithOrigin:origin destination:destination];
|
|
87
|
+
params.waypoints = [RCTConvert MFLocationComponentArray:data[@"points"]];
|
|
88
|
+
params.mode = [RCTConvert MFTravelMode:data[@"mode"]];
|
|
89
|
+
params.language = [RCTConvert MFLanguageResult:data[@"language"]];
|
|
90
|
+
params.weighting = [RCTConvert MFRouteWeighting:data[@"weighting"]];
|
|
91
|
+
params.avoid = [RCTConvert MFRouteRestriction:data[@"avoid"]];
|
|
92
|
+
|
|
93
|
+
request.params = params;
|
|
94
|
+
return request;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
+ (MFServiceRequest *)buildRouteETARequestWithData:(NSDictionary *)data {
|
|
98
|
+
MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/route/eta"];
|
|
99
|
+
|
|
100
|
+
NSArray<MFLocationComponent *> *origins = [RCTConvert MFLocationComponentArray:data[@"origins"]];
|
|
101
|
+
MFLocationComponent *destination = [RCTConvert MFLocationComponent:data[@"destination"]];
|
|
102
|
+
MFRouteETAParams *params = [[MFRouteETAParams alloc] initWithOrigins:origins destination:destination];
|
|
103
|
+
params.mode = [RCTConvert MFTravelMode:data[@"mode"]];
|
|
104
|
+
params.language = [RCTConvert MFLanguageResult:data[@"language"]];
|
|
105
|
+
params.weighting = [RCTConvert MFRouteWeighting:data[@"weighting"]];
|
|
106
|
+
params.avoid = [RCTConvert MFRouteRestriction:data[@"avoid"]];
|
|
107
|
+
|
|
108
|
+
request.params = params;
|
|
109
|
+
request.method = MFRequestMethodPost;
|
|
110
|
+
return request;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
+ (MFServiceRequest *)buildDistanceMatrixRequestWithData:(NSDictionary *)data {
|
|
114
|
+
MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/route/matrix"];
|
|
115
|
+
|
|
116
|
+
NSArray<MFLocationComponent *> *origins = [RCTConvert MFLocationComponentArray:data[@"origins"]];
|
|
117
|
+
NSArray<MFLocationComponent *> *destinations = [RCTConvert MFLocationComponentArray:data[@"destinations"]];
|
|
118
|
+
MFDistanceMatrixParams *params = [[MFDistanceMatrixParams alloc] initWithOrigins:origins destinations:destinations];
|
|
119
|
+
params.mode = [RCTConvert MFTravelMode:data[@"mode"]];
|
|
120
|
+
params.language = [RCTConvert MFLanguageResult:data[@"language"]];
|
|
121
|
+
params.weighting = [RCTConvert MFRouteWeighting:data[@"weighting"]];
|
|
122
|
+
params.avoid = [RCTConvert MFRouteRestriction:data[@"avoid"]];
|
|
123
|
+
|
|
124
|
+
request.params = params;
|
|
125
|
+
return request;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
+ (MFServiceRequest *)buildGraphRouteRequestWithData:(NSDictionary *)data {
|
|
129
|
+
MFServiceRequest *request = [[MFServiceRequest alloc] initWithPath:@"/sdk/route/graph"];
|
|
130
|
+
|
|
131
|
+
NSArray<MFLocationComponent *> *points = [RCTConvert MFLocationComponentArray:data[@"locations"]];
|
|
132
|
+
MFGraphRouteParams *params = [[MFGraphRouteParams alloc] initWithLocations:points];
|
|
133
|
+
params.mode = [RCTConvert MFTravelMode:data[@"mode"]];
|
|
134
|
+
params.language = [RCTConvert MFLanguageResult:data[@"language"]];
|
|
135
|
+
params.weighting = [RCTConvert MFRouteWeighting:data[@"weighting"]];
|
|
136
|
+
params.avoid = [RCTConvert MFRouteRestriction:data[@"avoid"]];
|
|
137
|
+
|
|
138
|
+
request.params = params;
|
|
139
|
+
return request;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@end
|
|
143
|
+
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MFTravelMode = exports.MFRouteWeighting = exports.MFRouteType = exports.MFLanguageResult = void 0;
|
|
7
|
+
exports.fetchDirections = fetchDirections;
|
|
8
|
+
exports.fetchDistanceMatrix = fetchDistanceMatrix;
|
|
9
|
+
exports.fetchGeocode = fetchGeocode;
|
|
10
|
+
exports.fetchGraphRoute = fetchGraphRoute;
|
|
11
|
+
exports.fetchNearbySearch = fetchNearbySearch;
|
|
12
|
+
exports.fetchPlaceDetail = fetchPlaceDetail;
|
|
13
|
+
exports.fetchRouteETA = fetchRouteETA;
|
|
14
|
+
exports.fetchSuggestion = fetchSuggestion;
|
|
15
|
+
exports.fetchTextSearch = fetchTextSearch;
|
|
16
|
+
exports.fetchViewboxSearch = fetchViewboxSearch;
|
|
17
|
+
|
|
18
|
+
var _reactNative = require("react-native");
|
|
19
|
+
|
|
20
|
+
const LINKING_ERROR = `The package 'react-native-map4d-services' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
21
|
+
ios: "- You have run 'pod install'\n",
|
|
22
|
+
default: ''
|
|
23
|
+
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
|
|
24
|
+
const Map4dServices = _reactNative.NativeModules.Map4dServices ? _reactNative.NativeModules.Map4dServices : new Proxy({}, {
|
|
25
|
+
get() {
|
|
26
|
+
throw new Error(LINKING_ERROR);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
});
|
|
30
|
+
let MFTravelMode;
|
|
31
|
+
exports.MFTravelMode = MFTravelMode;
|
|
32
|
+
|
|
33
|
+
(function (MFTravelMode) {
|
|
34
|
+
MFTravelMode["car"] = "car";
|
|
35
|
+
MFTravelMode["bike"] = "bike";
|
|
36
|
+
MFTravelMode["foot"] = "foot";
|
|
37
|
+
MFTravelMode["motorcycle"] = "motorcycle";
|
|
38
|
+
})(MFTravelMode || (exports.MFTravelMode = MFTravelMode = {}));
|
|
39
|
+
|
|
40
|
+
let MFRouteWeighting;
|
|
41
|
+
exports.MFRouteWeighting = MFRouteWeighting;
|
|
42
|
+
|
|
43
|
+
(function (MFRouteWeighting) {
|
|
44
|
+
MFRouteWeighting["shortest"] = "shortest";
|
|
45
|
+
MFRouteWeighting["fastest"] = "fastest";
|
|
46
|
+
MFRouteWeighting["balance"] = "balance";
|
|
47
|
+
})(MFRouteWeighting || (exports.MFRouteWeighting = MFRouteWeighting = {}));
|
|
48
|
+
|
|
49
|
+
let MFLanguageResult;
|
|
50
|
+
exports.MFLanguageResult = MFLanguageResult;
|
|
51
|
+
|
|
52
|
+
(function (MFLanguageResult) {
|
|
53
|
+
MFLanguageResult["en"] = "en";
|
|
54
|
+
MFLanguageResult["vi"] = "vi";
|
|
55
|
+
})(MFLanguageResult || (exports.MFLanguageResult = MFLanguageResult = {}));
|
|
56
|
+
|
|
57
|
+
let MFRouteType;
|
|
58
|
+
exports.MFRouteType = MFRouteType;
|
|
59
|
+
|
|
60
|
+
(function (MFRouteType) {
|
|
61
|
+
MFRouteType["motorway"] = "motorway";
|
|
62
|
+
MFRouteType["trunk"] = "trunk";
|
|
63
|
+
MFRouteType["ferry"] = "ferry";
|
|
64
|
+
MFRouteType["bridge"] = "bridge";
|
|
65
|
+
MFRouteType["tunnel"] = "tunnel";
|
|
66
|
+
})(MFRouteType || (exports.MFRouteType = MFRouteType = {}));
|
|
67
|
+
|
|
68
|
+
function fetchSuggestion(params) {
|
|
69
|
+
return Map4dServices.fetchSuggestion(params);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function fetchPlaceDetail(placeId) {
|
|
73
|
+
return Map4dServices.fetchPlaceDetail(placeId);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function fetchTextSearch(params) {
|
|
77
|
+
return Map4dServices.fetchTextSearch(params);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function fetchNearbySearch(params) {
|
|
81
|
+
return Map4dServices.fetchNearbySearch(params);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function fetchViewboxSearch(params) {
|
|
85
|
+
return Map4dServices.fetchViewboxSearch(params);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function fetchGeocode(params) {
|
|
89
|
+
return Map4dServices.fetchGeocode(params);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function fetchDirections(params) {
|
|
93
|
+
return Map4dServices.fetchDirections(params);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function fetchRouteETA(params) {
|
|
97
|
+
return Map4dServices.fetchRouteETA(params);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function fetchDistanceMatrix(params) {
|
|
101
|
+
return Map4dServices.fetchDistanceMatrix(params);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function fetchGraphRoute(params) {
|
|
105
|
+
return Map4dServices.fetchGraphRoute(params);
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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,6CAJF;AAMA,MAAMC,aAAa,GAAGC,2BAAcD,aAAd,GAClBC,2BAAcD,aADI,GAElB,IAAIE,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUT,aAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;IAsBYU,Y;;;WAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;GAAAA,Y,4BAAAA,Y;;IAOAC,gB;;;WAAAA,gB;AAAAA,EAAAA,gB;AAAAA,EAAAA,gB;AAAAA,EAAAA,gB;GAAAA,gB,gCAAAA,gB;;IAMAC,gB;;;WAAAA,gB;AAAAA,EAAAA,gB;AAAAA,EAAAA,gB;GAAAA,gB,gCAAAA,gB;;IAKAC,W;;;WAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;GAAAA,W,2BAAAA,W;;AAwFL,SAASC,eAAT,CAAyBC,MAAzB,EAAsE;AAC3E,SAAOV,aAAa,CAACS,eAAd,CAA8BC,MAA9B,CAAP;AACD;;AAEM,SAASC,gBAAT,CAA0BC,OAA1B,EAA4D;AACjE,SAAOZ,aAAa,CAACW,gBAAd,CAA+BC,OAA/B,CAAP;AACD;;AAEM,SAASC,eAAT,CAAyBH,MAAzB,EAAsE;AAC3E,SAAOV,aAAa,CAACa,eAAd,CAA8BH,MAA9B,CAAP;AACD;;AAEM,SAASI,iBAAT,CAA2BJ,MAA3B,EAA0E;AAC/E,SAAOV,aAAa,CAACc,iBAAd,CAAgCJ,MAAhC,CAAP;AACD;;AAEM,SAASK,kBAAT,CAA4BL,MAA5B,EAA4E;AACjF,SAAOV,aAAa,CAACe,kBAAd,CAAiCL,MAAjC,CAAP;AACD;;AAEM,SAASM,YAAT,CAAsBN,MAAtB,EAAgE;AACrE,SAAOV,aAAa,CAACgB,YAAd,CAA2BN,MAA3B,CAAP;AACD;;AAEM,SAASO,eAAT,CAAyBP,MAAzB,EAAsE;AAC3E,SAAOV,aAAa,CAACiB,eAAd,CAA8BP,MAA9B,CAAP;AACD;;AAEM,SAASQ,aAAT,CAAuBR,MAAvB,EAAkE;AACvE,SAAOV,aAAa,CAACkB,aAAd,CAA4BR,MAA5B,CAAP;AACD;;AAEM,SAASS,mBAAT,CAA6BT,MAA7B,EAA8E;AACnF,SAAOV,aAAa,CAACmB,mBAAd,CAAkCT,MAAlC,CAAP;AACD;;AAEM,SAASU,eAAT,CAAyBV,MAAzB,EAAsE;AAC3E,SAAOV,aAAa,CAACoB,eAAd,CAA8BV,MAA9B,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?: Date,\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?: Date,\n}\n\nexport type MFViewboxSearchParams = {\n viewbox: MFViewboxComponent,\n text?: string,\n types?: string[],\n tags?: string[],\n datetime?: Date,\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 MFRouteETAParams = {\n origins: MFLocationComponent[],\n destination: 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 type MFGraphRouteParams = {\n locations: MFLocationComponent[],\n mode?: MFTravelMode | string,\n weighting?: MFRouteWeighting | string,\n language?: MFLanguageResult | string,\n restriction?: MFRouteRestriction,\n}\n\nexport function fetchSuggestion(params: MFSuggestionParams): Promise<object> {\n return Map4dServices.fetchSuggestion(params);\n}\n\nexport function fetchPlaceDetail(placeId: string): Promise<object> {\n return Map4dServices.fetchPlaceDetail(placeId);\n}\n\nexport function fetchTextSearch(params: MFTextSearchParams): Promise<object> {\n return Map4dServices.fetchTextSearch(params);\n}\n\nexport function fetchNearbySearch(params: MFNearbySearchParams): Promise<object> {\n return Map4dServices.fetchNearbySearch(params);\n}\n\nexport function fetchViewboxSearch(params: MFViewboxSearchParams): Promise<object> {\n return Map4dServices.fetchViewboxSearch(params);\n}\n\nexport function fetchGeocode(params: MFGeocodeParams): Promise<object> {\n return Map4dServices.fetchGeocode(params);\n}\n\nexport function fetchDirections(params: MFDirectionsParams): Promise<object> {\n return Map4dServices.fetchDirections(params);\n}\n\nexport function fetchRouteETA(params: MFRouteETAParams): Promise<object> {\n return Map4dServices.fetchRouteETA(params);\n}\n\nexport function fetchDistanceMatrix(params: MFDistanceMatrixParams): Promise<object> {\n return Map4dServices.fetchDistanceMatrix(params);\n}\n\nexport function fetchGraphRoute(params: MFGraphRouteParams): Promise<object> {\n return Map4dServices.fetchGraphRoute(params);\n}"]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { NativeModules, Platform } from 'react-native';
|
|
2
|
+
const LINKING_ERROR = `The package 'react-native-map4d-services' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
|
|
3
|
+
ios: "- You have run 'pod install'\n",
|
|
4
|
+
default: ''
|
|
5
|
+
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
|
|
6
|
+
const Map4dServices = NativeModules.Map4dServices ? NativeModules.Map4dServices : new Proxy({}, {
|
|
7
|
+
get() {
|
|
8
|
+
throw new Error(LINKING_ERROR);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
});
|
|
12
|
+
export let MFTravelMode;
|
|
13
|
+
|
|
14
|
+
(function (MFTravelMode) {
|
|
15
|
+
MFTravelMode["car"] = "car";
|
|
16
|
+
MFTravelMode["bike"] = "bike";
|
|
17
|
+
MFTravelMode["foot"] = "foot";
|
|
18
|
+
MFTravelMode["motorcycle"] = "motorcycle";
|
|
19
|
+
})(MFTravelMode || (MFTravelMode = {}));
|
|
20
|
+
|
|
21
|
+
export let MFRouteWeighting;
|
|
22
|
+
|
|
23
|
+
(function (MFRouteWeighting) {
|
|
24
|
+
MFRouteWeighting["shortest"] = "shortest";
|
|
25
|
+
MFRouteWeighting["fastest"] = "fastest";
|
|
26
|
+
MFRouteWeighting["balance"] = "balance";
|
|
27
|
+
})(MFRouteWeighting || (MFRouteWeighting = {}));
|
|
28
|
+
|
|
29
|
+
export let MFLanguageResult;
|
|
30
|
+
|
|
31
|
+
(function (MFLanguageResult) {
|
|
32
|
+
MFLanguageResult["en"] = "en";
|
|
33
|
+
MFLanguageResult["vi"] = "vi";
|
|
34
|
+
})(MFLanguageResult || (MFLanguageResult = {}));
|
|
35
|
+
|
|
36
|
+
export let MFRouteType;
|
|
37
|
+
|
|
38
|
+
(function (MFRouteType) {
|
|
39
|
+
MFRouteType["motorway"] = "motorway";
|
|
40
|
+
MFRouteType["trunk"] = "trunk";
|
|
41
|
+
MFRouteType["ferry"] = "ferry";
|
|
42
|
+
MFRouteType["bridge"] = "bridge";
|
|
43
|
+
MFRouteType["tunnel"] = "tunnel";
|
|
44
|
+
})(MFRouteType || (MFRouteType = {}));
|
|
45
|
+
|
|
46
|
+
export function fetchSuggestion(params) {
|
|
47
|
+
return Map4dServices.fetchSuggestion(params);
|
|
48
|
+
}
|
|
49
|
+
export function fetchPlaceDetail(placeId) {
|
|
50
|
+
return Map4dServices.fetchPlaceDetail(placeId);
|
|
51
|
+
}
|
|
52
|
+
export function fetchTextSearch(params) {
|
|
53
|
+
return Map4dServices.fetchTextSearch(params);
|
|
54
|
+
}
|
|
55
|
+
export function fetchNearbySearch(params) {
|
|
56
|
+
return Map4dServices.fetchNearbySearch(params);
|
|
57
|
+
}
|
|
58
|
+
export function fetchViewboxSearch(params) {
|
|
59
|
+
return Map4dServices.fetchViewboxSearch(params);
|
|
60
|
+
}
|
|
61
|
+
export function fetchGeocode(params) {
|
|
62
|
+
return Map4dServices.fetchGeocode(params);
|
|
63
|
+
}
|
|
64
|
+
export function fetchDirections(params) {
|
|
65
|
+
return Map4dServices.fetchDirections(params);
|
|
66
|
+
}
|
|
67
|
+
export function fetchRouteETA(params) {
|
|
68
|
+
return Map4dServices.fetchRouteETA(params);
|
|
69
|
+
}
|
|
70
|
+
export function fetchDistanceMatrix(params) {
|
|
71
|
+
return Map4dServices.fetchDistanceMatrix(params);
|
|
72
|
+
}
|
|
73
|
+
export function fetchGraphRoute(params) {
|
|
74
|
+
return Map4dServices.fetchGraphRoute(params);
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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;GAAAA,gB,KAAAA,gB;;AAKZ,WAAYC,WAAZ;;WAAYA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;GAAAA,W,KAAAA,W;;AAwFZ,OAAO,SAASC,eAAT,CAAyBC,MAAzB,EAAsE;AAC3E,SAAOT,aAAa,CAACQ,eAAd,CAA8BC,MAA9B,CAAP;AACD;AAED,OAAO,SAASC,gBAAT,CAA0BC,OAA1B,EAA4D;AACjE,SAAOX,aAAa,CAACU,gBAAd,CAA+BC,OAA/B,CAAP;AACD;AAED,OAAO,SAASC,eAAT,CAAyBH,MAAzB,EAAsE;AAC3E,SAAOT,aAAa,CAACY,eAAd,CAA8BH,MAA9B,CAAP;AACD;AAED,OAAO,SAASI,iBAAT,CAA2BJ,MAA3B,EAA0E;AAC/E,SAAOT,aAAa,CAACa,iBAAd,CAAgCJ,MAAhC,CAAP;AACD;AAED,OAAO,SAASK,kBAAT,CAA4BL,MAA5B,EAA4E;AACjF,SAAOT,aAAa,CAACc,kBAAd,CAAiCL,MAAjC,CAAP;AACD;AAED,OAAO,SAASM,YAAT,CAAsBN,MAAtB,EAAgE;AACrE,SAAOT,aAAa,CAACe,YAAd,CAA2BN,MAA3B,CAAP;AACD;AAED,OAAO,SAASO,eAAT,CAAyBP,MAAzB,EAAsE;AAC3E,SAAOT,aAAa,CAACgB,eAAd,CAA8BP,MAA9B,CAAP;AACD;AAED,OAAO,SAASQ,aAAT,CAAuBR,MAAvB,EAAkE;AACvE,SAAOT,aAAa,CAACiB,aAAd,CAA4BR,MAA5B,CAAP;AACD;AAED,OAAO,SAASS,mBAAT,CAA6BT,MAA7B,EAA8E;AACnF,SAAOT,aAAa,CAACkB,mBAAd,CAAkCT,MAAlC,CAAP;AACD;AAED,OAAO,SAASU,eAAT,CAAyBV,MAAzB,EAAsE;AAC3E,SAAOT,aAAa,CAACmB,eAAd,CAA8BV,MAA9B,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?: Date,\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?: Date,\n}\n\nexport type MFViewboxSearchParams = {\n viewbox: MFViewboxComponent,\n text?: string,\n types?: string[],\n tags?: string[],\n datetime?: Date,\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 MFRouteETAParams = {\n origins: MFLocationComponent[],\n destination: 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 type MFGraphRouteParams = {\n locations: MFLocationComponent[],\n mode?: MFTravelMode | string,\n weighting?: MFRouteWeighting | string,\n language?: MFLanguageResult | string,\n restriction?: MFRouteRestriction,\n}\n\nexport function fetchSuggestion(params: MFSuggestionParams): Promise<object> {\n return Map4dServices.fetchSuggestion(params);\n}\n\nexport function fetchPlaceDetail(placeId: string): Promise<object> {\n return Map4dServices.fetchPlaceDetail(placeId);\n}\n\nexport function fetchTextSearch(params: MFTextSearchParams): Promise<object> {\n return Map4dServices.fetchTextSearch(params);\n}\n\nexport function fetchNearbySearch(params: MFNearbySearchParams): Promise<object> {\n return Map4dServices.fetchNearbySearch(params);\n}\n\nexport function fetchViewboxSearch(params: MFViewboxSearchParams): Promise<object> {\n return Map4dServices.fetchViewboxSearch(params);\n}\n\nexport function fetchGeocode(params: MFGeocodeParams): Promise<object> {\n return Map4dServices.fetchGeocode(params);\n}\n\nexport function fetchDirections(params: MFDirectionsParams): Promise<object> {\n return Map4dServices.fetchDirections(params);\n}\n\nexport function fetchRouteETA(params: MFRouteETAParams): Promise<object> {\n return Map4dServices.fetchRouteETA(params);\n}\n\nexport function fetchDistanceMatrix(params: MFDistanceMatrixParams): Promise<object> {\n return Map4dServices.fetchDistanceMatrix(params);\n}\n\nexport function fetchGraphRoute(params: MFGraphRouteParams): Promise<object> {\n return Map4dServices.fetchGraphRoute(params);\n}"]}
|