adevine

Display PDF in InfoWindow

Discussion created by adevine on Oct 5, 2012
Latest reply on Oct 8, 2012 by geos_rfleet
Afternoon All,

What I am trying to do should be easy, but either it is not or I am making it hard.

In the website I am constructing, I have a dynamic map service with point feature classes configured with an HTML Popup formatted as a url (esriServerHTMLPopupTypeAsURL). These feature classes have a field named "PDF" that is attributed with the file name for a pdf infosheet about the features so my "prefix" is set as "http://MYSERVER/DEVELOPMENT/WEBSITE/infosheets/" (the path to my infosheets on the webserver) and my "Field" is set as "PDF" (the name of the pdf file). This should mean my service should allow my webapp to see the complete url and display just the pdf in my popup when I click on that feature to fire the identify task.

I can get my identify task to work but it only shows the field contents. I have looked through the forums, api reference, random websites and fee like I have scoured the internet, but I cannot find an example of how to format the infoTemplate to display this information?

Here is my code. Can anyone tell me how this is done? Do I need to change how my url is formatted on the service side? The "verify" in the html popup tab shows exactly what I am after but I don't think I understand how to consume and display it in an infowindow.

function executeIdentifyTasks(evt) {
     identifyTask = new esri.tasks.IdentifyTask(validserviceurl);

     identifyParams = new esri.tasks.IdentifyParameters();
     identifyParams.tolerance = 3;
     identifyParams.returnGeometry = true;
     identifyParams.layerIds = [4];
     identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_ALL;
     identifyParams.width  = map.width;
     identifyParams.height = map.height;
     identifyParams.geometry = evt.mapPoint;
     identifyParams.mapExtent = map.extent;

     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;
            if (result.layerName === 'LEED_Point') {
                var template_info = new esri.InfoTemplate( WHAT DO I DO HERE???);
                feature.setInfoTemplate(template_info);
            }
            return feature;
        });
     });

     map.infoWindow.setFeatures([ deferred ]);
     map.infoWindow.show(evt.mapPoint);
}


Thank you, in advance, for any help!

Alex DeVine

Outcomes