featureTemplatePickerViewController for offline layer

484
2
09-12-2011 11:15 PM
hermancheah
New Contributor
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];
    }
0 Kudos
2 Replies
PaulLohr
Occasional Contributor III
Are you wanting to edit features that are stored locally on the iPhone or iPad?
0 Kudos
hermancheah
New Contributor
Are you wanting to edit features that are stored locally on the iPhone or iPad?


Yes, Paul, that is part of the things i need to work on the feature data will be store on an network server and local ipad.
0 Kudos