我想使用覆盖层在 ios 地图上画一条线。我有一个在地图上画线的代码。但这对我不起作用。谁能帮我。
MKCoordinateSpan 跨度;span.latitudeDelta=.03; 跨度.longitudeDelta=.03;
MKCoordinateRegion region;
region.span=span;
region.center=CLLocationCoordinate2DMake(39.046259, -76.851195);
[_myMapView setRegion:region animated:YES];
[_myMapView regionThatFits:region];
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTapWebView:)];
singleTap.numberOfTapsRequired = 1;
singleTap.delegate = self;
[self.myMapView addGestureRecognizer:singleTap];
[singleTap release];
CLLocationCoordinate2D commuterLotCoords[5]=
{
CLLocationCoordinate2DMake(39.036399,-76.872208)
};
MKPolygon *commuterParkingPolygon=[MKPolygon polygonWithCoordinates:commuterLotCoords count:5];
[_myMapView addOverlay:commuterParkingPolygon];
在上面的代码中,我们可以从这一行更改终点“ CLLocationCoordinate2DMake(39.036399,-76.872208 )”,但起点始终是纬度 0.000003,经度 0.000000。我怎样才能改变开始品脱。任何人都可以帮我解决这个问题。