Insert an image into your HTML Pop-up in ArcMap

This one had me stumped for awhile. I wanted to insert an image into an HTML pop-up in ArcMap, which is another way to identify data. The pop up can be formatted to embed links, video, images, and colored to look nicer than the plain identify box that ArcMap typically uses. The pop-up box is formatted by modifying stylesheets and the style sheets are in XSL format. -sigh- yet another ‘programming’ language to hack at. Esri provides stylesheet examples, but I couldn’t find a sample of how to embed an image file into the pop-up box. It seems like that would be the most commonly desired thing, but no samples that I could find. So I searched around the internet and finally cobbled together something that works. Here it is. I hope this saves you a bit of hunting.

The important part excerpted here is this:

<xsl:when test="FieldValue[starts-with(., '\\')]">
<img width="350" height="210">
<xsl:attribute name = "src"><xsl:value-of select="FieldValue"/></xsl:attribute>
Click on through to see the whole template XSL file:
Advertisements