- This extension is enabled by default on Fandom.
The ImageMap extension allows you to add client-side clickable image maps to an article.
See Example page for how to format an image map.
Syntax[]
The contents of an <imagemap>
tag consists of blank lines, comments (starting with #
) and logical lines. The first logical line specifies the image to be displayed. This must be in the same format as an ordinary image link, except without the enclosing [[
and ]]
.
Further lines are split into tokens, separated by whitespace. The function of each line is determined by the first token in the line. All coordinates are given in pixels in relation to the full-size image, not the visible image. A coordinate consists of two tokens. The first token is the horizontal (X) position, and the second token is the vertical (Y) position, measured from the left edge and top edge of the image, respectively.
- desc
- Specifies the location of the image description link. May be either top-right, bottom-right, bottom-left, top-left or none. This puts a blue "i" icon in the specified corner, linking to the image description page. The default is bottom-right.
- rect
- A rectangle. The parameters are the coordinates of the top-left and bottom-right corners, followed by a title to link to in square brackets.
- circle
- A circle. The first two parameters are the coordinates of the center, the third is the radius. The coordinates are followed by a link in square brackets.
- poly
- A polygon. The coordinates of the vertices are given, followed by a link in square brackets.
Note: polygons must be defined before any other form!
- default
- This gives the default link, where no other regions are specified.
All coordinates are specified relative to the full-size source image. The image can be scaled using thumbnail syntax, in which case the image map coordinates will be automatically scaled as well.
All links are given in either the form [[Page title]] or [[Page title|description]]. In the latter case, the part after the pipe ("|") becomes the title attribute of the link - in most browsers, it will pop up as a tooltip when the user hovers over it. If no explicit link description is given, the page title will be used.
Syntax example[]
<imagemap> File:Foo.jpg|200px|picture of a foo poly 131 45 213 41 210 110 127 109 [[Computer monitor|Monitor]] poly 104 126 105 171 269 162 267 124 [[Computer keyboard|Keyboard]] rect 15 95 94 176 [[Human|Girl]] # A comment, this line is ignored circle 57 57 20 [[Copyright]] desc bottom-left </imagemap>
Output of this example:
Image map editor[]
- A graphical tool to determine the coordinates of an image map by Dapete at MetaWiki
See also[]
- Extension page on MediaWiki
- Help:Maps Extension, a default MediaWiki extension for embedding real-world maps.
- Help:Interactive Maps, a custom Fandom feature for creating fictional (or real-world too) interactive maps.
Further help and feedback[]
- Browse and search other help pages at Help:Contents
- Check Fandom Community Central for sources of further help and support
- Check Contacting Fandom for how to report any errors or unclear steps in this article