Attatchments?

426
0
05-20-2014 08:22 PM
AndrewPratt
New Contributor III
I have an IdentifyTask that calls a popup and it works well enough. I have now enabled attachments that I'd like to expose in the popup but I'm not sure how to do that.

The function I'm using looks like this...


                         
on(app.map, "click", function(evt) {
         
    var it = new IdentifyTask("http://my map server/ESRI/MapServer");
    ip = new IdentifyParameters();
    ip.tolerance = 15;
    ip.returnGeometry = false;
    ip.layerIds = [0, 1, 3, 4, 5, 6];
    ip.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_ALL;
    ip.width = app.map.width;
    ip.height = app.map.height;
    ip.geometry = evt.mapPoint;
    ip.mapExtent = app.map.extent;
    it.execute(ip, function(results) {     
    if (results.length > 0 && MeasureOn == "False") {    
    
        var features = arrayUtils.map(results, function(result) {
      var feature = result.feature;            
      
       feature.attributes.layerName = result.layerName;
       
                      if ((result.layerId === 3) || (result.layerId === 4)) {
           feature.setInfoTemplate(new InfoTemplate("${PJCT_NAME}", "<strong>Hyperlink:</strong> <a href=" + "'#'" + "onClick=openShadow(thisobj);"+">Project Service Station</a>"));
         thisobj=feature.attributes.HYPERLINK;                
                      }
                      else if ((result.layerId === 0) || (result.layerId === 1)) {
           feature.setInfoTemplate(new InfoTemplate("${PJCT_NAME}", "<strong>PPSW-Key:</strong> ${PPSW_KEY}<br><strong>Works Type: </strong>${WORKS_TYPE}<br><strong>Works Condition: </strong>${WORKS_COND}<br><strong>Lasted Edited User: </strong>${LAST_EDITED_USER} "));
                         
                      }
                      else if (result.layerId === 5) {
                          feature.setInfoTemplate(new InfoTemplate("${DUC_NAME}", "<strong>Project Name:</strong> ${NAME} <br><strong>Project Number:</strong> ${PJCT} <br><strong>Province:</strong> ${PROV} <br><strong>Waterfowl Wetland:</strong> ${WFOWL_WET}<br> <strong>Waterfowl Upland:</strong> ${WFOWL_UP}<br><strong>Supporting Wetland:</strong> ${SUPP_WET}<br><strong>Supporting Upland:</strong> ${SUPP_UP}<br><strong>Waterfowl Total:</strong> ${WFOWL_TTL}<br><strong>Total:</strong> ${TOTAL}"));
                          
                      }
       else if (result.layerId === 6) {
                          feature.setInfoTemplate(new InfoTemplate("", "<strong>Project:</strong> ${DUCPROJ} <br><strong>Project Name:</strong> ${PPROJ_NAME} <br><strong>PID:</strong> ${PID} <br><strong>PIN:</strong> ${PIN} <br><strong>Fee Simple:</strong> ${FEESIMPLE}<br> <strong>Agreement:</strong> ${AGREEMENTS}<br><strong>Lease:</strong> ${LEASE}<br><strong>Covenant:</strong> ${COVENANT}<br><strong>Area Secured:</strong> ${AREA_SECURED}<br>"));
                          
                      } 
      return feature;
     });
     app.map.graphics.clear(); //Clear any residual graphics from the map.
     app.map.infoWindow.setFeatures(features);
     app.map.infoWindow.show(evt.mapPoint);
     }else{
     app.map.infoWindow.hide();
     }//don't run if no results to process. 
    }, function(error) {
     console.log(error);
    }); 
0 Kudos
0 Replies