Results 1 to 1 of 1

Thread: iOS: How to create multiple Annotations

  1. #1
    Etablierter skobbler
    Join Date
    04.07.2014
    Posts
    10

    iOS: How to create multiple Annotations

    Hello,

    I want to create multiple annotations in my app. So there is a for loop and I want multiple Annoations while the loop is running.

    How can I do that?

    My current code:
    Code:
    for(int i=0;i < latitude.count; i++)
        {
            //set the map region
            SKCoordinateRegion region;
            region.center = CLLocationCoordinate2DMake([self.Latitude[i] floatValue], [self.Longitude[i] floatValue]);
            region.zoomLevel = 5;
            self.miniMap.visibleRegion = region;
            
            //add a circle overlay
            SKAnnotation *annotation = [SKAnnotation annotation];
            annotation.identifier = 10;
            annotation.annotationType = SKAnnotationTypeRed;
            annotation.location = CLLocationCoordinate2DMake([self.Latitude[i] floatValue], [self.Longitude[i] floatValue]);
            [self.miniMap addAnnotation:annotation];
        }

    EDIT:

    Ok get it with annotation.identifier = i

    SOLVED!
    Last edited by MeltingElements; 04.07.2014 at 12:12.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •