identifyCallback: function(identifiedlayers, responseArray) { var fSet = []; array.forEach(responseArray, function(response, i) { var layerId = identifiedlayers.ref.id; array.forEach(response, function(result) { // see if we have a Popup config defined for this layer if (config.hasOwnProperty(layerId)) { if (config[layerId].hasOwnProperty(result.layerId)) { result.feature.setInfoTemplate(new PopupTemplate(config[layerId][result.layerId])); } } // if no Popup defined output all attributes if (result.feature.infoTemplate === undefined) { result.feature.setInfoTemplate(new PopupTemplate({ title: result.layerName, description: esriLang.substitute(result.feature.attributes) })); } fSet.push(result.feature); }, this); }, this); this.map.infoWindow.setFeatures(fSet); }
Solved! Go to Solution.
array.forEach(responseArray, function (response, i) { var layerId = identifiedlayers.ref.id; for (i=0; i<response.length;i++){ var result = response; // see if we have a Popup config defined for this layer if (config.hasOwnProperty(layerId)) { if (config[layerId].hasOwnProperty(result.layerId)) { result.feature.setInfoTemplate(new PopupTemplate(config[layerId][result.layerId])); fSet.push(result.feature); } } // if no Popup defined output all attributes //if (result.feature.infoTemplate === undefined) { // result.feature.setInfoTemplate(new PopupTemplate({ // title: result.layerName, // description: esriLang.substitute(result.feature.attributes) // })); //} }; }, this);
array.forEach(responseArray, function (response, i) { var layerId = identifiedlayers.ref.id; for (i=0; i<response.length;i++){ var result = response; // see if we have a Popup config defined for this layer if (config.hasOwnProperty(layerId)) { if (config[layerId].hasOwnProperty(result.layerId)) { result.feature.setInfoTemplate(new PopupTemplate(config[layerId][result.layerId])); fSet.push(result.feature); } } // if no Popup defined output all attributes //if (result.feature.infoTemplate === undefined) { // result.feature.setInfoTemplate(new PopupTemplate({ // title: result.layerName, // description: esriLang.substitute(result.feature.attributes) // })); //} }; }, this);