react-native-map4d-services 0.1.0 → 1.0.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 -21
- package/README.md +24 -24
- package/android/build.gradle +60 -59
- package/android/src/main/AndroidManifest.xml +4 -4
- package/android/src/main/java/com/reactnativemap4dservices/Map4dServicesModule.java +91 -34
- package/android/src/main/java/com/reactnativemap4dservices/Map4dServicesPackage.java +28 -28
- package/android/src/main/java/com/reactnativemap4dservices/SClient.java +45 -0
- package/android/src/main/java/com/reactnativemap4dservices/SConverter.java +166 -0
- package/android/src/main/java/com/reactnativemap4dservices/SJsonUtils.java +130 -0
- package/android/src/main/java/com/reactnativemap4dservices/SRequest.java +376 -0
- package/ios/Map4dServices.h +5 -5
- package/ios/Map4dServices.m +81 -81
- package/ios/RCTConvert+Services.h +33 -33
- package/ios/RCTConvert+Services.m +146 -146
- package/ios/SClient.h +23 -23
- package/ios/SClient.m +47 -47
- package/ios/SRequest.h +40 -40
- package/ios/SRequest.m +143 -143
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/index.d.ts +111 -111
- package/package.json +150 -150
- package/react-native-map4d-services.podspec +20 -20
- package/src/index.tsx +174 -174
- 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 +0 -2
- 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/ios/.DS_Store +0 -0
- package/ios/Map4dServices.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -4
package/src/index.tsx
CHANGED
|
@@ -1,175 +1,175 @@
|
|
|
1
|
-
import { NativeModules, Platform } from 'react-native';
|
|
2
|
-
|
|
3
|
-
const LINKING_ERROR =
|
|
4
|
-
`The package 'react-native-map4d-services' doesn't seem to be linked. Make sure: \n\n` +
|
|
5
|
-
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
6
|
-
'- You rebuilt the app after installing the package\n' +
|
|
7
|
-
'- You are not using Expo managed workflow\n';
|
|
8
|
-
|
|
9
|
-
const Map4dServices = NativeModules.Map4dServices
|
|
10
|
-
? NativeModules.Map4dServices
|
|
11
|
-
: new Proxy(
|
|
12
|
-
{},
|
|
13
|
-
{
|
|
14
|
-
get() {
|
|
15
|
-
throw new Error(LINKING_ERROR);
|
|
16
|
-
},
|
|
17
|
-
}
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
export type MFLocationComponent = {
|
|
21
|
-
latitude: number,
|
|
22
|
-
longitude: number,
|
|
23
|
-
alias?: string,
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export type MFViewboxComponent = {
|
|
27
|
-
southwest: MFLocationComponent,
|
|
28
|
-
northeast: MFLocationComponent,
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export enum MFTravelMode {
|
|
32
|
-
car = 'car',
|
|
33
|
-
bike = 'bike',
|
|
34
|
-
foot = 'foot',
|
|
35
|
-
motorcycle = 'motorcycle',
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export enum MFRouteWeighting {
|
|
39
|
-
shortest = 'shortest',
|
|
40
|
-
fastest = 'fastest',
|
|
41
|
-
balance = 'balance',
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export enum MFLanguageResult {
|
|
45
|
-
en = 'en',
|
|
46
|
-
vi = 'vi',
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export enum MFRouteType {
|
|
50
|
-
motorway = 'motorway',
|
|
51
|
-
trunk = 'trunk',
|
|
52
|
-
ferry = 'ferry',
|
|
53
|
-
bridge = 'bridge',
|
|
54
|
-
tunnel = 'tunnel',
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export type MFRouteRestriction = {
|
|
58
|
-
location?: MFLocationComponent,
|
|
59
|
-
radius?: number,
|
|
60
|
-
viewbox?: MFViewboxComponent,
|
|
61
|
-
path?: MFLocationComponent[],
|
|
62
|
-
types?: MFRouteType[] | string[]
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export type MFSuggestionParams = {
|
|
66
|
-
text: string,
|
|
67
|
-
location?: MFLocationComponent,
|
|
68
|
-
acronym?: boolean,
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export type MFTextSearchParams = {
|
|
72
|
-
text: string,
|
|
73
|
-
types?: string[],
|
|
74
|
-
datetime?:
|
|
75
|
-
location?: MFLocationComponent,
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export type MFNearbySearchParams = {
|
|
79
|
-
location: MFLocationComponent,
|
|
80
|
-
radius: number,
|
|
81
|
-
text?: string,
|
|
82
|
-
types?: string[],
|
|
83
|
-
tags?: string[],
|
|
84
|
-
datetime?:
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export type MFViewboxSearchParams = {
|
|
88
|
-
viewbox: MFViewboxComponent,
|
|
89
|
-
text?: string,
|
|
90
|
-
types?: string[],
|
|
91
|
-
tags?: string[],
|
|
92
|
-
datetime?:
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export type MFGeocodeParams = {
|
|
96
|
-
location?: MFLocationComponent,
|
|
97
|
-
address?: string,
|
|
98
|
-
viewbox?: MFViewboxComponent,
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export type MFDirectionsParams = {
|
|
102
|
-
origin: MFLocationComponent,
|
|
103
|
-
destination: MFLocationComponent,
|
|
104
|
-
waypoints?: MFLocationComponent[],
|
|
105
|
-
mode?: MFTravelMode | string,
|
|
106
|
-
weighting?: MFRouteWeighting | string,
|
|
107
|
-
language?: MFLanguageResult | string,
|
|
108
|
-
restriction?: MFRouteRestriction,
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export type MFRouteETAParams = {
|
|
112
|
-
origins: MFLocationComponent[],
|
|
113
|
-
destination: MFLocationComponent,
|
|
114
|
-
mode?: MFTravelMode | string,
|
|
115
|
-
weighting?: MFRouteWeighting | string,
|
|
116
|
-
language?: MFLanguageResult | string,
|
|
117
|
-
restriction?: MFRouteRestriction,
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export type MFDistanceMatrixParams = {
|
|
121
|
-
origins: MFLocationComponent[],
|
|
122
|
-
destinations: MFLocationComponent[],
|
|
123
|
-
mode?: MFTravelMode | string,
|
|
124
|
-
weighting?: MFRouteWeighting | string,
|
|
125
|
-
language?: MFLanguageResult | string,
|
|
126
|
-
restriction?: MFRouteRestriction,
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export type MFGraphRouteParams = {
|
|
130
|
-
locations: MFLocationComponent[],
|
|
131
|
-
mode?: MFTravelMode | string,
|
|
132
|
-
weighting?: MFRouteWeighting | string,
|
|
133
|
-
language?: MFLanguageResult | string,
|
|
134
|
-
restriction?: MFRouteRestriction,
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export function fetchSuggestion(params: MFSuggestionParams): Promise<
|
|
138
|
-
return Map4dServices.fetchSuggestion(params);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export function fetchPlaceDetail(placeId: string): Promise<
|
|
142
|
-
return Map4dServices.fetchPlaceDetail(placeId);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export function fetchTextSearch(params: MFTextSearchParams): Promise<
|
|
146
|
-
return Map4dServices.fetchTextSearch(params);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export function fetchNearbySearch(params: MFNearbySearchParams): Promise<
|
|
150
|
-
return Map4dServices.fetchNearbySearch(params);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export function fetchViewboxSearch(params: MFViewboxSearchParams): Promise<
|
|
154
|
-
return Map4dServices.fetchViewboxSearch(params);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
export function fetchGeocode(params: MFGeocodeParams): Promise<
|
|
158
|
-
return Map4dServices.fetchGeocode(params);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export function fetchDirections(params: MFDirectionsParams): Promise<
|
|
162
|
-
return Map4dServices.fetchDirections(params);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export function fetchRouteETA(params: MFRouteETAParams): Promise<
|
|
166
|
-
return Map4dServices.fetchRouteETA(params);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
export function fetchDistanceMatrix(params: MFDistanceMatrixParams): Promise<
|
|
170
|
-
return Map4dServices.fetchDistanceMatrix(params);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export function fetchGraphRoute(params: MFGraphRouteParams): Promise<
|
|
174
|
-
return Map4dServices.fetchGraphRoute(params);
|
|
1
|
+
import { NativeModules, Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
const LINKING_ERROR =
|
|
4
|
+
`The package 'react-native-map4d-services' doesn't seem to be linked. Make sure: \n\n` +
|
|
5
|
+
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
6
|
+
'- You rebuilt the app after installing the package\n' +
|
|
7
|
+
'- You are not using Expo managed workflow\n';
|
|
8
|
+
|
|
9
|
+
const Map4dServices = NativeModules.Map4dServices
|
|
10
|
+
? NativeModules.Map4dServices
|
|
11
|
+
: new Proxy(
|
|
12
|
+
{},
|
|
13
|
+
{
|
|
14
|
+
get() {
|
|
15
|
+
throw new Error(LINKING_ERROR);
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export type MFLocationComponent = {
|
|
21
|
+
latitude: number,
|
|
22
|
+
longitude: number,
|
|
23
|
+
alias?: string,
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type MFViewboxComponent = {
|
|
27
|
+
southwest: MFLocationComponent,
|
|
28
|
+
northeast: MFLocationComponent,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export enum MFTravelMode {
|
|
32
|
+
car = 'car',
|
|
33
|
+
bike = 'bike',
|
|
34
|
+
foot = 'foot',
|
|
35
|
+
motorcycle = 'motorcycle',
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export enum MFRouteWeighting {
|
|
39
|
+
shortest = 'shortest',
|
|
40
|
+
fastest = 'fastest',
|
|
41
|
+
balance = 'balance',
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export enum MFLanguageResult {
|
|
45
|
+
en = 'en',
|
|
46
|
+
vi = 'vi',
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export enum MFRouteType {
|
|
50
|
+
motorway = 'motorway',
|
|
51
|
+
trunk = 'trunk',
|
|
52
|
+
ferry = 'ferry',
|
|
53
|
+
bridge = 'bridge',
|
|
54
|
+
tunnel = 'tunnel',
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type MFRouteRestriction = {
|
|
58
|
+
location?: MFLocationComponent,
|
|
59
|
+
radius?: number,
|
|
60
|
+
viewbox?: MFViewboxComponent,
|
|
61
|
+
path?: MFLocationComponent[],
|
|
62
|
+
types?: MFRouteType[] | string[]
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type MFSuggestionParams = {
|
|
66
|
+
text: string,
|
|
67
|
+
location?: MFLocationComponent,
|
|
68
|
+
acronym?: boolean,
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export type MFTextSearchParams = {
|
|
72
|
+
text: string,
|
|
73
|
+
types?: string[],
|
|
74
|
+
datetime?: number,
|
|
75
|
+
location?: MFLocationComponent,
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export type MFNearbySearchParams = {
|
|
79
|
+
location: MFLocationComponent,
|
|
80
|
+
radius: number,
|
|
81
|
+
text?: string,
|
|
82
|
+
types?: string[],
|
|
83
|
+
tags?: string[],
|
|
84
|
+
datetime?: number,
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export type MFViewboxSearchParams = {
|
|
88
|
+
viewbox: MFViewboxComponent,
|
|
89
|
+
text?: string,
|
|
90
|
+
types?: string[],
|
|
91
|
+
tags?: string[],
|
|
92
|
+
datetime?: number,
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export type MFGeocodeParams = {
|
|
96
|
+
location?: MFLocationComponent,
|
|
97
|
+
address?: string,
|
|
98
|
+
viewbox?: MFViewboxComponent,
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export type MFDirectionsParams = {
|
|
102
|
+
origin: MFLocationComponent,
|
|
103
|
+
destination: MFLocationComponent,
|
|
104
|
+
waypoints?: MFLocationComponent[],
|
|
105
|
+
mode?: MFTravelMode | string,
|
|
106
|
+
weighting?: MFRouteWeighting | string,
|
|
107
|
+
language?: MFLanguageResult | string,
|
|
108
|
+
restriction?: MFRouteRestriction,
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export type MFRouteETAParams = {
|
|
112
|
+
origins: MFLocationComponent[],
|
|
113
|
+
destination: MFLocationComponent,
|
|
114
|
+
mode?: MFTravelMode | string,
|
|
115
|
+
weighting?: MFRouteWeighting | string,
|
|
116
|
+
language?: MFLanguageResult | string,
|
|
117
|
+
restriction?: MFRouteRestriction,
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export type MFDistanceMatrixParams = {
|
|
121
|
+
origins: MFLocationComponent[],
|
|
122
|
+
destinations: MFLocationComponent[],
|
|
123
|
+
mode?: MFTravelMode | string,
|
|
124
|
+
weighting?: MFRouteWeighting | string,
|
|
125
|
+
language?: MFLanguageResult | string,
|
|
126
|
+
restriction?: MFRouteRestriction,
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export type MFGraphRouteParams = {
|
|
130
|
+
locations: MFLocationComponent[],
|
|
131
|
+
mode?: MFTravelMode | string,
|
|
132
|
+
weighting?: MFRouteWeighting | string,
|
|
133
|
+
language?: MFLanguageResult | string,
|
|
134
|
+
restriction?: MFRouteRestriction,
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export function fetchSuggestion(params: MFSuggestionParams): Promise<any> {
|
|
138
|
+
return Map4dServices.fetchSuggestion(params);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export function fetchPlaceDetail(placeId: string): Promise<any> {
|
|
142
|
+
return Map4dServices.fetchPlaceDetail(placeId);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export function fetchTextSearch(params: MFTextSearchParams): Promise<any> {
|
|
146
|
+
return Map4dServices.fetchTextSearch(params);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export function fetchNearbySearch(params: MFNearbySearchParams): Promise<any> {
|
|
150
|
+
return Map4dServices.fetchNearbySearch(params);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export function fetchViewboxSearch(params: MFViewboxSearchParams): Promise<any> {
|
|
154
|
+
return Map4dServices.fetchViewboxSearch(params);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export function fetchGeocode(params: MFGeocodeParams): Promise<any> {
|
|
158
|
+
return Map4dServices.fetchGeocode(params);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export function fetchDirections(params: MFDirectionsParams): Promise<any> {
|
|
162
|
+
return Map4dServices.fetchDirections(params);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export function fetchRouteETA(params: MFRouteETAParams): Promise<any> {
|
|
166
|
+
return Map4dServices.fetchRouteETA(params);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export function fetchDistanceMatrix(params: MFDistanceMatrixParams): Promise<any> {
|
|
170
|
+
return Map4dServices.fetchDistanceMatrix(params);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export function fetchGraphRoute(params: MFGraphRouteParams): Promise<any> {
|
|
174
|
+
return Map4dServices.fetchGraphRoute(params);
|
|
175
175
|
}
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
package/ios/.DS_Store
DELETED
|
Binary file
|