Login Register Wishes Forum About
Language Reference » Image Maps » addToImageMap
Help topics
Latest updates
4640d  replaceImageMapTitle
4640d  replaceImageMapValues
4640d  createFunctionSerie
4640d  setAbsicssaPosition
4640d  negateValues
  Download as PDF
  Print this page
  Share this page
  Create an account
  Feed the updates!
Google AdSense
addToImageMap - Add an element to your image map

This function allows you to add a zone in your image map.

Calling this function
Where :

Type is the type of zone (RECT,CIRCLE,POLYGON)
Plots is the list of points defining the area.
Color is an HTML formated color.
Title is the title of the image map boxes displayed over this zone.
Messageis the message contained in the image map boxes displayed over this zone.

Note that the area Type are the one defined in the HTML standards. A circle is defined by 3 points (X,Y,Radius), a rectangle by 4 points (X1,Y1,X2,Y2) and a polygon by any even number of points.

Sample script

This will create a file named /tmp/ to store the image map coordinates on the server.
 /* Library settings */
 define("CLASS_PATH", "../../../class");
 define("FONT_PATH", "../../../fonts");

 /* pChart library inclusions */

 /* Create the pChart object */
 $myPicture = new pImage(700,230,$MyData);

 /* Set the image map name */

 /* Add a circle area to the image map */
 $myPicture->addToImageMap("CIRCLE","100,100,30","#FF0000","Circle area","This is a red area");

 /* Add a rectangular area to the image map */
 $myPicture->addToImageMap("CIRCLE","200,100,300,100","#00FF00","Rectangle area","This is a green area");

 /* Add a polygonal area to the image map */
 $myPicture->addToImageMap("POLYGON","20,20,60,20,50,50","#0000FF","Polygon area","This is a blue area");
Last updated on 08/04/2011 
by Jean-Damien 
Linked resources
  There is no linked topic yet.
Community comments
  No comments have been posted yet.
© Copyrights
Components used on this web site : Famfamfam icons has been made by Mark James, Rounded corners lite has been coded by Cameron Cooke and Tim Hutchison, SyntaxHighlighter has been written by Alex Gorbatchev. pChart and this web site have been created by Jean-Damien POGOLOTTI. This documentation contains 185 pages and 56 comments. 415 users have registered. This page has been rendered in 0,01 seconds. Wiki revision 1.37.