imagemap

Gernot Katzlberger knozi at GMX.AT
Mon May 2 08:33:45 EDT 2005


Hi list,
I'm trying to get the imagemap function working. I can create an output and
an imagemap but the ids to the single polygons are missing. How do I get the
ids into the href of the imagemap? The ids should come out of the database.

html-source:
now:
<area href="map.php?id=" title="" shape="poly" coords=" 616,165, 616,167,
613,168, 612,169, 616,165" />
<area href="/map.php?id=" title="" shape="poly" coords=", 607,164, 609,167,
608,168, 608,169, 612,173, 607,164" />

should be:
<area href="map.php?id=state01" title=" state01" shape="poly" coords="
616,165, 612,169, 616,165" />
<area href="/map.php?id=state02" title=" state02" shape="poly" coords=",
607,164, 612,173, 607,164" />


I have a mapfile with the outputformat and one layer defined:

...

OUTPUTFORMAT
  NAME imagemap
  DRIVER imagemap
  MIMETYPE text/html
  FORMATOPTION "POLYHREF=/verifier/map.php?state=%s"
  FORMATOPTION "SYMBOLHREF=#"
  FORMATOPTION "MAPNAME=image_map"
  FORMATOPTION "TITLE=image_map"
  FORMATOPTION "POLYMOUSEOUT=return nd();"
  FORMATOPTION "POLYMOUSEOVER=return overlib('%s');"
END

LAYER
    CONNECTION "user=user password=pwd dbname=db host=localhost"
    CONNECTIONTYPE POSTGIS
    DATA "the_geom from gd_poly_002"
    NAME "see01"
    STATUS ON
    TYPE POLYGON
    UNITS METERS

    CLASS
      NAME "class0"
      STYLE
          COLOR 189 215 231
       SYMBOL 0
      END
    END
  END
...

Thanks,
Gernot



More information about the mapserver-users mailing list