オーバーレイを使用してiosマップに線を引きたい。地図上に線を引くためのコードが 1 つあります。しかし、それは私にとってはうまくいきません。誰でも私を助けることができますか?
MKCoordinateSpan スパン; span.latitudeDelta=.03; span.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 です。開始パイントを変更するにはどうすればよいですか。誰でもこの問題を解決するのを手伝ってくれますか?