Insert Imagemap Data

Imports map data created for HTML imagemaps into your DITA topics.

If your documents make use of imagemaps, you can use this command to import the map data created by third party imagemap editors. You are prompted to select an XHTML imagemap data file (this file must be valid XHTML). The area elements from the first map element in the file is read and converted into the proper DITA structure, then inserted into the selected imagemap element in your document.

The imported data is not validated, and is inserted as defined in the selected file. At this time only the “rect” shape is support by DITA-FMx.

After importing the data, you can visualize the regions with the Test Hotspots command. This command is keyboard-only and is run by selecting the imagemap and pressing the shortcut keys Esc,T,H. This creates red text frames over the image based on the specified coordinates. For the “rect” shape, the coords value assumes the syntax of “x1,y1,x2,y2” (upper left and lower right corners, measured from the upper left corner of the anchored frame).

The href values are assumed to be external references (URLs) and are converted into xref elements with scope set to “external”. The following code sample shows the expected XHTML format:

... 
<map name="mymap"> 
  <area shape="rect" coords="10,10,90,90" href="http://www.adobe.com"/> 
  <area shape="rect" coords="110,10,190,90" href="http://www.leximation.com"/> 
  <area shape="rect" coords="10,110,90,190" href="http://www.google.com"/> 
  <area shape="rect" coords="110,110,190,190" href="http://www.yahoo.com"/> 
</map> 
...

The following image shows the result of applying this map to a simple image. The red boxes indicate the “hot” regions:

http://www.adobe.com http://www.leximation.com http://www.google.com http://www.yahoo.com

The coordinates of the hot spots (text frames) are aligned using a DPI of 72. If your image requires a different DPI, set the outputclass attribute of the image element to “fmdpi:NNN” (where NNN is the DPI value). If you’ve enabled the “fmdpi” feature, this will be set automatically.

When generating a book from topics with imagemaps, remember to enable the BuildImagemapHotspots setting in the BookBuildOverrides section of the book-build INI file. If this is not enabled, the hot spots will not be created.