Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

Commit

Permalink
v0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
devfd committed May 19, 2016
1 parent 48ac606 commit 28b46be
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .npmignore
Expand Up @@ -2,6 +2,8 @@ img
example
e2e
test
circle.yml
.npmignore

# OSX
#
Expand Down
22 changes: 14 additions & 8 deletions README.md
Expand Up @@ -40,7 +40,7 @@ dependencies {
```java
import com.devfd.RNGeocoder.RNGeocoderPackage; // <--- import

public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
public class MainActivity extends ReactActivity {
......

@Override
Expand All @@ -67,27 +67,33 @@ var NY = {
};
Geocoder.geocodePosition(NY).then(res => {
// res is an Array of geocoding object
// res is an Array of geocoding object (see below)
})
.catch(err => console.log(err))
// Address Geocoding
Geocoder.geocodeAddress('New York').then(res => {
// res is an Array of geocoding object
// res is an Array of geocoding object (see below)
})
.catch(err => console.log(err))
```

## With async / await
```
const res = await Geocoder.geocodePosition(NY);
...
try {
const res = await Geocoder.geocodeAddress('London');
...
const res = await Geocoder.geocodePosition(NY);
...
const res = await Geocoder.geocodeAddress('London');
...
}
catch(err) {
console.log(err);
}
```

## Geocoding return format
## Geocoding object format
both iOS and Android will return the following object:

```js
Expand Down
4 changes: 2 additions & 2 deletions ios/RNGeocoder.xcodeproj/project.pbxproj
Expand Up @@ -212,7 +212,7 @@
BF8FCF9E1BFFB184000FCD37 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
HEADER_SEARCH_PATHS = "$(SRCROOT)/../node_modules/react-native/React/**";
HEADER_SEARCH_PATHS = "$(SRCROOT)/../../react-native/React/**";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -222,7 +222,7 @@
BF8FCF9F1BFFB184000FCD37 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
HEADER_SEARCH_PATHS = "$(SRCROOT)/../node_modules/react-native/React/**";
HEADER_SEARCH_PATHS = "$(SRCROOT)/../../react-native/React/**";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "react-native-geocoder",
"version": "0.3.1",
"version": "0.4.1",
"description": "react native geocoding and reverse geocoding",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 28b46be

Please sign in to comment.