我想使用覆盖层在ios地图上画一条线。我有一个代码在地图上绘制一条线。但这对我不起作用。谁能帮我。
MKCoordinateSpan span; span.latitudeDelta = 0.03; span.longitudeDelta = 0.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 )”但总是起点是 lat 0.000003,长0.000000。我怎样才能改变起始品脱。任何人都可以帮我解决这个问题。