[Geomoose-users] Modify print pdf on GM 1.6

Brian Welch Brian.Welch at CI.NORTHFIELD.MN.US
Fri Sep 4 12:47:29 EDT 2009


Rano,
 
Perhaps there is a more efficient way to do this, but so far it's what I've been able to get working.
 
Example: I have a standard legend that I use for my city zoning map and users wanted a legend showing the zoning districts to appear on the PDF files. 
Solution: I dug into the pdfprint2.php code and wrote specific lines of code with the fpdf (see http://www.fpdf.org/en/doc/index.php) commands to insert colored rectangles, lines and labels to create a rudimentary legend at the bottom of the page (I had to shrink the map area slightly to fit the legend). If you have dug into this code to customize your PDF outputs you should have an idea of how it works. The PDF-creation portion of the PHP code is actually quite readable.
 
The downside of this solution, of course, is that the legend in the PHP code does not always represent the map layers selected by the user for display. It is a static legend. I ended up creating a menu of map shortcuts so the users can choose between standard maps: zoning, city property/parks, planning, etc. with the appropriate legends (each with a unique pdfprint2_xxx.php file and reference in the map's .xml file). My main map with ALL of the layers produces a PDF with no legend so users can be more creative.
 
Like I said, there is surely a better way to do this. Coming up with a means to choose allow the user to select which layers should appear in the PDF at the time of creation would be extremely helpful. However, I'm not much of a PHP coder, nor do I have the time to do it.
 
Brian Welch, GIS Technician
City of Northfield
Northfield, MN
 
 
--------
Brian Welch, GIS Technician
City of Northfield
Northfield, MN 55057
507-645-3027
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geomoose-users/attachments/20090904/97a17833/attachment.html


More information about the Geomoose-users mailing list