0
我想要一个IBAction中心我的mapview的地区的注释。注释添加到的MapView这样的:如何检索地图注记坐标?
myAnnotation *pinLoc=[[myAnnotation alloc] init];
pinLoc.coordinate = mapview.centerCoordinate;
pinLoc.title = @"Title";
pinLoc.subtitle = @"subtitle";
[mapview addAnnotation:pinLoc];
我想中检索,并以某种方式移动该地区的中心是这样的:
- (IBAction)findPin:(id)sender {
MKCoordinateRegion region = { {0.0, 0.0 }, { 0.0, 0.0 } };
region.center.latitude = pinLoc.coordinate.latitude;
region.center.longitude = pinloc.coordinate.longitude;
region.span.latitudeDelta = 0.001f;
region.span.longitudeDelta = 0.001f;
[mapview setRegion:region animated:YES];
[mapview setDelegate:self];
}
我也在寻找一种方式来告诉我们,如果该针在多边形内。我已经在使用用户位置工作了,但同样,我需要检索引脚的坐标以使其与引脚一起工作。
有时候,我看不出是正确的答案在我面前,谢谢安娜。您在StackOverflow上的存在为我在早期的iOS开发职业生涯中为我节省了无数次。我实际上习惯使用你的代码来确定一个点是否在一个多边形内! – 2012-03-20 09:23:20