Simple image mapping example...

Steve Lime steve.lime at DNR.STATE.MN.US
Mon Oct 10 19:50:37 EDT 2005


Hi all: Just thought I'd share a simple image mapping example that I've been tinkering with. I needed a simple tool to allow users to select multiple features with for use in a non-GIS application. Here's the simple tool for selecting counties:

http://noah.dnr.state.mn.us/cgi-bin/mapserv48?map=/usr/local/www/docs_maps/eco/rsg/search/search.map&qlayer=county&mode=nquery&searchmap=true

It uses the [shpxy ...] tag to output coordinates (in pixels) via normal  query templates. The searchmap option may be new to folks. It's been around a long time and is documented but is typically overlooked. It tells map server to basically compute a normalized extent BEFORE querying. That is, use the extent for an image (after pan or zoom) as the query rectangle. It really only makes sense with mode=nquery. This example uses the default extent and map size in the mapfile. This example also hilites the ability to set class expressions dynamically. Works nice and fast, and provides a very simple UI.

There is one mapfile and 3 templates driving this:

  http://noah.dnr.state.mn.us/eco/rsg/search/search.map 
  http://noah.dnr.state.mn.us/eco/rsg/search/templates/county.html 
  http://noah.dnr.state.mn.us/eco/rsg/search/templates/imagemap_header.html 
  http://noah.dnr.state.mn.us/eco/rsg/search/templates/imagemap_footer.html 
  
Perhaps this will give other folks ideas (or not)... (There are also major watershed and ecological subsection versions, just substitute the right layer name in the first URL)

Steve

Stephen Lime
Data & Applications Manager

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937



More information about the mapserver-users mailing list