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

Add ocean and inlandWater properties for iOS #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ catch(err) {
```

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

```js
{
Expand All @@ -138,6 +138,15 @@ both iOS and Android will return the following object:
}
```

iOS will return that same object plus water feature data:

```js
{
ocean: String | null,
inlandWater: String | null
}
```

## Notes

### iOS
Expand Down
4 changes: 3 additions & 1 deletion ios/RNGeocoder/RNGeocoder.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ - (NSArray *)placemarksToDictionary:(NSArray *)placemarks {
@"postalCode": placemark.postalCode ?: [NSNull null],
@"adminArea": placemark.administrativeArea ?: [NSNull null],
@"subAdminArea": placemark.subAdministrativeArea ?: [NSNull null],
@"formattedAddress": [lines componentsJoinedByString:@", "] ?: [NSNull null]
@"formattedAddress": [lines componentsJoinedByString:@", "] ?: [NSNull null],
@"inlandWater": placemark.inlandWater ?: [NSNull null],
@"ocean": placemark.ocean ?: [NSNull null]
};

[results addObject:result];
Expand Down