Edit online

Image Maps in TEI

Oxygen XML Author includes support for image maps in TEI documents through the use of the <facsimile> element. In TEI documents, this feature provides an easy way to create areas (using <zone> elements) in an image where the end-user can hover or click to retrieve more information about that particular area of the image. The visual Author editing mode includes an Image Map Editor that helps you to easily create the areas in the image.

Figure 1. Image Map Editor in TEI

Image Map Editor Interface in TEI

The interface of the Image Map Editor consists of the following sections and actions:
Toolbar
New Rectangle
Use this button to draw a rectangular shape over an area in the image. You can drag any of the four points to adjust the size and shape of the rectangle.
New Polygon
Use this button to draw a polygon shape over an area in the image. This action opens a dialog box that allows you to select the number of points for the polygon. You can drag any of the points to adjust the size and shape of the polygon.
New Free Form Shape
Use this button to draw a free form shape over an area in the image. After selecting this button, left-click anywhere in the image to place the first point of your shape. Then move the cursor to the location of the next desired point and left-click to place the next point, and so on. To complete the shape (area), click the first point again and a line will automatically be added from the last point that was added, or simply double-click the last point to automatically add the line from the last point back to the first.
Duplicate
Use this button to create a duplicate of the currently selected shape.
Delete
Use this button to delete the currently selected shape.
Undo
Use this button to undo the last action.
Redo
Use this button to redo the last action that was undone.
Show/Hide Numbers
Use this button to toggle between showing or hiding the numbers for the shapes.
Bring Shape to Front
Use this button to bring the currently selected shape forward to the top layer.
Bring Shape Forward
Use this button to bring the currently selected shape forward one layer.
Send Shape Backward
Use this button to send the currently selected shape back one layer.
Send Shape to Back
Use this button to send the currently selected shape back to the bottom layer.
Color Chooser
Use this drop-down menu to select a color scheme for the lines and numbers of the shapes.
Zoom Slider
Use this slider to zoom the image in or out in the main image pane.
Image Pane

This main Image Pane is where you work with shapes to add hyperlinks to multiple areas within an image. The editing mechanisms that are supported in the Image Pane include the following:

Mouse Controls and Keyboard Shortcuts
  • Use the mouse to select and move shapes around in the image pane. It is easy to see which shape is selected in this image pane because the border of the selected shape changes from a solid line to a dotted one.
  • You can also drag any of the points of a selected shape to adjust its size and shape.
  • You can hold down the Ctrl key to select multiple shapes and then move them simultaneously.
  • You can also move shapes by using the arrow keys on your keyboard. In addition, you can hold down Shift while using the arrow keys to move the shape further or Alt to move it 1 pixel at a time.
  • To zoom in or out, you can use the NumPad + or NumPad - keys respectively. Use Ctrl + NumPad 0 to reset the zoom level to its default value.
  • You can use Ctrl + Z to undo an action or Ctrl + Y to redo the last action that was undone.
Contextual Menu Actions

You can right-click the shapes, points, or anywhere in the Image Pane to invoke the contextual menu where the following actions are available:

Add Point
Adds a point to Polygon or Free Form shapes.
Remove Point
Removes the current point from Polygon or Free Form shapes.
Duplicate
Create a duplicate of the currently selected shape.
Delete
Delete the currently selected shape.
New Rectangle
Creates a rectangular shape over an area in the image. You can drag any of the four points to adjust the size and shape of the rectangle.
New Polygon
Creates a polygon shape over an area in the image. This action opens a dialog box that allows you to select the number of points for the polygon. You can drag any of the points to adjust the size and shape of the polygon.
Undo
Use this action to undo the last action.
Redo
Use this action to redo the last action that was undone.
Shape Table
The table at the right of the Image Pane is a sequential list of all the areas (shapes) that have been added in the image. It shows their number, type, and ID. If you select one of the entries in the table, the corresponding shape will be selected in the Image Pane.
Properties
Type
Displays information about the selected coordinate.
ID
The identifier for the selected area. This will become the value of the @xml:id attribute for the particular <zone> element. When you insert a new zone, a unique ID is automatically generated and displayed in this field. However, you can change this value if you want to.

How to Create an Image Map in TEI

To create an image map on an existing image in a TEI document, follow these steps:
  1. The image (<graphic>) must be inside a <facsimile> element to support the Image Map Editor feature.
  2. Right-click the image and select Image Map Editor.

    Step Result: This action will apply an image map to the current image and open the Image Map Editor dialog box.

  3. Add areas (zones) in the image by selecting one of the shape buttons (New Rectangle or New Polygon).
  4. Move the shape to the desired area in the image and drag any of the points on the shape to adjust its size or form. You can use the other buttons on the toolbar to adjust its layer and color, or to perform other editing actions.
    Tip: You can right-click any of the points, shapes, or anywhere in the Image Pane to access various helpful contextual menu actions. For example, the easiest way to remove a point is to right-click the point and select Remove Point.
  5. With the shape selected, enter an ID.
  6. If you want to add more areas (zones) to the image, select a shape button again and repeat the appropriate steps.
  7. When you are finished, click OK to process your changes.
Result: The image map is applied on the image and the appropriate elements and attributes are automatically added. In Author mode, the image map is now rendered over the image and the following two buttons will now be available at the bottom of the image:
  • Image Map Editor - Click this button to open the Image Map Editor.
  • Image Map Details - Click this button to expand a section that displays the details of the image map.

How to Edit an Existing Image Map in TEI

To edit an existing image map, use any of the following methods:
  • Simply double-click the image.
  • Right-click the image and select Image Map Editor.
  • Click the Image Map Editor button below the image.
All three methods open the Image Map Editor where you can make changes to the image map using the various features described above. You can also make changes to the XML structure of the image map in the Text editing mode.

You can also click the Image Map Details button below the image to expand a section that displays the details of the image map and allows you to change the coordinates and IDs of the hyperlinked areas.

Restriction: Currently, if <zone> elements contain additional content (such as text or comments) and you edit the image map, the Image Map Editor does not preserve the additional content. Therefore, if you do need to insert additional content inside the <zone> elements, you should do so after the image map has been created and finalized. Subsequent changes to the image map should then be done in Text mode.

Overlapping Areas

If shapes overlap one another in the Image Map Editor, the one on the top layer takes precedence. The number shown inside each shape represents its layer (if the numbers are not displayed, click the Show/Hide Numbers button on the Image Map Editor toolbar). To change the layer order for a shape, use the layer buttons on the Image Map Editor toolbar (, , , ).

If you insert a shape and all of its coordinates are completely inside another shape, the Image Map Editor will display a warning to let you know that the shape is entirely covered by a bigger shape. Keep in mind that if a shape is completely inside another shape, its hyperlink will only be accessible if its layer is on top of the bigger shape.

Warning: PDF output is limited to rectangular shaped image map objects. Therefore, if your image contains circles or polygons, those objects will be redrawn as rectangles in the PDF output. Keep in mind that this might affect overlaps in the output.