| 1 |
lars |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
|
|
2 |
<HTML>
|
|
|
3 |
<HEAD>
|
|
|
4 |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1">
|
|
|
5 |
<LINK REL="Start" HREF="index.html">
|
|
|
6 |
<LINK REL="Contents" HREF="toc.html">
|
|
|
7 |
<LINK REL="Prev" HREF="6UsingimagemapswithJpGraph.html">
|
|
|
8 |
<LINK REL="Next" HREF="62Specifyingtargetsforimagemapplots.html">
|
|
|
9 |
<STYLE TYPE="text/css"><!--
|
|
|
10 |
BODY { font-family: serif }
|
|
|
11 |
H1 { font-family: sans-serif }
|
|
|
12 |
H2 { font-family: sans-serif }
|
|
|
13 |
H3 { font-family: sans-serif }
|
|
|
14 |
H4 { font-family: sans-serif }
|
|
|
15 |
H5 { font-family: sans-serif }
|
|
|
16 |
H6 { font-family: sans-serif }
|
|
|
17 |
SUB { font-size: smaller }
|
|
|
18 |
SUP { font-size: smaller }
|
|
|
19 |
PRE { font-family: monospace }
|
|
|
20 |
A { text-decoration: none }
|
|
|
21 |
--></STYLE>
|
|
|
22 |
</HEAD>
|
|
|
23 |
<BODY>
|
|
|
24 |
<A HREF="toc.html">Contents</A>
|
|
|
25 |
<A HREF="6UsingimagemapswithJpGraph.html">Previous</A>
|
|
|
26 |
<A HREF="62Specifyingtargetsforimagemapplots.html">Next</A>
|
|
|
27 |
<HR NOSHADE>
|
|
|
28 |
<H2><A NAME="6_1">6.1 The basic structure of an image map script</A></H2>
|
|
|
29 |
<P> The standard structure for an HTML page using client side image maps
|
|
|
30 |
would be something along the lines of</P>
|
|
|
31 |
<P></P>
|
|
|
32 |
<PRE>
|
|
|
33 |
// Image map specification with name "mapname"
|
|
|
34 |
<MAP NAME=...>
|
|
|
35 |
... specification ...
|
|
|
36 |
</MAP>
|
|
|
37 |
|
|
|
38 |
// Image tag
|
|
|
39 |
<img src="..." ISMAP USEMAP="mapname">
|
|
|
40 |
</PRE>
|
|
|
41 |
<P> This poses an interesting question.</P>
|
|
|
42 |
<P> Since we normally call the graphing script directly in the <img> tag
|
|
|
43 |
how do we get hold of the image map (which is available only in the
|
|
|
44 |
image script) in this "HTML wrapper" script?</P>
|
|
|
45 |
<P> In JpGraph there is actually two ways of solving this.</P>
|
|
|
46 |
<OL>
|
|
|
47 |
<LI> Use the preferred "builtin" way using the modified Stroke() method
|
|
|
48 |
Graph::StrokeCSIM() instead of the standard Graph::Stroke() method.</LI>
|
|
|
49 |
<LI> Directly use the Graph::GetHTMLImageMap() which gives you fine
|
|
|
50 |
control at the expense of more complex coding.</LI>
|
|
|
51 |
</OL>
|
|
|
52 |
<P> The first (and preferred) way modifies the stroke method so that
|
|
|
53 |
instead of returning an image (like the standard Stroke() method)
|
|
|
54 |
StrokeCSIM() actually returns an HTML page containing both the image
|
|
|
55 |
map specification and the correct <IMG> tag.</P>
|
|
|
56 |
<P> This of course means that it is necessary to treat an image map
|
|
|
57 |
returning image script differently from a non-CSIM image script, for
|
|
|
58 |
example you can't use it directly as the target for the "src" attribute
|
|
|
59 |
of the <IMG> tag since it sends back an actual HTML page containing
|
|
|
60 |
both an image tag together with an image map.</P>
|
|
|
61 |
<HR NOSHADE>
|
|
|
62 |
<A HREF="toc.html">Contents</A>
|
|
|
63 |
<A HREF="6UsingimagemapswithJpGraph.html">Previous</A>
|
|
|
64 |
<A HREF="62Specifyingtargetsforimagemapplots.html">Next</A>
|
|
|
65 |
</BODY>
|
|
|
66 |
</HTML>
|