JavaScript 2.0 Identify Sample

599
0
08-04-2010 02:10 PM
RobDunfey
Occasional Contributor
Hello,

I'm sure these are simple answers?  I'm trying to modify the Identify task sample to work with any number of layers, instead of just the 3 which are specified in the sample, but I'm a bit lost on the purpose for some of the lines of code, some comments would be useful.

For example, what happening here:

        layer2results = {displayFieldName:null,features:[]};
        layer3results = {displayFieldName:null,features:[]};
        layer4results = {displayFieldName:null,features:[]};

        for (var i=0, il=idResults.length; i<il; i++) {
          var idResult = idResults;
          if (idResult.layerId === 2) {
            if (!layer2results.displayFieldName) {layer2results.displayFieldName = idResult.displayFieldName};
            layer2results.features.push(idResult.feature);

How come displayFieldName is so important?  What is the feature:[] array, where does that come from?

Any help appreciated,

Rob
0 Kudos
0 Replies