imagemap not following bounding box

Adrian Versteegen A.Versteegen at BOM.GOV.AU
Mon May 22 21:35:33 EDT 2006


Hi,

I am trying to produce an imagemap using mapserver 4.8.3 cgi. The issue
is that I can't seem to make it respect the bounding box or image size
specified in the url request. 

When trying the shp2img utility with the -e flag, the extents are obeyed
and the html is produced for the restricted area.

The image and the imagemap are produced by a perl script calling the
mapserv executable with the following commands:
http://my_url/mapserver/mapserv?map="/mapserver/simple.map&version=1.1.1&service=WMS&request=GetMap&layers=${layers}&bbox=${bbox}&height=${height}&width=${width}

http://my_url/mapserver/mapserv?map="/mapserver/simple.map&qlayer=name_tag&mode=nquery&searchmap=true&bbox=${bbox}&height=${height}&width=${width}

The aim being that with the bbox, height and width variables we can
alter the image to suit a particular client. This works well with the
image but the imagemap insists on sticking to the size and extent from
the original map file.

How do we make the imagemap use the bounding box and size restrictions?
Or am I going about it the hard way and should be using mapscript?

Thanks,
Adrian


Extract of map file:

MAP
  NAME "WEATHER"
  SIZE 600 600
  UNITS kilometers
  EXTENT 0 0 5232 5965
  SHAPEPATH "/shp/"
  FONTSET "fonts/font.list"
  SYMBOLSET "symbols/symbols.dat"
  IMAGECOLOR 172 212 232

  WEB
    TEMPLATE "/htdocs/aust.html"
    IMAGEPATH "/temp/"
    IMAGEURL "/temp/"
  END

  PROJECTION
     "proj=merc"
  # coordinates are of lower left corner
     "lon_0=111e"
     "y_0=6075085" # 48.0s
     "units=km"
  END

  OUTPUTFORMAT
    NAME png
    DRIVER "GD/PNG"
    MIMETYPE "image/png"
    IMAGEMODE PC256
    EXTENSION "png"
  END
   OUTPUTFORMAT
     NAME imagemap
     DRIVER "imagemap"
     MIMETYPE "text/html"
   END

  LAYER
    NAME name_tag
    STATUS on
    DATA 'latest_obs'
    PROJECTION
      "proj=latlong"
    END
    TYPE point
    LABELITEM "Name"
    TEMPLATE "bodytemplate.html"
    HEADER "imapheader.html"
    FOOTER "imapfooter.html"
    CLASS
     COLOR -1 -1 -1
     LABEL
        POSITION AUTO
        OFFSET 1 1
        TYPE TRUETYPE
        FONT verdana
        ANTIALIAS true
        SIZE 8
        COLOR 0 0 0
      END
    END
  END # end layer

<other layer details....>
END # map file

bodytemplate.html:

<area shape="circle" coords="[shpxy precision=0 proj=image yf=",7"
xf=","]" href="target_[Name].shtml" title="[Name]" alt="[Name]">



More information about the mapserver-users mailing list