我应该如何设置我在地图中的当前位置作为我的起点?

时间:2012-11-21 02:38:59

标签: iphone objective-c ios

我是ios开发的初学者。我需要的是将我的起点设置为我当前的位置?

- (void)loadView {
    UIView *contentView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f,   372.0f)];
    self.view = contentView;


    routeMapView = [[MKMapView alloc] initWithFrame:contentView.frame];
    routeMapView.delegate = self;
    routeMapView.showsUserLocation = YES;
    [contentView addSubview:routeMapView];



    routeOverlayView = [[UICRouteOverlayMapView alloc] initWithMapView:routeMapView];

    diretions = [UICGDirections sharedDirections];
    diretions.delegate = self;

}

- (void)viewDidLoad 
{
    [super viewDidLoad];

    CLLocationCoordinate2D sOri,sDest;



    startPoint=@"";
    endPoint= @"34 Jalan Yew, 55100 Kuala Lumpur, Wilayah Persekutuan Kuala Lumpur, Malaysia";

}

1 个答案:

答案 0 :(得分:0)

您可以找到MKMapView here的文档。 操纵地图的可见部分部分是您正在寻找的。