我正在使用storyboard在视图控制器中创建地图视图.
当我使用以下代码时.
-(void) mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation { CLLocationDistance distance = 1000; MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(userLocation.coordinate,distance,distance); MKCoordinateRegion adjusted_region = [self.mapView regionThatFits:region]; [self.mapView setRegion:adjusted_region animated:YES]; }
在美国加利福尼亚州旧金山绘制一个点.该
userLocation坐标是MapKit.h框架中的预定义值.
现在我创建一个
-(void) mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation { CLLocationDistance distance = 1000; CLLocationCoordinate2D myCoordinate; myCoordinate.latitude = 13.04016; myCoordinate.longitude = 80.243044; MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(myCoordinate,distance); MKCoordinateRegion adjusted_region = [self.mapView regionThatFits:region]; [self.mapView setRegion:adjusted_region animated:YES]; }
这里,显示具有中心坐标的区域.但是,在坐标位置没有绘制点.
如何在该坐标位置绘制点或注释?