开发者

how to add multiple annotation for iphone

开发者 https://www.devze.com 2023-01-05 22:33 出处:网络
Right now I can show current and destination now I want a dummy pin in midway say any location but I want to know how to add 3 pins in map

Right now I can show current and destination now I want a dummy pin in midway say any location but I want to know how to add 3 pins in map

if(annotation != mapView.userLocation) 
{
    NSLog(@"marked");
    static NSString *defaultPinID = @"com.invasivecode.pin";
    开发者_如何学CpinView = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:defaultPinID];
    if ( pinView == nil )
        pinView = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:defaultPinID] autorelease];

    pinView.pinColor = MKPinAnnotationColorGreen;
    pinView.canShowCallout = YES;
    pinView.animatesDrop = YES;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消