This repository was archived by the owner on Sep 4, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +19
-11
lines changed Expand file tree Collapse file tree 4 files changed +19
-11
lines changed Original file line number Diff line number Diff line change 2
2
example
3
3
e2e
4
4
test
5
+ circle.yml
6
+ .npmignore
5
7
6
8
# OSX
7
9
#
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ dependencies {
40
40
``` java
41
41
import com.devfd.RNGeocoder.RNGeocoderPackage ; // <--- import
42
42
43
- public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
43
+ public class MainActivity extends ReactActivity {
44
44
......
45
45
46
46
@Override
@@ -67,27 +67,33 @@ var NY = {
67
67
};
68
68
69
69
Geocoder.geocodePosition(NY).then(res => {
70
- // res is an Array of geocoding object
70
+ // res is an Array of geocoding object (see below)
71
71
})
72
72
.catch(err => console.log(err))
73
73
74
74
// Address Geocoding
75
75
Geocoder.geocodeAddress('New York').then(res => {
76
- // res is an Array of geocoding object
76
+ // res is an Array of geocoding object (see below)
77
77
})
78
78
.catch(err => console.log(err))
79
79
```
80
80
81
81
## With async / await
82
82
```
83
- const res = await Geocoder.geocodePosition(NY);
84
- ...
83
+ try {
85
84
86
- const res = await Geocoder.geocodeAddress('London');
87
- ...
85
+ const res = await Geocoder.geocodePosition(NY);
86
+ ...
87
+
88
+ const res = await Geocoder.geocodeAddress('London');
89
+ ...
90
+ }
91
+ catch(err) {
92
+ console.log(err);
93
+ }
88
94
```
89
95
90
- ## Geocoding return format
96
+ ## Geocoding object format
91
97
both iOS and Android will return the following object:
92
98
93
99
``` js
Original file line number Diff line number Diff line change 212
212
BF8FCF9E1BFFB184000FCD37 /* Debug */ = {
213
213
isa = XCBuildConfiguration;
214
214
buildSettings = {
215
- HEADER_SEARCH_PATHS = "$(SRCROOT)/../node_modules /react-native/React/**";
215
+ HEADER_SEARCH_PATHS = "$(SRCROOT)/../.. /react-native/React/**";
216
216
OTHER_LDFLAGS = "-ObjC";
217
217
PRODUCT_NAME = "$(TARGET_NAME)";
218
218
SKIP_INSTALL = YES;
222
222
BF8FCF9F1BFFB184000FCD37 /* Release */ = {
223
223
isa = XCBuildConfiguration;
224
224
buildSettings = {
225
- HEADER_SEARCH_PATHS = "$(SRCROOT)/../node_modules /react-native/React/**";
225
+ HEADER_SEARCH_PATHS = "$(SRCROOT)/../.. /react-native/React/**";
226
226
OTHER_LDFLAGS = "-ObjC";
227
227
PRODUCT_NAME = "$(TARGET_NAME)";
228
228
SKIP_INSTALL = YES;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-native-geocoder" ,
3
- "version" : " 0.3 .1" ,
3
+ "version" : " 0.4 .1" ,
4
4
"description" : " react native geocoding and reverse geocoding" ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
You can’t perform that action at this time.
0 commit comments