View image from raster field

Discussion created by awhacked on Aug 16, 2011
Latest reply on Aug 24, 2011 by awhacked
Hi all,

I have a layer that has a raster data type field. I can view the image using the identify tool in ArcMap by clicking the field. How do i display it on a webpage using javascript? There's no url when displaying it in webpage but it has the raster image. Any idea?

Here is the identify code  i have:

function layerTabContent(layerResults) {
  var content = "";
  content = "<i>Total features returned: " + layerResults.features.length + "</i>";
  for(j=0; j<layerResults.features.length; j++){
   var featAttrs = layerResults.features[j].attributes;
   var attrNames = [];
   var objid; 
   for (var i in featAttrs) attrNames.push(i);
   content += "<table>";
   dojo.forEach(layerResults.features, function(f) {
    dojo.forEach(attrNames, function(an) {
     content += "<tr align=left><th>" + an + "</th><td><b>: </b>" + f.attributes[an] + "</td></tr>";
     if (an=="IMAGE"){ //the raster field
      var imageUrl = f.attributes["IMAGE"];;
    shape = f.attributes.SHAPE;
   content+="</table><a href='#' onclick='showFeature(results.features["+j+"]); return false;'>Highlight</a><br><br>";
  return content;

Thanks in advance.