我有一个地方需要用到当前的位置的经纬度和省市区(不用显示地图),因此我想封装一个地图类,以后我只要调用这个类就会返回当前的位置的经纬度和省市区。但是操作的时候,一直不调用我的地图,我就不知道该如何做了,望各位指点一二
.h文件
.m文件
![](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/onion/37.gif)
.h文件
#import <UIKit/UIKit.h>
#import <MAMapKit/MAMapKit.h>
#import <AMapSearchKit/AMapSearchAPI.h>
@interface MyUserLocation : UIViewController
{
void (^Location)(AMapReGeocode *reGeocode);
}
- (void)location:(void (^)(AMapReGeocode * reGeocode))block;
@end
.m文件
#import "MyUserLocation.h"
#import "Method.h"
#define SPAN MACoordinateSpanMake(0.025, 0.025)
@interface MengUserLocation()<MAMapViewDelegate,AMapSearchDelegate>