AnsweredAssumed Answered

Set order of map.infoWindow.setFeatures([deferred3, deferred4]);

Question asked by davidraijmakers on Dec 13, 2012
Latest reply on Sep 16, 2014 by jbcbirder
I use the map.infoWindow.setFeatures to set 2 deferred in it.

But the deferred3 is 1 value, and the deferred4 is most of the time above the values. I dont want to keep clicking to the end just to see that result. But is there a way to set the deffered3 as first in the infowindow.

   map.infoWindow.setFeatures([deferred3, deferred4]);
          map.infoWindow.show(evt.mapPoint);

Here's some code where i set the deferred3 & 4.

deferred3.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;
   //alert(result.layerName);
            if(result.layerName === 'Op Urgentie'){
    //alert("op urgentie");
              console.log(feature.attributes.PARCELID);
              var template = new esri.InfoTemplate("SO Nr ${SONUMMER}", "SO Nr: ${SONUMMER} <br/> RVO Nr: ${KLANTNUMMER} <br/> Urgentie: ${URGENTIE}  <br/> Status: ${STATUS_PROMPT}  <br/> Melding: ${DT_MELDING} <br/> <br/> Omschrijving: ${MELDINGSTEKST}");
              feature.setInfoTemplate(template);
            }
            else if (result.layerName === 'niets'){
              var template = new esri.InfoTemplate("", "Niets: ${Niets}");
              feature.setInfoTemplate(template);
            }
            return feature;
          });
        });

deferred4.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;
   //alert(result.layerName);
            if(result.layerName === 'OBE Bladen'){
    //alert("op urgentie");
              console.log(feature.attributes.PARCELID);
              var template = new esri.InfoTemplate("OBE Blad ", "OBE Blad  <br/> Barcode: ${Barcode} <br/> Uitgave: ${Uitgaveletter}  <br/> Datum: ${Uitgavedatum}  <br/> <br/> Link: <a href=" + "${Hyperlink}" + " target=_blank ;'>Klik hier om de tekening te bekijken</a>");
              feature.setInfoTemplate(template);
            }
            else if (result.layerName === 'OR Bladen'){
              var template = new esri.InfoTemplate("OR Blad ", "OR Blad  <br/> Barcode: ${Barcode} <br/> Uitgave: ${Uitgaveletter}  <br/> Datum: ${Uitgavedatum}  <br/> <br/> Link: <a href=" + "${Hyperlink}" + " target=_blank ;'>Klik hier om de tekening te bekijken</a>");
              feature.setInfoTemplate(template);
            }
   else  if(result.layerName === 'OS Bladen'){
    //alert("op urgentie");
              var template = new esri.InfoTemplate("OS Blad ", "OS Blad  <br/> Barcode: ${Barcode} <br/> Uitgave: ${Uitgaveletter}  <br/> Datum: ${Uitgavedatum}  <br/> <br/> Link: <a href=" + "${Hyperlink}" + " target=_blank ;'>Klik hier om de tekening te bekijken</a>");
              feature.setInfoTemplate(template);
            }
   else  if(result.layerName === 'BBKS Bladen'){
    //alert("op urgentie");
              var template = new esri.InfoTemplate("BBKS Bladen ", "BBKS Blad  <br/> Barcode: ${Barcode} <br/> Uitgave: ${Uitgaveletter}  <br/> Datum: ${Uitgavedatum}  <br/> <br/> Link: <a href=" + "${Hyperlink}" + " target=_blank ;'>Klik hier om de tekening te bekijken</a>");
              feature.setInfoTemplate(template);
            }
   else  if(result.layerName === 'LBVL Bladen'){
    //alert("op urgentie");
              var template = new esri.InfoTemplate("LBVL Bladen ", "LBVL Blad <br/> Barcode: ${Barcode} <br/> Uitgave: ${Uitgaveletter}  <br/> Datum: ${Uitgavedatum}  <br/> <br/> Link: <a href=" + "${Hyperlink}" + " target=_blank ;'>Klik hier om de tekening te bekijken</a>");
              feature.setInfoTemplate(template);
            }
     else if (result.layerName === 'Schema Bovenleiding (Geldig)'){
              var template = new esri.InfoTemplate("Blad: ${Tekening}", " Blad: ${Tekening} <br/>Versie: ${Versie} <br/> Status: ${Status} <br/> Opmerking: ${Waarschuwing} <br/><br/> Link: <a href=" + "${Hyperlink}" + " target=_blank ;'>Klik hier om de tekening te bekijken</a> ");
              feature.setInfoTemplate(template);
            }
     else if (result.layerName === 'Schema Bovenleiding (Nog Niet Van Kracht)'){
              var template = new esri.InfoTemplate("Blad: ${Tekening}", " Blad: ${Tekening} <br/>Versie: ${Versie} <br/> Status: ${Status} <br/> Opmerking: ${Waarschuwing} <br/><br/> Link: <a href=" + "${Hyperlink}" + " target=_blank ;'>Klik hier om de tekening te bekijken</a> ");
              feature.setInfoTemplate(template);
            }
  
            return feature;
          });
        });

EDIT:

The deferred3 is a polygon, the deferred4 is polyline. Maybe there's is something for that?

Outcomes