[OpenLayers-Users] printing...

Christopher Schmidt crschmidt at metacarta.com
Sat Mar 24 13:45:50 EDT 2007


On Sat, Mar 24, 2007 at 10:14:58AM -0600, John Cole wrote:
> What is the easiest way of getting OL to configure itself for printing?  The
> issue I have is that when printing with overlays and controls, the base map
> gets covered and doesn't show (try a print preview on one of the example
> pages with multiple layers).

> So far, my only idea is to have two maps defined, one with a single layer
> that is only enabled in the print stylesheet while the other is disabled,
> and have some JS to keep the two in sync.  Any other suggestions?

I highly recommend not depending on browsers for printing.

Instead, I recommend using some other tool to render a PDF out of your
backend: MapServer, for example, has a PDF output. Using PDF output
(instead of browser-based printing) means that your renderer is in
control of styling of the map, and you don't have the issues with
overlays or anything else.

http://mumbai.freemap.in/ uses this technique.

That's always been my recommendation, and I'm sticking to it :) 

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list