0
如何在mkmapview上獲取多個位置針點。如何在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配售。
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;
}