2010-06-07 1 views
1

Я хочу показать несколько контактов на моем MapView все с анимацией Dropping pin, чтобы как можно, если у какого-либо тела есть образец кода, тогда, пожалуйста, отправьте ссылку link.i новое в этом поле. Спасибо в Advance.Как я могу показать несколько контактов на карте?

ответ

2

Есть несколько примеров коды на developer.apple .com

This

простая карта пример с двумя штифтами

+0

у меня есть этот образец кода, но это не понятно. –

+1

Просто позвоните addAnnotations на свой MKMapView с массивом всех MKAnnotationViews. Если вы хотите анимацию drop, установите animatesDrop в true – lukya

0

Подобно тому, как вы показываете один вывод .. держать код для одного пальца в петле и передавать различную долготу в петле .. Вы получите контакты в другом месте

0
if([points retainCount] > 0) 
{ 
    [points release]; 
    points = nil; 


} 


if([annotationAry retainCount] > 0) 
{ 
    [annotationAry release]; 
    annotationAry = nil; 


} 
points = [[NSMutableArray alloc]init]; 
annotationAry = [[NSMutableArray alloc]init]; 
for(int i=0;i<[longitudeary count];i++) 
{ 
    CLLocation* currentLocation1 = [[CLLocation alloc] initWithLatitude:[[latitudeary objectAtIndex:i]doubleValue] longitude:[[longitudeary objectAtIndex:i]doubleValue]]; 

    [points addObject:currentLocation1]; 
} 


for(int i=0;i<[points count];i++) 
{ 



    // CREATE THE ANNOTATIONS AND ADD THEM TO THE MAP 
    CSMapAnnotation* annotation = nil; 

    // create the start annotation and add it to the array 
     annotation = [[[CSMapAnnotation alloc] initWithCoordinate:[[points objectAtIndex:i] coordinate] 
              annotationType:CSMapAnnotationTypeImage 
                 title:@"123456..." 
                 shID:[shIDary objectAtIndex:i] 
                 catID:[catIDary objectAtIndex:i] 
                ciggUse:[ciggaretteUSEary objectAtIndex:i] 
                wifiUse:[wifiUSEary objectAtIndex:i] 
               controller:self]autorelease]; 


    [annotationAry addObject:annotation]; 

} 

[mapViewmy addAnnotations:[NSArray arrayWithArray:annotationAry]]; 
Смежные вопросы