client-side image map

Steve Lime steve.lime at DNR.STATE.MN.US
Tue Jul 12 18:32:02 EDT 2005


David: I've not used the IMAGEMAP driver so I don't know how flexible it is. You might need to use MapServer
queries and the [shpxy] tag. With that approach you get access to all attributes (plus joins) and the spatial data.
You can build image maps. GML, SVG or whatever.

The approach is to do a MapServer query of the CGI (e.g. get all firestations for a particular extent) and build the
page from templates. 

Here's an SVG example:

  http://noah.dnr.state.mn.us/cgi-bin/mapserv46?map=/usr/local/www/docs_maps/testing/svg/test.map&qlayer=county&qitem=cty_name&qstring=/./&mode=itemnquery

Templates are at:

  http://noah.dnr.state.mn.us/testing/svg/

The example outputs coordinates as UTM coordinates with no decimals, but you can also output data with respect to an image.

Steve

>>> "Hunter, David - St. Louis Park, MN" <David.Hunter at FNF.COM> 07/12/05 12:42 PM >>>
I'd like to add a client-side image map for a layer of point features.
I found the documentation for this in the wiki, and it basically works,
except the '%s' variable gets replaced with the layer name.  How can I
write out the contents of a field, for instance each point's name,
instead of the layer name?  

 

This is line from the output:

 

<area href="alert('FireStations');" onMouseOver="return
overlib('FireStations');" onMouseOut="return nd();" shape="circle"
coords="130,238, 3" />

 

This is what my .map file looks like:

 

MAP

OUTPUTFORMAT

  NAME imagemap

  DRIVER imagemap

  MIMETYPE "text/html"

  FORMATOPTION "SYMBOLHREF=alert('%s');"

  FORMATOPTION "MAPNAME=stations"

  FORMATOPTION "SYMBOLMOUSEOUT=return nd();"

  FORMATOPTION "SYMBOLMOUSEOVER=return overlib('%s');"

END

 

EXTENT         -80.2204 35.8442 -79.7739 36.1308

SIZE           670 536

UNITS DD

  

PROJECTION

  "init=epsg:4267"

END

 

 

  # fire stations

  LAYER 

    NAME         "FireStations"

    CONNECTIONTYPE OGR

    CONNECTION "FD/NC0505AFS.tab"

    STATUS       DEFAULT

    TYPE         POINT

    

    PROJECTION

      "init=epsg:4267"

    END

 

    CLASS

      COLOR 0 0 0

    END

  END 

 

END

 

David S. Hunter
Sr. Software Engineer
Fidelity National Geographic Solutions
division of Fidelity National Financial
5353 Gamble Drive, Suite 201
St. Louis Park, MN 55416
* Email: david.hunter at fnf.com 
' Phone: 952.542.1440 ext. 256
* Fax: 952.542.3859

 



More information about the mapserver-users mailing list