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.

    [_arlibCtrl removeAllPois];
    for (PanoramioObject* panObj in _dataArray) {
         UIImage* small = panObj.imagePlace;
        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];
         [self addPoiSet:poi];
        [_arlibCtrl start];
     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.


next previous