Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When using OpenLayers I can compose a map with several layers which is displayed nicely by my browser, but I need to do the same server side (no browser composing the layers), and I'm waiting a image file as output (ie PDF, SVG, JPEG or PNG).

I need to do composition with at least OSM and Vector layer types.

What are my solutions ?

share|improve this question

Sounds to me like MapFish Print will do exactly what you want. We use it to do exactly this from a web mapping application.

share|improve this answer
I tried to use MapFish Print, but it must be tweaked to ouput a PNG without margins, title, comments. And the composition with multiple layer is not documented (AFAIK). Reading java source code and trial and error is quite time consuming for a task that seemed to me quite trivial. Have you some hints ? – vaab Aug 17 '12 at 6:00

This looks like a perfect use-case for GeoServer. I guess Mapserver would also fit you needs.

I've personally build something similar to make a printable version of an OpenLayers powered map. This map was displaying complex data coming from GeoServer on top of Google base maps (WMS protocl was used between OL and GeoServer).

What I did was simply to observe the WMS request coming from OpenLayers and hacked it to fit my needs: add a base layer, add a small logo in the corner of the map, asks for the Jpeg output format, request a different SLD to provide "printer-friendly" styling, ...

Hope this helps !

share|improve this answer
There is a community module for GeoServer that integrates MapFish. This could have also been a valid approach for you. The benefit of MapFish is that it allows control of the print template. – CHenderson Aug 16 '12 at 15:25
Similar solution here. I inject the URL into a jasper report and the magic happens. – Pablo Aug 16 '12 at 17:43
@CHenderson the print template is a burden for me. I'm using BIRT to make my reports. I managed to tweak the output to remove all titles, comments, margin and only display the map in PNG... but this doesn't seems natural. Did I miss something obvious ? – vaab Aug 17 '12 at 6:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.