[OpenLayers-Users] Print to PDF via GeoServer - Example?

Christopher Schmidt crschmidt at metacarta.com
Sat Jun 16 07:32:48 EDT 2007


On Fri, Jun 15, 2007 at 08:20:22PM -0500, eleanor tutt wrote:
> I know that there have been discussions about printing an OpenLayers
> map as a PDF before--the preferred way is to send the map again
> through the server.
> 
> Unfortunately, I am having a hard time understanding exactly how to
> send GeoServer a WMS request that tells the server which layers are
> turned on and off.  (The bounding box/zoom is no probem, but I also
> need to tell GeoServer the layer names and layer styles that I want
> printed.)

var layersstring = []; 

for (var i=0; i<map.layers.length; i++) {
    layerstring.push(map.layers[i].params.LAYERS);
}
var stringforserver = layerstring.join(",");

That might get you started?

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list