hermss

featureTemplatePickerViewController for offline layer

Discussion created by hermss on Sep 12, 2011
Latest reply on Sep 18, 2011 by hermss
Hi, extracting from the arcgis sample code there is a method that calling webmap for features
how do i not rellying on webmap but to get the feature from offline layer.?

If I would like to create a manual form
-(void)featureTemplatePickerViewController:(FeatureTemplatePickerViewController*) featureTemplatePickerViewController didSelectFeatureTemplate:(AGSFeatureTemplate*)template forFeatureLayer:(AGSFeatureLayer*)featureLayer{
   
    //set the active feature layer to the one we are going to edit
    self.activeFeatureLayer = featureLayer;
   
    //create a new feature based on the template
    _newFeature = [self.activeFeatureLayer createFeatureWithTemplate:template];
   
    //Add the new feature to the feature layer's graphic collection
    //This is important because then the popup view controller will be able to
    //find the feature layer associated with the graphic and inspect the field metadata
    //such as domains, subtypes, data type, length, etc
    //Also note, if the user cancels before saving the new feature to the server,
    //we will manually need to remove this
    //feature from the feature layer (see implementation for popupsContainer:didCancelEditingGraphicForPopup: below)
    [self.activeFeatureLayer addGraphic:_newFeature];
   
    //Iniitalize a popup view controller
    self.popupVC = [[[AGSPopupsContainerViewController alloc] initWithWebMap:self.webmap forFeature:_newFeature usingNavigationControllerStack:NO] autorelease];
    self.popupVC.delegate = self;
   
    //Only for iPad, set presentation style to Form sheet
    //We don't want it to cover the entire screen
    if([[UIDevice currentDevice] isIPad])
        self.popupVC.modalPresentationStyle = UIModalPresentationFormSheet;
   
    //Animate by flipping horizontally
    self.popupVC.modalTransitionStyle =  UIModalTransitionStyleFlipHorizontal;
   
    //First, dismiss the Feature Template Picker
    [self dismissModalViewControllerAnimated:NO];
   
    //Next, Present the popup view controller
    [self presentModalViewController:self.popupVC animated:YES];
    [self.popupVC startEditingCurrentPopup];
    }

Outcomes