php/mapscript and client-side imagemaps

Matt Pettis matt.pettis at THOMSON.COM
Tue Apr 3 23:14:18 EDT 2007


Hi,

I'm trying to get generate a client side imagemap (the <map>...</map>) coordinates and inserting the text using just php/mapscript (avoiding using the templating methods found at http://mapserver.gis.umn.edu/docs/howto/imagemaps because I want as pure a php solution as i can get).  I found the wiki entry for this (http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?ImageMap), and followed its instructions.  In particular, the following lines did not generate what I thought:

$imgmap = ms_newMapObj( "C:\\ms4w\\Apache\\htdocs\\postgis\\imgmap.map" );
$imgmapimg = $imgmap->draw();
$imgmapurl = $imgmapimg->saveWebImage(MS_IMAGEMAP,1,1,0);

I couldn't find documentation on saveWebImage, but I thought it would generate the text i would need to include in a <map> section for my webpage.  Instead, what was generated was a .png file.  Should this be usable as an image map, or did I get this in error (the page rendered just fine).

Can someone help me fix this?  Ultimately, I am looking to emulate the great ease from the templating solution, but just in php.  I am rendering the counties of MN as polygons and would like to request a different URL based on which county is clicked.  Anyone have a solution/hints along this direction?

Thanks,
Matt



More information about the mapserver-users mailing list