AnsweredAssumed Answered

Cannot get FeatureTemplatePicker to work

Question asked by Caleb1987 on Mar 24, 2016
Latest reply on Apr 11, 2016 by Caleb1987

I am trying to implement the feature template picker found here.  I have added the layer I need to the feature template picker controller, but for some reason UITableView is not populating the templates.  I have not made any changes to the GitHub sample for the FeatureLayerTemplatePickerController.swift file.  Here is where I'm adding the templates:

 

    // MARK: set feature layer template picker to sightings

    func webMap(webMap: AGSWebMap!, didLoadLayer layer: AGSLayer!) {

        if let featureLayer = layer as? AGSFeatureLayer {

            if (featureLayer.name == "EAB Sighting"){

                self.sightings = featureLayer

                self.sightings.editingDelegate = self

 

                //Add templates from this layer to the Feature Template Picker

                self.featureTemplatePickerController.addTemplatesFromLayer(self.sightings)

                for template in self.featureTemplatePickerController.infos {

                    print(template.featureTemplate.name)

                }

            }

        }

    }

 

It seems like the templates are being added to the template picker correctly because my print statement shows the template names:

 

template_printout.png

This matches the legend of the Webmap I'm using (left image below).  I cannot figure out what is going on.  When I present the template picker view controller it is a blank table.  I have added an outlet to the UITable as well (right image below):

legend.pngoutlet_ref.png

initial_view.pngempty_template.png

Has anyone else ran into this issue?  I cannot figure out what I'm doing wrong.

Outcomes