【发布时间】:2014-11-30 03:12:25
【问题描述】:
如何在 mkmapview 上获取多个定位点。
在我当前的位置上,我查看我的朋友向我注册。
我有位置纬度和经度值。
以下是用于理解的虚拟值。
{
friendA:
{
latitude: "12.1234";
longtitude: "12.1234";
},
friendB:
{
latitude: "12.1234";
longtitude: "12.1234";
},
friendD:
{
latitude: "12.1234";
longtitude: "12.1234";
}
}
想在 mapView 上显示我所有的朋友,并在那里的位置 用 PinPointer Marker.png
放置//创建地图视图。
mapView = [[MKMapView alloc] init];
mapView.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height-60);
mapView.delegate = self;
mapView.mapType = MKMapTypeStandard;
mapView.showsUserLocation = YES;
[self.view addSubview:mapView];
MKAnnotation MarkerPin 指针
- (MKAnnotationView *)mapView:(MKMapView *)map viewForAnnotation:(id <MKAnnotation>)annotation
{
static NSString *AnnotationViewID = @"annotationView";
MKAnnotationView *annotationView = (MKAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:AnnotationViewID];
if (annotationView == nil){
annotationView = [[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:AnnotationViewID];
}
annotationView.image = [UIImage imageNamed:@"Marker.png"];
annotationView.annotation = annotation;
return annotationView;
}
【问题讨论】:
标签: ios objective-c annotations mkmapview mkannotationview