From 1a68ce52b4c80e93e770bf41f09db3b564153a86 Mon Sep 17 00:00:00 2001 From: 7c00 Date: Sun, 5 May 2019 13:38:57 +0800 Subject: [PATCH] Fix ios regeocode --- lib/ios/AMapGeolocation.m | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/ios/AMapGeolocation.m b/lib/ios/AMapGeolocation.m index 2326557..dca03b7 100644 --- a/lib/ios/AMapGeolocation.m +++ b/lib/ios/AMapGeolocation.m @@ -61,7 +61,7 @@ @implementation AMapGeolocation { } - (id)json:(CLLocation *)location reGeocode:(AMapLocationReGeocode *)reGeocode { - if (reGeocode && reGeocode.formattedAddress.length) { + if (reGeocode) { return @{ @"accuracy" : @(location.horizontalAccuracy), @"latitude" : @(location.coordinate.latitude), @@ -70,16 +70,16 @@ - (id)json:(CLLocation *)location reGeocode:(AMapLocationReGeocode *)reGeocode { @"speed" : @(location.speed), @"heading" : @(location.course), @"timestamp" : @(location.timestamp.timeIntervalSince1970 * 1000), - @"address" : reGeocode.formattedAddress, - @"poiName" : reGeocode.POIName ? reGeocode.POIName : "", - @"country" : reGeocode.country ? reGeocode.country : "", - @"province" : reGeocode.province ? reGeocode.country : "", - @"city" : reGeocode.city ? reGeocode.city : "", - @"cityCode" : reGeocode.citycode ? reGeocode.citycode : "", - @"district" : reGeocode.district ? reGeocode.district : "", - @"street" : reGeocode.street ? reGeocode.street : "", - @"streetNumber" : reGeocode.number ? reGeocode.number : "", - @"adCode" : reGeocode.adcode ? reGeocode.adcode : "", + @"address" : reGeocode.formattedAddress ? reGeocode.formattedAddress : @"", + @"poiName" : reGeocode.POIName ? reGeocode.POIName : @"", + @"country" : reGeocode.country ? reGeocode.country : @"", + @"province" : reGeocode.province ? reGeocode.country : @"", + @"city" : reGeocode.city ? reGeocode.city : @"", + @"cityCode" : reGeocode.citycode ? reGeocode.citycode : @"", + @"district" : reGeocode.district ? reGeocode.district : @"", + @"street" : reGeocode.street ? reGeocode.street : @"", + @"streetNumber" : reGeocode.number ? reGeocode.number : @"", + @"adCode" : reGeocode.adcode ? reGeocode.adcode : @"", }; } else { return @{