If you use the Mac-ImageMap together with WebSTAR you are able to take benefit from a new, unique feature of WebSTAR - the user action concept. Based on this, you are able to avoid running into a difficulty which has been introduced to the WEB by a bug in most versions of the CERN-proxy gateway software (running on UNIX hosts!). Additionally, configuring of Mac-ImageMap will be easier when run as a user action handler. See below for more information on this.
Mac-ImageMap is Freeware, but not public domain. This means, that it may be used without paying a fee for it, for non-commercial purposes. All rights to the program remain reserved to me, the author. See also the disclaimer near the end of this file. If you wish to use this program for a commercial purpose, you are obliged to contact me for usage conditions. The unmodified program may be freely distributed together with this README-file and the supplied sample files, for no charge - except an optional small handling fee that covers the costs (max. 2,- US$ for a floppy disk plus mailing costs). Permission for distribution of the program on Shareware CD-ROM volumes is granted.
Mac-ImageMap is a WebSTAR and MacHTTP tool - designed to map clicks on a HTML ISMAP picture to an URL which is specified in an imagemap map-file. The current program version can assign URLs to rectangular regions, circle regions, elliptic regions and arbitrary poly-regions. Additionally, for the remaining picture parts which are not assigned to specific regions, special points may be defined and URLs associated with them - the URL of the nearest of these points to the clicked point will apply.
Mac-ImageMap is a standalone program, which needs no additional scripting language to be used, and such, it does its task quickly and efficiently.
Please report bugs and problems to weimann@zib-berlin.de. See below on what information is needed or useful within a bug or problem report. Any reported bug I will try to fix within a future version, if possible.
There is also a demopage available for running Mac-ImageMap as
a user-action map handler (only possible with WebSTAR) , under the
URL http://your.host/imagemap/demomap/demomap2.html.
But, before you can run the user-action handler demo, you must add a
user action and a suffix mapping to your WebSTAR server, like
this:
ACTION MAP :imagemap:imagemap.cgi
You can do this in a convenient way by using your WebSTAR
admistration application program. For details on how to do this,
please refer to the WebSTAR documentation.
SUFFIX MAP .map TEXT * text/html
Important:Within the ACTION statement, the pathname to the imagemap.cgi application must be expressed relative to that folder where the WebSTAR application program resides. Also, the imagemap.cgi application file must reside within the WebSTAR folder hierarchy and the pathname in the ACTION statement must refer to the imagemap.cgi application file, but not to an alias of it. Mac-ImageMap fails to proper work as a user-action handler if these rules are not followed and e.g. instead a full filename-path (starting with your harddisk-name) is entered!Note that you may use instead of the user-action name "MAP" any not predefined name which may be convenient for you.
Before trying to make your own clickable maps, please read the MacHTTP or WebSTAR documentation. Especially, you should be already familar with the concept how URLs are handled by your Web-server software. Also, if you are referencing Macintosh file aliases within your URLs, read everything what deals with alias handling in the server software documentation. If the scheme how file aliases are handled, does not seem to be clear to you, please do not use aliases in connection with making your first own clickable map!
To create quickly your own clickable map, follow these steps:
<A
HREF="http://your.host/imagemap/imagemap.cgi$mapname"> <IMG
SRC="http://your.host/imagemap/your_example/map_picture.gif"
ISMAP></A>
. <A
HREF="http://your.host/imagemap/your_example/map_picture.map"><IMG SRC="http://your.host/imagemap/your_example/map_picture.gif"
ISMAP></A>
.imagemap.config
file, which tells the program
imagemap.cgi
the name of the map-definition file that
should be used with the given mapname. The line must look like
this:mapname : :your_example:map_picture.map
.
For this definition line and the HTML snippets above, it is asumed
that you have created a subfolder within the imagemap
folder named your_example
, and that you have put your
GIF-map-picture into the subfolder and named it
map_picture.gif
. Furthermore, you must also have put
your generated imagemap-definitions file into the subfolder and have
named it map_picture.map
.
http://your.host/imagemap_folder/imagemap.cgi$mapname?xp,yp
http://your.host/your_map_folder/your_map_name.mapsuffix?xp,yp
xp,yp
are pixel coordinates.
<A
HREF="http://your.host/imagemap_folder/imagemap.cgi$mapname"><IMG SRC="http://your.host/pictures/map_picture.gif"
ISMAP></A>
or, for the user-action handler case by HTML-code like that
<A HREF="http://your.host/your_map_folder/your_map_name.mapsuffix"
> <IMG SRC="http://your.host/pictures/map_picture.gif"
ISMAP></A>
.
ACTION <any name> <relative path to the
"imagemap.cgi " application>
SUFFIX <any name> .mapsuffix TEXT * text/html
If you wish to use the program with multiple WebSTAR servers
which run on the same machine, but on different ports, then use the
$ServerPath-specification (see below) in the
"imagemap.config"-file to specify the Macintosh file-pathes
to the root (e.g. application program) directories of those servers
where the "imagemap.cgi" does not reside within the folder
hierarchy.
The $ServerPath specification is a line in the
"imagemap.config"-file like this
$ServerPath : <file-path> <portnumber>
where <file-path> is the Macintosh-style file-path to that
folder where the WebSTAR application resides in which runs on port
<portnumber>. If the file-path contains embedded blanks it must
be enclosed by double-quotes ("). Double-quotes itself and also
any other character can be represented in the quoted file-path by
preceeding it with the "escape character" backslash.
Note that, if you identify a WebSTAR server to Mac-ImageMap by a
$ServerPath-line, the path-file reference within this servers ACTION
specification for Mac-ImageMap must not necessarily follow any of the
rules which are outlined above for the case of one WebSTAR server and
no "imagemap.config"-file.
CGI .CGI APPL * text/html
,ACGI .ACGI APPL * text/html
.mapname1 : :subfolder_of_imagemap:map1.map
mapname2 : MyHardDisk:maps:map2.map
.
$HostName : <your host alias name>
$HostName : <your host alias name>:<portnumber>
$HostName : www.your.domain
$HostName : www2.your.domain:8000
Furthermore a string of a length up to 255
characters, which may contain the WWW-Server administrators
name and e-mail address, can be specified on a single line:
$ServerAdmin : administrators reference string
.
The string must not be enclosed in quotes, and it may carry imbedded
HTML-tags. Mac-ImageMap uses this string within some possible HTML error
messages.
Further, if you wish to let Mac-ImageMap immediately quit when it
has done its work for the moment, instead of letting it stay open,
you may add a line
$StayOpen : -1
to the configuration file to make the program behave such.
Finally comment lines, which may be included within the file, start with a hashmark sign "#" in the first column. For even more readability, also blank lines are permitted within the file. However, if a line starts with the character sequence #$, these two characters are deleted from this line and the remaining characters in the line will be read as some specification. Review the sample imagemap.config file for details.
Now, an explanation of the imagemap-definition file
format follows. You should also study the sample map file DemoPicture.map in the demomap
folder. The demomap example may look a bit boring, but it
demonstrates all features in principle which are provided by
Mac-ImageMap. You may run this example by opening the URL
http://your.host/imagemap/demomap/demomap.html
(provided that you have put the Mac-ImageMap distribution files into
a subfolder of the MacHTTP folder named "imagemap").
Note: An imagemap-file may be easily created from a picture (PICT or GIF format) in a WYSIWYG manner, using the Shareware-Utility WebMap (available from the umich archive).
Warning:If you have generated your map-definition file by using a non-Macintosh utility, be sure to have this text file converted to follow the usual Macintosh line-endings conventions, e.g. to have a CR-character (Ascii decimal 13) at the end of each line. The same holds for the configuration file.
redirect_url
may either be replaced by a full URL (which
can start with http:, ftp:, gopher:, file:, news:, telnet:, or
mailto:) or by a partial URL - this means an URL on your server
without the http://your.host part. Note, that a partial URL always
starts with a slash "/" .
Mac-ImageMap supports the following
region specifications (and other):
testmode
default redirect-url
(NCSA-imagemap and WebMap compatible)
point redirect_url x_pt,y_pt
(NCSA-imagemap compatible)
x_pt,y_pt
.
If one or more point
specifications appear within a
map-file and the clicked point does not lie within any specified
region, then that URL applies which is assigned to the nearest point
with respect to the clicked point - instead of an URL which has been
assigned in a default
specification.
rect redirect_url x_left,y_up x_right,y_low
(NCSA-imagemap and WebMap compatible)
(x_left,y_up)
and lower-right
pixel-coordinates (x_right,y_low)
. Mac-ImageMap also
allows the definition of a rectangle by the two other two rectangle
corners, which lie diagonally opposite. Also, the ordering of the
defining corners is not mandatory.
circle redirect_url x_center,y_center
x_margin,y_margin
(NCSA-imagemap compatible)
(x_center,y_center)
(-pixel coordinates) and
any point (x_margin,y_margin)
of the circles margin.
circ redirect_url x_left,y_up x_right,y_low
(WebMap 1.0/1.0.1 compatible)oval redirect_url x_left,y_up x_right,y_low
(WebMap 2.0 compatible)poly redirect_url xp_1,yp_1 xp_2,yp_2 ... xp_n,yp_n
(NCSA-imagemap and WebMap compatible)
n
corner points
(xp_1,yp_1),...,(xp_n,yp_n)
. The last point may match
the first one, but this is not necessary required. In any case,
Mac-ImageMap internally connects the first and the last point
(virtually) with a line to define properly an area. Mac-ImageMap can
handle polygon definition with up to 2000 points.
Note about compatibility: NCSA-imagemap allows only 100 points.
You may get the latest version of Mac-ImageMap from
the Mac-ImageMap homepage
http://weyl.zib-berlin.de/imagemap/Mac-ImageMap.html .
The latest Version of MacHTTP is available from the
MacHTTP homepage, URL:
http://www.biap.com/,
or from the Sumex Macintosh ftp-archive, in the
directory
/comm/tcp/ . Note that this is subject to change soon, since
MacHTTP licensing requests are now (since 2th
May 1995) handled by StarNine
Technologies, Inc..
To get information on WebSTAR, look at the StarNine Technologies, Inc.
pages or send e-mail to
info@starnine.com.
Mac-ImageMap has been written in an extended Fortran 77 language, and compiled and linked under MPW, using the Language Systems Fortran 3.3 Compiler for the 68k-code, and the Language Systems Fortran PPC 1.1 for the PPC-code. Therefore, the binary program carries the Language Systems Corp. copyright note, which must be left intact in all copies of the program:
Copyright 1988-1995 Language Systems Corp. Certain portions of this software are copyrighted by Language Systems Corp.
Thanks to Chuck Shotton, the author of the MacHTTP and WebSTAR
WWW-server software,
for
creating MacHTTP and WebSTAR, and the search-example C-source code,
which clearly
demonstrates how to implement the WWWOmegasdoc-AppleEvent
handling.
Thanks also to D.L. Meyer, whose REXX routine for handling the WWW
Imagemap
processing under the OS/2 gopher server has given me a first idea to
the Fortran
implementation of the imagemap-module.
Problem fixed with the handling of reverse-domain addresses with certain MacTCP configurations, only affects MacHTTP users and users of WebSTAR versions before 1.2.
The $ServerAdmin string may now take a maximum of 255 characters (was 64 before). This provides a greater flexibility for inserting HTML tags and suchlike.
The $HostName - configuration file specification has been re-implemented as an option to replace the IP-name or number and portnumber which is obtained by Mac-ImageMap from WebSTAR or MacHTTP. This allows you the convenient use of hostname aliases like "www.your.domain" with Mac-ImageMap.
List of error messages and registration form revised.
Compiled the PPC native program with the new LS Fortran PPC version 1.1 which now generates a more compact and faster code.
95/08/18 : version 1.4 final release
Documentation revised.
Registration form added.
95/08/10 : version 1.4 fc3
The region type "oval" as a synonym for "circ"has been added to ensure compatibility with WebMap 2.0.
A bug, which could cause an inappropriate "syntax error "message for the last definition in a map-definition file under certain conditions, has been fixed
A parser bug has been fixed: leading blanks in a line of a map-definition file are now skipped within specification lines, and the specification now is recognized.
Referencing an alias of a map-definition file in the "imagemap.config" by a relative file-path now works (this problem was only of relevance when running the program as a CGI or ACGI).
95/08/04 : version 1.4 fc2
Some error messages are revised.
Created the list of explained errors.
A bug related to the handling a reverse-domain in-addr.arpa address
as the own servers address has now finally been fixed.
A WebSTAR or MacHTTP server may now use DNS
to resolve the name of other hosts even if it itself has no
hostname.
A bug, which disabled the usage of map-files outside the WebSTAR/MacHTTP folder hierarchy in the CGI/ACGI version, has been fixed.
95/07/27 : version 1.4 fc1
Resolving folder- and volume-aliases is now supported. Volume aliases have been tested to work for ejectable and non-ejectable harddisks, network volumes (AppleShare, NFSShare) and floppies.
The PowerMac native version has now the same functionality as the 68k-code.
The about-box text has been updated.
95/06/08 : version 1.4 beta4
First PowerMac native version released.
Bugs fixed and configuration problems checking slightly improved.
95/05/23 : version 1.4 beta3
Added support for running Mac-ImageMap as an ACTION-handler with multiple WebSTAR servers by the implementation of the $ServerPath configuration file specification.
95/05/18 : version 1.4 beta2
Added a proper HTML-error message for the case that the file-path name of the map-file cannot be build, because the necessary rules how to express the ACTION-path in the ACTION statement were not followed.
Added to the documentation the hint that the ACTION-path must not reference a file alias.
95/05/16 : version 1.4beta1
New features:
Support added for running "imagemap.cgi" as a user-action handler with the commercial WebSTAR server, instead of a CGI. This allows you to direct reference the map-definition file within the ISMAP HTML, instead of indirectly referencing by the path argument of the CGI "imagemap.cgi" . Such, you avoid that users, who connect to you server through a certain older version CERN-proxy gateway, cannot use your map because the URL sent is mistakely changed by the proxy-gateway.
If the imagemap.cgi is *exclusively* run as a user-action handler, the imagemap.config file is no longer necessarily needed.
"$StayOpen : 0" is now the default option, e.g. imagemap.cgi remains be opened after once launched. You can still make imagemap.cgi immediately quitting by including "$StayOpen : -1" in the imagemap.config file.
HostName (or IP address) and portnumber are no longer obtained from the config file, but instead from the MacHTTP or WebSTAR application AppleEvent. This makes it now easier to use Mac-ImageMap with multiple MacHTTP or WebSTAR servers running on the same Macintosh.
$RefURL introduced as a special URL which can be specified
in any place in a map where an URL is a valid parameter.
$RefURL is substituted by the X-Referer-URL, e.g. the URL of the
HTML-page where the clickable map has been invoked.
If a diagnostic or error HTML page is returned, the Server: HTTP-header line reflects whether imagemap.cgi runs with MacHTTP or WebSTAR.
Bug fixes and miscellaneous small enhancements:
imagemap.config parsing bug fixed, which caused in rare situations a crash or endless loop.
Increased the Finders memory size of the "imagemap.cgi" application to 250K to prevent casually crashes of the program on PowerMacs due to memory shortage.
Mapfile parsing bug fixed, such that now multiple blanks are allowed as parameter seperators in (hopefully!) any context.
Negative numbers are now accepted in coordinate pairs.
TestMode output heading changed to make clear that diagnostic output results from testmode flag setting or, alternatively, a missing default URL.
A small bug in the text of the"Invalid input ..." HTML error message has been fixed.
94/12/07 : version 1.3
Included support for the required AppleEvent Quit.
Improved error handling. Mostly all error dialogs (except those which display when unusual AppleEvent errors show up) are now replaced by HTML-error messages which are sent to the Web-client.
Fixed a bug which caused Mac-ImageMap hang in an endless loop, if called with a map-name which has not been defined within the config-file, or caused to do not find a map which was defined near the end of the config-file.
94/12/01 : version 1.2.2 (Maintenance release)
Fixed a bug that caused Mac-ImageMap run into an endless loop of error dialogs when a map-specification file contains invalid lines. The error dialog now only shows up once, and processing of the map-file continues with the next specification.
94/11/16 : version 1.2.1 (Maintenance release)
Fixed a bug that might cause to crash Mac-ImageMap if the config-file or the map-file is missing (or couldn't be opened due to some other reason).
Further tuned memory usage such that the program now runs with a Finder size of 195K.
Speed improved slightly.
94/11/14 : version 1.2
Added support for partial URLs.
Added support for nearest POINT specification.
The CIRCLE specification is now compatible with the NCSA-imagemap program (while CIRC remains compatible with the WebMap output)
Internal string handling has been optimized to speed up the program and to save storage.
The InSide-polygon check is no longer based on Quickdraw toolbox routines.
94/10/28 : version 1.1:
Added support for arbitrary poly-regions.
Region specifications may now run over multiple lines.
Added an option to let Mac-ImageMap stay open until manually terminated.
94/09/26 : version 1.0, bug fix level 1:
Appended two carriage-return sequences to the "HTTP/1.0 302 Found" redirect header to match the strict http-standard.
94/09/16 : version 1.0, bug fix level 0:
First public release.