AnsweredAssumed Answered

Formatting an InfoWindow

Question asked by kenbuja on Apr 23, 2013
Latest reply on Apr 25, 2013 by kenbuja
In my application, I have a map service containing many different layers, each containing many different fields. In the mxd file that created the service, we have hidden all the fields in each layer that don't need to be shown. When the user clicks on the map, I run the IdentifyTask and I'd like to show the user which layer is being represented in the InfoWindow when there are results from different layers.

Currently, using the code

var deferred = identifyTask.execute(identifyParams);  deferred.addCallback(function (response) {     // response is an array of identify result objects         // Let's return an array of features.     return dojo.map(response, function (result) {         var feature = result.feature;         feature.attributes.layerName = result.layerName;         //var infoTemplate = new esri.InfoTemplate('${result.layerName}', "${*}");         var infoTemplate = new esri.InfoTemplate("test", "${*}");         infoTemplate.setTitle("testing");         feature.setInfoTemplate(infoTemplate);     }     return feature; });


gives me an InfoWindow with the layer name appended to the end of the list of fields. How can I format the infoWindow so that the layerName is at the top of the field list? Setting the title doesn't seem to have any effect.

[ATTACH=CONFIG]23729[/ATTACH]

Attachments

Outcomes