htmlmapdriver(1)	      Grass User's Manual	      htmlmapdriver(1)



NNAAMMEEHHTTMMLLMMAAPP ddrriivveerr - driver to create HTML image maps
       _(_d_r_i_v_e_r_s_)

DDEESSCCRRIIPPTTIIOONNTThhee HHTTMMLLMMAAPP ddrriivveerr aalllloowwss tthhee ggeenneerraattiioonn ooff HHTTMMLL iimmaaggee mmaappss
       for  area  vector  data.  HTML  image maps are used in conjunction with
       images to provide unique URL  targets  for  different  portions	of  an
       image. The HTMLMAP driver can create both client-side image maps embed-
       ded into HTML files, or server-side image maps used by web server soft-
       ware.

       Note  that  GRASS display commands that require the MOUSE will not work
       correctly (or at all!)

       Polygons can at most have 100 vertices  (this  limit  imposed  by  HTML
       image  map  formats,  see  GGRRAASSSS__HHTTMMLLMMAAXXPPOOIINNTTSS  below.) The driver will
       attempt to trim polygons that have more that 100 vertices  by  removing
       vertices  with the least amount of angle to the next vertice. Also, any
       polygon that is entirely bounded by another polygon will be  discarded.

       Text written to the driver before polygons are used as the HREF tag for
       all subsequent polygons written. All polygons that exist  in  a	vector
       file will have the same HREF tag.

       The  only  GRASS  display commands that should be used with this driver
       are:

		     d.text - pass href information for resulting image  maps.

		     d.area - draw polygons from a vector file.



UUSSAAGGEE
   EEnnvviirroonnmmeenntt vvaarriiaabblleessSSeevveerraall eennvviirroonnmmeenntt vvaarriiaabblleess eeffffeecctt tthhee ooppeerraattiioonn
       of HTMLMAP.

		     GGRRAASSSS__WWIIDDTTHH==xxxxxx
		     the width of the image map (default is 640).


		     GGRRAASSSS__HHEEIIGGHHTT==yyyyyy
		     the height of the image map (default is 480).


		     GGRRAASSSS__HHTTMMLLTTYYPPEE==ttyyppee
		     the type of image mape to create (default is CLIENT):
		     CCLLIIEENNTT	   Netscape/IE	  client-side	 image	  map.
		     (NAME="map")

		     AAPPAACCHHEE    Apache/NCSA server-side image map.

		     RRAAWW	 Raw url and polygon vertices (  _u_r_l   _x_1   _y_1
		     _x_2  _y_2 _f_o_r_m_a_t _w_i_t_h _u_s_e_r _s_u_p_p_l_i_e_d _c_o_n_v_e_r_s_i_o_n _p_r_o_g_r_a_m_.



		     GGRRAASSSS__HHTTMMLLFFIILLEE==ffiilleennaammee
		     specifies the resulting file to store the html image map,
		     default is hhttmmllmmaapp. Files without absolute path names are
		     written  in  the  current	directory where the driver was
		     started.

		     _A_n_y _e_x_i_s_t_i_n_g _f_i_l_e _o_f _t_h_e _s_a_m_e _n_a_m_e _i_s _o_v_e_r_w_r_i_t_t_e_n _w_i_t_h_o_u_t
		     _w_a_r_n_i_n_g_.


		     GGRRAASSSS__HHTTMMLLMMIINNDDIISSTT==nn
		     specifies	the  minimum  distance	in pixels that a point
		     must change from the previous point to keep in  the  list
		     of vertices for a polygon.  The default is 22, which means
		     that a point's x and y difference from the previous point
		     must  change  by  a  number  of  pixels greater than this
		     value.  This parameter helps to eliminate closely	spaced
		     points.


		     GGRRAASSSS__HHTTMMLLMMIINNBBBBOOXX==nn
		     specifies the minimum bounding box dimensions to record a
		     polygon as a clickable area.  The	default  is  22,  which
		     means  that  a  polygon  with a bounding box of less than
		     this value is not included. This parameter helps to elim-
		     inate polygons than are a point or line.


		     GGRRAASSSS__HHTTMMLLMMAAXXPPOOIINNTTSS==nn
		     specifies	the  maximum  number of vertices included in a
		     polygon's clickable  area.   The  default	is  9999.   Some
		     browsers  can only accomodate polygons of 100 vertices or
		     less.  The HTMLMAP driver automatically  ensures  that  a
		     polygon  is  closed  by making the last point the same as
		     the first



   TTyyppiiccaall uussaaggee
	      Start up the driver
		       d.mon start=HTMLMAP d.mon select=HTMLMAP


	      Display text strings (HREF's) and polygons
		       echo  "http://www.no-such-place.net/area51/"  |	d.text
	      d.area	 map=area51    echo    "http://www.roswell-nm.net/lit-
	      tle/green/men.html" | d.text d.area map=roswell


	      Stop the driver when all polygon have been displayed. This  will
	      cause  a	file  named  'htmlmap'	to  be created in your current
	      directory.
		       d.mon stop=HTMLMAP


	      You will also want to create an image for your  image  map.  Use
	      the  CELL  driver  and  other utilities to create .gif, .jpg, or
	      .png files
		       #  using  previous  GRASS_WIDTH	&  GRASS_HEIGHT  d.mon
	      start=CELL   d.mon   select=CELL	 d.rast   map=terrain	d.area
	      map=area51  fillcolor=white  linecolor=blue  d.area  map=roswell
	      fillcolor=yellow	linecolor=blue	d.vect map=states  color=green
	      d.vect map=roads	 color=black d.mon stop=CELL # make the region
	      the  same  as  the  newly  created  cell for ppm export g.region
	      save=saved.reg g.region raster=D_cell r.out.ppm -q  input=D_cell
	      output=alien.ppm	#  use	the  netpbm  utilities to create a gif
	      (quantize if needed) ppmquant 128 alien.gif # assemble some html
	      with  the  image	and  the image map echo '<;img src="alien.gif"
	      usemap="#map">;'	      >;alien.html	   cat	       htmlmap
	      >>alien.html			 echo			    ''
	      >;>;alien.html # don't forget  to  reset	your  region  g.region
	      region=saved.reg	#  take  a  look  and  test  it  out  netscape
	      file:`pwd`/alien.html &



NNOOTTEESSHHTTMMLLMMAAPP wwaass aaddaapptteedd ffrroomm tthhee CCEELLLL ddrriivveerr iinn GGRRAASSSS 44..33..
       Point-in-polygon test code was  lifted  from  Randolph  Franklin's  web
       page, see

       http://www.ecse.rpi.edu/Homepages/wrf/research/geom/pnpoly.html

       If  you create an HTML file with two or more images and image maps, you
       will need to edit the map names. The HTMLMAP  driver  creates  its  map
       with  the  name _m_a_p. A small sed script can easily change the map name:
       sed -e 's/NAME="map"/NAME="foomap"/' foomap.html


SSEEEE AALLSSOO_c_e_l_l_d_r_i_v_e_r,
       _X_D_R_I_V_E_R, _d_._t_e_x_t, _d_._a_r_e_a

       _L_a_s_t _c_h_a_n_g_e_d_: _$_D_a_t_e_: _2_0_0_2_/_0_3_/_0_1 _0_0_:_2_7_:_4_5 _$



GRASS 5.0						      htmlmapdriver(1)
