使用reverseGeocodeLocation使用placemark.administrativeArea返回完整状态

时间:2015-04-02 13:10:08

标签: ios objective-c xcode geolocation reverse-geocoding

首次进行地理位置查找,我想返回用户当前的位置。不在地图上,而是检索状态信息,并根据其位置为应用程序提供选项。

当我使用reverseGeocodeLocation查找时,我发现它发现了大量数据......这很棒。具体来说,我喜欢完整的州名而不是缩写(即加州与CA)。

唯一的问题是当placeLog.administrativeArea的NSLog只显示缩写" CA"。

Dev Docs它说:
"例如,如果地标位置是Apple的总部,则此属性的值将为字符串" CA"或者"加利福尼亚"。

当我将整个地标转储到日志中时,我看到加利福尼亚。这一定是一个愚蠢的问题......我到底做错了什么?

提前致谢!

    structuredAddress: Apple Inc.<GEOMapItemStorage: 0x7a680f70> {
    placeData =     {
        component =         (
                        {
                "cache_control" = CACHEABLE;
                "start_index" = 0;
                status = "STATUS_SUCCESS";
                ttl = 15768000;
                type = "COMPONENT_TYPE_HOURS";
                "values_available" = 0;
                version = 7;
                "version_domain" =                 (
                    apple,
                    revgeo,
                    US
                );
            },
                        {
                "cache_control" = CACHEABLE;
                "start_index" = 0;
                status = "STATUS_SUCCESS";
                ttl = 15768000;
                type = "COMPONENT_TYPE_RATING";
                "values_available" = 0;
                version = 7;
                "version_domain" =                 (
                    apple,
                    revgeo,
                    US
                );
            },
                        {
                "cache_control" = CACHEABLE;
                "start_index" = 0;
                status = "STATUS_SUCCESS";
                ttl = 15768000;
                type = "COMPONENT_TYPE_FLYOVER";
                "values_available" = 0;
                version = 7;
                "version_domain" =                 (
                    apple,
                    revgeo,
                    US
                );
            },
                        {
                "cache_control" = CACHEABLE;
                "start_index" = 0;
                status = "STATUS_SUCCESS";
                ttl = 15768000;
                type = "COMPONENT_TYPE_BOUNDS";
                value =                 (
                                        {
                        bounds =                         {
                            "map_region" =                             {
                                eastLng = "-122.0278321145097";
                                northLat = "37.33399909402007";
                                southLat = "37.33029506903731";
                                westLng = "-122.0347313625158";
                            };
                        };
                    }
                );
                "values_available" = 1;
                version = 7;
                "version_domain" =                 (
                    apple,
                    revgeo,
                    US
                );
            },
                        {
                "cache_control" = CACHEABLE;
                "start_index" = 0;
                status = "STATUS_SUCCESS";
                ttl = 15768000;
                type = "COMPONENT_TYPE_ROAD_ACCESS_INFO";
                "values_available" = 0;
                version = 7;
                "version_domain" =                 (
                    apple,
                    revgeo,
                    US
                );
            },
                        {
                "cache_control" = CACHEABLE;
                "start_index" = 0;
                status = "STATUS_SUCCESS";
                ttl = 15768000;
                type = "COMPONENT_TYPE_PLACE_INFO";
                value =                 (
                                        {
                        "place_info" =                         {
                            center =                             {
                                lat = "37.3320289";
                                lng = "-122.029566";
                            };
                            timezone =                             {
                                identifier = "America/Los_Angeles";
                            };
                        };
                    }
                );
                "values_available" = 1;
                version = 7;
                "version_domain" =                 (
                    apple,
                    revgeo,
                    US
                );
            },
                        {
                "cache_control" = CACHEABLE;
                "start_index" = 0;
                status = "STATUS_SUCCESS";
                ttl = 15768000;
                type = "COMPONENT_TYPE_ENTITY";
                value =                 (
                                        {
                        entity =                         {
                            name =                             (
                                                                {
                                    locale = "en_US";
                                    "string_value" = "Apple Inc.";
                                },
                                                                {
                                    locale = en;
                                    "string_value" = "Apple Inc.";
                                }
                            );
                            type = AOI;
                        };
                    }
                );
                "values_available" = 1;
                version = 7;
                "version_domain" =                 (
                    apple,
                    revgeo,
                    US
                );
            },
                        {
                "cache_control" = CACHEABLE;
                "start_index" = 0;
                status = "STATUS_SUCCESS";
                ttl = 15768000;
                type = "COMPONENT_TYPE_ADDRESS";
                value =                 (
                                        {
                        address =                         {
                            "localized_address" =                             (
                                                                {
                                    address =                                     {
                                        formattedAddressLine =                                         (
                                            "Apple Inc.",
                                            "Cupertino, CA  95014",
                                            "United States"
                                        );
                                        structuredAddress =                                         {
                                            administrativeArea = California;
                                            administrativeAreaCode = CA;
                                            areaOfInterest =                                             (
                                                "Apple Inc."
                                            );
                                            country = "United States";
                                            countryCode = US;
                                            dependentLocality =                                             (
                                                Cupertino,
                                                "Bay Area"
                                            );
                                            geoId =                                             (
                                            );
                                            locality = Cupertino;
                                            postCode = 95014;
                                            subAdministrativeArea = "Santa Clara";
                                            subLocality = "Bay Area";
                                        };
                                    };
                                    locale = "en_US";
                                },
                                                                {
                                    address =                                     {
                                        formattedAddressLine =                                         (
                                            "Apple Inc.",
                                            "Cupertino, CA  95014",
                                            "United States"
                                        );
                                        structuredAddress =                                         {
                                            administrativeArea = California;
                                            administrativeAreaCode = CA;
                                            areaOfInterest =                                             (
                                                "Apple Inc."
                                            );
                                            country = "United States";
                                            countryCode = US;
                                            dependentLocality =                                             (
                                                Cupertino,
                                                "Bay Area"
                                            );
                                            geoId =                                             (
                                            );
                                            locality = Cupertino;
                                            postCode = 95014;
                                            subAdministrativeArea = "Santa Clara";
                                            subLocality = "Bay Area";
                                        };
                                    };
                                    locale = en;
                                }
                            );
                        };
                    }
                );
                "values_available" = 1;
                version = 7;
                "version_domain" =                 (
                    apple,
                    revgeo,
                    US
                );
            },
                        {
                "cache_control" = CACHEABLE;
                "start_index" = 0;
                status = "STATUS_SUCCESS";
                ttl = 15768000;
                type = "COMPONENT_TYPE_AMENITIES";
                "values_available" = 0;
                version = 7;
                "version_domain" =                 (
                    apple,
                    revgeo,
                    US
                );
            },
                        {
                "cache_control" = CACHEABLE;
                "start_index" = 0;
                status = "STATUS_SUCCESS";
                ttl = 15768000;
                type = "COMPONENT_TYPE_STYLE_ATTRIBUTES";
                "values_available" = 0;
                version = 7;
                "version_domain" =                 (
                    apple,
                    revgeo,
                    US
                );
            }
        );
        "result_provider_id" = 7618;
        status = "STATUS_SUCCESS";
    };
}

0 个答案:

没有答案