Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
htmlmapdriver(1)	      Grass User's Manual	      htmlmapdriver(1)

       HTMLMAP driver -	driver to create HTML image maps.

       The  HTMLMAP  driver  allows the	generation of HTML image maps 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	embedded  into
       HTML files, or server-side image	maps used by web server	software.

       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  im-
       age  map	 formats,  see GRASS_HTMLMAXPOINTS below.) The driver will at-
       tempt 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
       map will	have the same HREF tag.

       The only	GRASS display commands that should be used  with  this	driver
	      d.text - pass href information for resulting image maps.	d.vect
	      -	draw polygons from a vector map.

   Environment variablesSeveral	environment variables affect the operation
       of HTMLMAP.
	      the width	of the image map (default is 640).  GRASS_HEIGHT=yyy
	      the height of the	 image	map  (default  is  480).   GRASS_HTML-
	      the type of image	mape to	create (default	is CLIENT):
	      CLIENT	Netscape/IE client-side	image map.  (NAME="map")
	      APACHE	Apache/NCSA server-side	image map.
	      RAW	   Raw	url and	polygon	vertices ( url	x1  y1	x2  y2
	      format with user supplied	conversion program.

	      specifies	the resulting file to store the	html  image  map,  de-
	      fault  is	htmlmap. Files without absolute	path names are written
	      in the current directory where the driver	was started.
	      Any existing file	of the same name is overwritten	without	 warn-
	      ing.  GRASS_HTMLMINDIST=n
	      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 2, 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.	GRASS_HTMLMINBBOX=n
	      specifies	the minimum bounding box dimensions to record a	 poly-
	      gon  as  a clickable area.  The default is 2, which means	that a
	      polygon with a bounding box of less than this value is  not  in-
	      cluded.  This  parameter	helps to eliminate polygons than are a
	      point or line.  GRASS_HTMLMAXPOINTS=n
	      specifies	the maximum number of vertices included	in a polygon's
	      clickable	 area.	The default is 99.  Some browsers can only ac-
	      commodate	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 point.

   Typical usage
	      Start up the driver
	      d.mon start=HTMLMAP
	       Display text strings (HREF's) and polygons
	      echo "" | d.text
	      d.vect map=area51
	      echo "" | d.text
	      d.vect map=roswell
	       Stop the	driver when all	polygon	have been displayed. This will
	      cause  a	file named 'htmlmap' to	be created in your current di-
	      d.mon stop=HTMLMAP
	       You will	also want to create an image for your image  map.  Use
	      the PNG driver and other utilities to create .gif	or .jpg	files.
	      The following example is somewhat	out of date and	refers to  op-
	      tions available in GRASS 5.
	      #	using previous GRASS_WIDTH & GRASS_HEIGHT
	      d.mon start=PNG
	      d.mon select=PNG
	      d.rast map=terrain
	      d.vect map=area51	 fillcolor=white  linecolor=blue
	      d.vect map=roswell fillcolor=yellow linecolor=blue
	      d.vect map=states	 color=green
	      d.vect map=roads	 color=black
	      d.mon stop=PNG
	      #	make the region	the same as the	newly created cell for ppm ex-
	      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.ppm |	 ppmtogif >alien.gif
	      #	assemble some html with	the image and the image	map
	      cat						       htmlmap

	      #	don't forget to	reset your region
	      g.region region=saved.reg
	      #	take a look and	test it	out
	      netscape file:`pwd`/alien.html &

       HTMLMAP	was adapted from the CELL driver in GRASS 4.3.	Point-in-poly-
       gon test	code was lifted	from Randolph Franklin's web page, see

       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 map. A small sed script can easily	change the map name:
	 sed -e	's/NAME="map"/NAME="foomap"/' <	htmlmap	> foomap.html

	Display	drivers
       PNG driver, PostScript driver, XDRIVER
       d.mon, d.text, d.vect

       Last changed: $Date: 2016-08-18 08:50:38	+0200 (Thu, 18 Aug 2016) $

       Full index

       (C) 2003-2016 GRASS Development Team

GRASS 6.4.6						      htmlmapdriver(1)


Want to link to this manual page? Use this URL:

home | help