This is an html image mapping designed for web developers.
The tool has been developed using the HTML5 canvas, so its use is limited to the browsers that support the canvas, but also the File API’s:
IE10+, FF3.6+, FF14-, FF18+ (the FF15 have problems with some canvas functionalities, Bug 787623, that will be resolved in FF18), Chrome6+, Safari6+, Opera11.1+
Since this is a tool for developers, I think that this is not a big limitation, because I suppose that a web developer has no problem to choose an appropriate browser.
I have used FF14 to develop the tool, so this is the best choise, but the tool has been tested also in Chrome22 and Opera12
Note: The version of the tool that you can see in the Live Preview link, is a limited version of the tool. With this version you can only load a specific set of images, listed on the home page. After loading an image you can draw all the shapes, but only the first 6 shapes will be generated in the HTML code. This limitation doesn’t prevent you to test all the functionalities of the tool.
What is an image map?
An image map is an HTML code that makes user-clickable different areas of an image. The HTML code consists of the map HTML tag, in conjunction with the area
tag, that allows you to define areas with rectangular, polygonal and circular shapes.
As an example, if you have the image1.png image in your HTML page,
you can write the following code:
<img src="image1.png" width="145" height="126" alt="map example" usemap="#image1map" />
<map name="image1map">
<area shape="rect" coords="0,0,82,126" href="area1.html" alt="area1">
<area shape="poly" coords="108, 145, 174, 71, 205, 139, 153, 192" href="area2.html" alt="area2">
<area shape="circle" coords="124,58,8" href="area3.html" alt="area3">
<area shape="default" href='default.html' alt = "the whole image"/>
</map>
As you can see, you have to set the usemap attribute in the img tag, that will have the same value of the name attribute in the map tag. Between the <map> and </map> you can define as many <area> tags as you want, each one representing a user-clickable area on the associated image. Each area must have a shape attribute, that can have one of the 3 values: rect, poly and circle. The rect shape is completely defined by 2 points, a poly shape is defined by a sequence of points and a circle shape is defined by a point, that represents the center, and a radius. All the points are defined by a couple of coordinates, expressed in pixels, relatives to the top-left corner of the image. The shape attribute can also have the “default” value, that refer to the parts of the image not mapped with any of the previous shapes. Take into account, instead, that the order in which the shapes are defined in the map are very important: if you define the “default” shape as first shape in the map, it will override all the subsequent shapes, because the “default” shape refers to the whole image. This is true also with the shapes that overlap each other: you can define a little shape into a bigger shape, but you have to define first the little shape and then the bigger one. If 2 shapes share a portion of the image, the shape defined first, wins.
If you want to set manually an image map you have to know the coordinates of all the points needed to define the different shapes. Probably this is not a big problem if you have few areas to map, especially if you have circular or rectangular areas. But if you have several areas, with a polygonal shape, set them manually is not a simple task.
The image mapper tool allows you to draw shapes such as rect, poly, and circle on the selected image, that will be translated automatically in the corresponding HTML code that makes the areas of the image user-clickable.
After drawing the shapes on the given image, you can generate the HTML code simply clicking on a button and the code will be displayied in a textarea. You can copy the HTML code and use it in your HTML page(s). You can also do the reverse process: pasting the HTML code in the textarea, you can load this code simply clicking a button; this will be translated in the shapes on the image and you can modify them, add new shapes and re-generate the HTML code. This reverse mechanism is useful to allow you to save a partial mapping process and to continue to map the image later. It is also useful to refine “manually” the shape designing/positioning: after generating the code in the textarea, you can modify the coordinates in the textarea on the fly and re-load it.
You can consult the complete manual of the tool at the following link:Online Manual
If you have any questions, just leave a comment or drop me an email!