[Mapserver-users] Printing Template w/ MapServer

Jerod Clabaugh jclabaugh at mac.com
Fri May 21 00:16:21 EDT 2004


Hi:

I am trying to develop a template to allow the user to print the 
current view of a map, with the legend, all selected layers, scalebar 
etc.

I tried to mimic the print function from the MN DNR Recreational 
Compass site (http://www.dnr.state.mn.us/maps/compass.html) by 
picking through the source code 
(http://maps.dnr.state.mn.us/compass/view_print.html).

Does anyone know an easy way to pass the existing map, legend and 
scalebar from a mapserver page to another page without using a 
scripting language such as PHP.

I am passing this URL string:

<a 
href="[program]?map_reference_status=on&map=[map]&mapsize=500+500&template=/Library/Apache2/htdocs/belize/print.html&mapext=[minx]+[miny]+[maxx]+[maxy]" 
class="showline">Print Map View</a>

to the print.html page with the following code in it:

<img border="2" src="[img]">
<br /><br />
<img border="2" src="[legend]">
<br /><br />
<img src="[scalebar]"><br>
<p>
<b>Map Parameters</b> (UTM Zone 16, NAD27)</font><br>
  <i>minx:</i> [minx]<br />
<i>maxx:</i> [maxx]<br />
<i>miny:</i> [miny]<br />
<i>maxy:</i> [maxy]<br />
<img src="[ref]">

but only minx, miny, maxx, maxy are pass correctly to the print.html 
page ... the [img], [legend] and [scalebar] paths passed between the 
URL and the print.html page are absolute paths (i.e, map image is 
passed as /Library/Apache2/htdocs/tmp/BELIZE_0987765554.png (which 
Apache won't display) when I want it to just show 
/tmp/BELIZE_0987765554.png (which Apache would display).  I also 
tried passing [map_web_imageurl] but that produced the same result.

Any advice would be greatly appreciated,

Cheers,

Jerod Clabaugh





More information about the mapserver-users mailing list