WESTERN REGION TECHNICAL ATTACHMENT
NO. 96-14
July 9, 1996
IMAGE MAPPING ON HOMEPAGES
Elisa Brewerton - WRH-SSD Salt Lake City, UT
Casidy Hallsten - WRH-SSD Salt Lake City, UT
Editor's Note: Internet and homepage capability provide an opportunity for the offices to develop experimental service products and conduct tests/evaluations with various user groups at very minimal costs. This Technical Attachment (TA) highlights a very simple but user-friendly approach to graphically select products.
Homepages can be set up using several different formats: simple HTML code, image maps, and Java Applets. During the last several months, a few Western Region (WR) sites have begun to link maps to forecast text. This link allows the user to select a point on a graphic map, the software then displays the observation for a forecast associated with that area of the map. This TA documents how to create image maps.
An image map is a picture divided into several areas. When an area is selected, a link is made. This link may take the user to another homepage, another area of the same homepage, or to specific data related to the area chosen from the image map. Image maps help to produce professional and user-friendly world wide web (WWW) pages.
First: the Image. There are a number of image creation and editing programs that may be used to construct an image. Two examples are Corel Photo Paint (DOS compatible software) and Xpaint (UNIX compatible software). It is important to note that all image files, regardless of which program is used to create the files, need to be saved as GIF files.
Corel Photo Paint was the editing program used for the Western Region Homepage. It has the capability to scan in a hard copy of an image, combine several images, or create an image from scratch. Corel Photo Paint is the software that was delivered with the new HP scanners, therefore, it should be available to all WR offices. If the image is created using Corel Photo Paint, you will need to FTP the file to the homepage server.
Xpaint is also available to use when creating an image file. This program can be downloaded from the WR server, in /users/http, titled xpaint-2.1.1.tar.Z. (We could not find an FTP site for xpaint.) Once the file has been downloaded, it will need to be decompressed and installed.
Second: the MAP File. A MAP file contains the coordinates of each geometric region you wish to make active and the corresponding URL links. More generally, the MAP file maps regions of the image to given URLs. Mapedit is a user-friendly program which creates MAP files.
For those people whose homepage is on the WR server, Mapedit is available on this system. Otherwise, Mapedit can be downloaded from http://www.boutell.com. Mapedit is not shareware; and a $25 registration fee is required.
Once the image has been opened, you can outline the desired regions. The menu at the top will allow you to select circle, polygon, or rectangle shapes.
Each method is evaluated in the order it is placed on the image. If you have overlapping areas, such as a circle inside of a rectangle, you should outline the shape you want evaluated first before outlining the other with Mapedit. When complete, a MAP file is generated with the MAP file extension (i.e. ".map").
The MAP file generated using Mapedit will look similar to the following if viewed with an editing tool:
method URL coordl coord2 ... coordnIf preferred, other methods for creating MAP files can be found. A MAP file can be created without the use of a MAP-generating program, by using xv to locate the coordinates and manually creating the MAP file.
Third: Referencing the MAP File in HTML Code. HTML code needs to be created to reference the map.
Image map, a CGI program, resides on the WR server. This program resides in the cgi-bin directory. For those not on the WR server, the image map program should be located in the cgi-bin directory on your server. The image map program interprets the coordinates and links within the associated MAP file.
The HTML code needs to be inserted into your homepage code. Using the internal image map support of NCSA HTTPD 1.5:
User_directory is where your homepage is saved. For example, the image map for the WR Headquarters is located in the user_directory, wrh. The image resides in a sub_directory of the WR user_directory, so to reference the image: "/wrh/PICS/image.gif" (where PICS is the directory in which the image lies).
An example taken from the WR image map:
Image maps make it easy to link text products to the visual tool of an image. The incorporation of image maps into the WWW makes the information included in the image map readily available to the public. David Zaff (NWSFO/SLC) was one of the first to use this approach on a homepage. His and other examples of image maps are listed below.
NWSFO/SLC = http://nimbo.wrh.noaa.gov/Saltlake/slc.noaa.html#Utah forecasts
WRH/SSD = http://www.wrh.noaa.gov
NWSFO/BOI = http://www.boi.noaa.gov/gdforecast.html
NWSFO/SEA = http://www.wrc.noaa.gov/nws
NWRFC = http://www.nwrfc.noaa.gov