WEB开发网
开发学院手机开发iPhone 开发 根据经纬度坐标取详细地址(包括国,省,市,街道... 阅读

根据经纬度坐标取详细地址(包括国,省,市,街道,号)

 2010-12-30 04:38:20 来源:WEB开发网   
核心提示:首页完成改版,来提意见以当前手机为例:获取当前手机地址,根据经纬度坐标取详细地址(包括国,省,市,街道,号),再从经纬度转换成详细地址(包括:国家名-国家代码,省,市,街道名
首页完成改版,来提意见

以当前手机为例:

获取当前手机地址,再从经纬度转换成详细地址(包括:国家名-国家代码,省,市,街道名,邮政代代码等)。

1:获取当前手机经纬度

view sourceprint?01@implementation CurrentLocation

02

03@synthesize locationManager;

04@synthesize target,callBack;

05

06#pragma mark --

07#pragma mark Public

08-(void) startUpdatingLocation{

09 [[self locationManager] startUpdatingLocation];

10}

11#pragma mark --

12#pragma mark Memory management

13-(void) dealloc{

14 [super dealloc];

15 [locationManager release];

16}

17#pragma mark --

18#pragma mark Location manager

19/*

20 Return a location manager -- create one if necessary.

21 */

22- (CLLocationManager *)locationManager {

23 if (locationManager != nil) {return locationManager;}

24 locationManager = [[CLLocationManager alloc] init];

25 [locationManager setDesiredAccuracy:kCLLocationAccuracyNearestTenMeters];

26 [locationManager setDelegate:self];

27 return locationManager;

28}

29#pragma mark --

30#pragma mark CLLocationManagerDelegate methods

31/*

32 Conditionally enable the Add button:

33 If the location manager is generating updates, then enable the button;

34 If the location manager is failing, then disable the button.

35 */

36- (void)locationManager:(CLLocationManager *)manager

37 didUpdateToLocation:(CLLocation *)newLocation

38 fromLocation:(CLLocation *)oldLocation {

39 NSLog(@"获取到经纬度!");

40}

41- (void)locationManager:(CLLocationManager *)manager

42 didFailWithError:(NSError *)error {

1 2  下一页

Tags:根据 经纬度 坐标

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接