welcome to linkAR technical documentation

next previous

Panoramio POIs


Lets look at 'setupPois' method in PanoramioARview.m, the function runs on Main thread as we are affecting the UI.

    //1
    [_arlibCtrl removeAllPois];
 
    //2
    for (PanoramioObject* panObj in _dataArray) {
 
 
         UIImage* small = panObj.imagePlace;
 
         //3
        Poi* poi = [[Poi alloc] init];
        [poi setLocation:[[CLLocation alloc]initWithLatitude:panObj.location.coordinate.latitude longitude:panObj.location.coordinate.longitude]];
        [poi setIconPath:small];
        [poi setAltitude:1];
        [poi setTitle:panObj.title];
        NSMutableDictionary* actions = [[NSMutableDictionary alloc] initWithObjectsAndKeys:panObj.imageUrl,POI_ACTION_PHOTO,[NSString stringWithFormat:@"%f,%f",poi.location.coordinate.latitude,poi.location.coordinate.longitude],POI_ACTION_MAP,panObj.imageUrl,POI_ACTION_TWITTER, nil];
        [poi setActionsDict:actions];
 
         //4
         [self addPoiSet:poi];
     } 
 
     //5
     if(isViewVisible)
        [_arlibCtrl start];
 
     //6
     if([Information returnFirst]){
        [Information setFirst:FALSE];
        [[NSNotificationCenter defaultCenter] postNotificationName:kRemoveSplash object:nil];
    }
  1. First removes the previous pois.
  2. For each panoramio POI we do 3 and 4
  3. Initialize the poi, adds location, icon, title and actions to it.
  4. Add the poi into the browser.
  5. If we are displaying the view, we start the Browser.
  6. Adds the poiset to the ARbrowser in main thread, addPoiSet: method just calls [_arlibCtrl add:poiSet];
  7. Only if its the first time we load the application, we remove the splash to see the ARView.


arbr2d_ios_view1.png

next previous