Select to view content in your preferred language

View image from raster field

548
1
08-16-2011 09:34 PM
Mohd_HairiHamzah
Deactivated User
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.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"];
      window.open(imageUrl);
     }
    });
    shape = f.attributes.SHAPE;
   });
   content+="</table><a href='#' onclick='showFeature(results.features["+j+"]); return false;'>Highlight</a><br><br>";
  }
  return content;
   }


Thanks in advance.
0 Kudos
1 Reply
Mohd_HairiHamzah
Deactivated User
Anyone has some idea?

Thanks
0 Kudos