ImageMapEdit Howto

From Meta, a Wikimedia project coordination wiki
Jump to navigation Jump to search


ImageMapEdit is a means to create ImageMaps rapidly and easily.

Who is this HowTo for?[edit]

This HowTo might be useful to you, if...

  • you want to know what an imagemap is.
  • you are already somewhat familiar with MediaWiki, and would now like to use ImageMaps.
  • you would like to set up ImageMapEdit.
  • you would like to learn how to create and edit ImageMaps


This HowTo assumes you have already uploaded the image to the wiki, and are looking at the file description page for that image.

What is an Image Map?[edit]

ImageMaps are used when you want to make links out of multiple parts of a single image. The idea is to indicate "hot zones" on the image, which are mouse-clickable.

  • There are several image maps on this page.


Why do I want one?[edit]

Examples:

  • If you have a picture of a control panel with buttons, you can actually make the buttons pressable by using an imagemap. This might be useful for a printer manual, for instance. Clicking on a button might link to a page in the manual; or it might link to a new picture, showing the consequences of pressing the button; or it might do both!
  • If you have a schematic, you can make the diverse edges (lines) and nodes (boxes) in the schematic clickable. You could use this to add detailed descriptions to steps in a process.
  • In blueprints, you could allow access to more detailed subcomponents in the blueprint in this manner.
  • If you have a photograph of a group of people, you could allow the user to click through to information about each person.
  • In a photograph of a machine or a set of components, you could providelinks to blueprints, detail photos of each component, descriptions, specifications, etc.
  • You could take photos of a number of rooms in a building, and make doors in each room clickable. When one of the doors is clicked, you could "move" the user to the next room. This can be used to make guided tours.
  • ...
  • There are many applications of imagemaps. Since you can use them with any picture, the system is very flexible. Use your imagination!

Why ImageMapEdit?[edit]

Putting an ImageMaps on a wiki is a bit tricky and takes a bit of work. ImageMapeEdit automates and simplifies a large part of the process.

Setup[edit]

Add the following to your monobook.js or vector.js :


Wikipedia (en), Commons
importScript('User:Dapete/ImageMapEdit.js');
Wikipedia (de)
includePage('Benutzer:Dapete/ImageMapEdit.js');

Now, when you view images, you will have an ImageMapEdit button, which gives you access to the user interface.

Editing an ImageMap[edit]

This part of the Howto assumes you have already uploaded the image to the wiki, and are looking at the file description page for that image. See Uploading_files for details (We will use the wikicode generated by ImageMapEdit to replace the wikicode in that document).


Opening the editor[edit]

(These images contained proprietary data. I'll make new ones with with a CC image this weekend. )

When viewing an image on the images page, (our example: Image:PRO_process.jpg), a new link is available, right under the image. Click on this link, and an imagemap editor will appear.

File:ImageMapEditButton.jpg
Location of the ImageMapEdit link (remember: you can click on an image to enlarge)
File:ImageMapEditWindow.jpg
The ImageMapEditor (click on the image to enlarge and view metadata)

Figure: The Editor[edit]

(This image contained proprietary data. I'll make new ones with with a CC image this weekend. )

Error: Image is invalid or non-existent.

Depicted:The ImageMap for the page Pro_processes is taking shape in ImageMapEdit. This image is itself an ImageMap. Mouse over and/or click on parts of the editor in the image for more information.


Deciding where to place hot zones[edit]

With ImageMaps, your Browser can't "see" the underlying image, and relies entirely on the hot zone information you enter. In fact, in theory, you could put any shape of hot zone anywhere on the image, though this might not be particularly useful.

More usefully, typically there are fairly obvious areas of the image which should be clickable. For instance, boxes in a schema, drawings of buttons, people, etc. Sometimes it can be useful to tailor an image to make it more obvious where people are supposed to click.

Create new area (draw a hot zone)[edit]

#rect(angle)#circle#poly(gon)ImageMapEdit Create new area.png

In the ImageMapEdit box, click on the shape you want for your (next) area (hot zone). Then, proceed as follows for that shape.

(Incidentally, the image to the right is an imagemap, click on it to jump directly to the relevant topic)

rect(angle)[edit]

ImageMap rectangle.png

In the image, click your left mouse button in the top left corner of the rectangle you would like to create. (You may not see anything happen yet). Next, click the right mouse button in the bottom right corner of the image.

circle[edit]

ImageMap Circle.png

In the image, click your left mouse button in the center of the circle you would like to create. (You may not see anything happen yet). Next, click the right mouse button somewhere on the radius of the circle.

poly(gon)[edit]

ImageMap polygon.png

In the image, click your left mouse button on the first point of the polygon. (You may not see anything happen yet). Now, continue to click the left mouse button on each corner of the polygon, until the polygon is complete

Edit Area[edit]

ImageMapEdit Edit area.png

Once you have drawn your hot zone (area), you need to specify what the hot zone links to.

  • Link target: Specifies which wiki-page the user should go to, when they click on this hot zone (area).
  • Link Title (Optional): Optionally, you can provide a mouse-over text for the hot zone. By default, if you don't provide a specific mouse-over text, the Link target will appear in the mouse-over text instead.

The other options tweak the hot zone, or allow you to remove it from the ImageMap.

Use the created ImageMap on a page[edit]

ImageMapEdit Generated Wikicode.png

Finally, we are done creating our imagemap. Imagemaps don't exist in a vacuum, they need to be placed on a page. You typically place an ImageMap in a similar way to placing an Image. The ImageMapEdit tool has created the wikicode for us, so all we need to do is copy the code out of the Generated Code box, and paste it to the relevant page.

Note that in this example, some of the links weren't filled in yet. (note the empty [[]] behind some of the items.) Obviously, you want to fill out all the links before posting your ImageMap.

Other Functionality[edit]

General preferences[edit]

ImageMap General Preferences.png

  • you can provide a description for the image (This is only used as alt-text).
  • You can place the "Desc-20.png" information link in a different corner of the image, or leave it out altogether.

Import areas from wikicode[edit]

ImageMap Import areas from wikicode.png

If you have an existing imagemap that you would like to edit, you will need to be able to access it somehow. To get the ImageMap (back) into the ImageMapEdit:

  • click on Show text box >
  • paste the wikicode for the ImageMap into the box.
  • click Import


Q&A[edit]

Q:My wikicode vanished, where did it go?[edit]

Say you have created an Imagemap one day, save it to the page, and go away. A little while later, you notice that you forgot a box, or you have updated the image, or at any rate, you want to revisit the imagemap

However, when you open ImageMapEdit, there's no code! Where did it go?


Answer: ImageMapeEdit is not fully integrated into the wiki. It only generates and reads wikicode.

  • Go to the page where you put the ImageMap, and click edit.
  • Select and copy the ImageMap code
  • Then import that code back into ImageMapEdit. See: #Import areas from wikicode

Q:Can I still resize my image on the page?[edit]

Answer: Sure!

In the imagemap code, just add the size you would like in pixels, just like you would do for an ordinary image; for instance:

Image:ImageMap_Creation.jpg|700px


Q:I Resized my image on the page, do I need to redraw my imagemap now?[edit]

Say you resize the image using the answer provided above, do you need to redraw the ImageMap to fit? Answer: No, fortunately. The ImageMap gets scaled by the same amount as the image, and remains usable as-is.

See Also[edit]