开发者

How can i show Multiple pins on the map?

i want to show multiple pins on my MapView all with Animation of Dropping pin so how it is possible if any body have sample 开发者_开发百科code then please send send link.i am new in this field.Thanks in Advance.


There are few code samples on developer.apple.com

This

is a simple map example with two pins


Just as you show single pin.. keep the code for single pin in Loop and pass different longitude latitude in loop.. You will get the pins at different location


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]];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜