From 3d5b3a2f484489f313c28eb2b5ca83705686daaf Mon Sep 17 00:00:00 2001 From: "P.J. Swesey" Date: Sat, 24 Mar 2018 00:59:10 -0700 Subject: [PATCH] Add ocean and inlandWater properties for iOS --- README.md | 11 ++++++++++- ios/RNGeocoder/RNGeocoder.m | 4 +++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 23e2ef6..97705e0 100644 --- a/README.md +++ b/README.md @@ -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 { @@ -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 diff --git a/ios/RNGeocoder/RNGeocoder.m b/ios/RNGeocoder/RNGeocoder.m index 1a54347..4597bee 100644 --- a/ios/RNGeocoder/RNGeocoder.m +++ b/ios/RNGeocoder/RNGeocoder.m @@ -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];