[Mapserver-users] Printing Template w/ MapServer

Delfos, Jacob jacob.delfos at maunsell.com
Thu May 20 20:34:02 PDT 2004


By the way, check http://spatial.hgm.com.au/cwcroe7/cwc2.php to see it in
action. Let me know if you have any questions.


-----Original Message-----
From: Jerod Clabaugh [mailto:jclabaugh at mac.com] 
Sent: Friday, 21 May 2004 12:16 PM
To: mapserver-users at lists.gis.umn.edu
Subject: [Mapserver-users] Printing Template w/ MapServer


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


_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users



More information about the MapServer-users mailing list