OutputFormat ImageMap, PostGIS and SymbolHref

Rob P. rob at DATAFLOWDESIGN.COM
Thu May 19 12:11:03 PDT 2005


>>>>> "Jean" == Jean David TECHER <davidtecher at YAHOO.FR> writes:

    Jean> Hi I have a mapfile in imagemap outputformat with a layer
    Jean> with a PostGIS layer I use mapserver cvs

    Jean> ...
    Jean> The imagemap works fine on a postgis layer with
    Jean> type polygon but doesn't to work for type point
    Jean> I means that from the '%s' gave me only the layer's name
    Jean> (baigande21) ...I got from FormatOption
    Jean> affichage_popup('./info.php?uid=baignade21&dept=21','popup1')"

    Jean> Is it possible to get something like

    Jean>    affichage_popup('./info.php?uid=0&dept=21','popup1')"
    Jean> affichage_popup('./info.php?uid=1&dept=21','popup1')"
    Jean> affichage_popup('./info.php?uid=2&dept=21','popup1')"

    Jean> and so on Or did I have to modify
    Jean> mapserver/mapimagemap.c????
    Jean> ...

Jean,
This has worked for me in OUTPUTFORMAT:
FORMATOPTION "POLYMOUSEOUT=return out(this);"
FORMATOPTION "POLYMOUSEOVER=return overlib(event,'%s',this);"

Rather than returning a point geometry, return a polygon. For
instance:  select buffer(centroid(the_geom),dist)

I am not sure how I was able to get the desired data into %s. It's
been a couple of months now. I think I controlled it using a sub
select in the sql. I experimented with such things as LABELITEM but
don't recall if it did any good.

But I will share a snippet from my map file:

LAYER
   NAME "cseis"
   CONNECTION "user=bogus password=bogus dbname=mydb"
   CONNECTIONTYPE postgis
   DATA "the_geom from (select oid as oid,
   buffer(simplify(the_geom,.001),.0010, 2) as the_geom, line_id, contractor
   from vw_seismic_2d)
   as cseis USING UNIQUE oid USING SRID=-1"
   Projection "proj=latlong" End
   TYPE polygon
   Class
      Name "cseis"
      OUTLINECOLOR 0 0 0
   END
   ##FILTERITEM   ?? No effect ??
   LabelItem "line_id"   ## Not sure if this controlled %s
END

I had one problem using imagemaps. If the result set was empty, my
script crashed.

Rob



More information about the MapServer-users mailing list