码迷,mamicode.com
首页 > 其他好文 > 详细

有关 MKPlacemark 获取地理位置

时间:2014-10-26 18:13:52      阅读:202      评论:0      收藏:0      [点我收藏+]

标签:io   os   ar   for   sp   数据   on   cti   bs   

placemark(MKPlacemark类的对象)其实是geocoder(MKReverseGeocoder类的对象)的一个属性。从geocoder里面取placemark这个和直接取placemark这个其实区别不大。而我们需要的信息主要就在这个里面了。

// 这个字典存放基础数据

@property (nonatomic, readonly) NSDictionary *addressDictionary;

让我们试试看,能从这个字典里面倒出来些什么东西。

以下是我用这个addressDictionary属性倒出来的字典。我们分析看看。

{

    City = "\U897f\U5b89\U5e02";// 城市名字

    Country = "\U4e2d\U56fd";// 国家名字

    CountryCode = CN;// 国家编码

    FormattedAddressLines =     (

        "\U4e2d\U56fd",

        "\U9655\U897f\U7701\U897f\U5b89\U5e02\U96c1\U5854\U533a",

        "\U9ad8\U65b0\U516d\U8def34\U53f7"

    ); // 这个应该是格式化后的地址了

    State = "\U9655\U897f\U7701"; // 省

    Street = "\U9ad8\U65b0\U516d\U8def 34\U53f7";// 街道完整名称

    SubLocality = "\U96c1\U5854\U533a";//区名

    SubThoroughfare = "34\U53f7";//具体地址

    Thoroughfare = "\U9ad8\U65b0\U516d\U8def";//街道名称

}

 

注意:上面的这个字典是可以直接转化为联系人的字典的,通过这个ABCreateStringWithAddressDictionary属性。

 

以下是placemark的其他属性。大家可以随意取用。

// address dictionary properties

@property (nonatomic, readonly) NSString *name; // eg. Apple Inc.

@property (nonatomic, readonly) NSString *thoroughfare; // street address, eg. 1 Infinite Loop

@property (nonatomic, readonly) NSString *subThoroughfare; // eg. 1

@property (nonatomic, readonly) NSString *locality; // city, eg. Cupertino

@property (nonatomic, readonly) NSString *subLocality; // neighborhood, common name, eg. Mission District

@property (nonatomic, readonly) NSString *administrativeArea; // state, eg. CA

@property (nonatomic, readonly) NSString *subAdministrativeArea; // county, eg. Santa Clara

@property (nonatomic, readonly) NSString *postalCode; // zip code, eg. 95014

@property (nonatomic, readonly) NSString *ISOcountryCode; // eg. US

@property (nonatomic, readonly) NSString *country; // eg. United States

@property (nonatomic, readonly) NSString *inlandWater; // eg. Lake Tahoe

@property (nonatomic, readonly) NSString *ocean; // eg. Pacific Ocean

@property (nonatomic, readonly) NSArray *areasOfInterest; // eg. Golden Gate Park

 

有关 MKPlacemark 获取地理位置

标签:io   os   ar   for   sp   数据   on   cti   bs   

原文地址:http://www.cnblogs.com/niit-soft-518/p/4052366.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!