My organization has a web application for displaying global and regional climate data and we're considering improvements to it. Our leading idea is to create an OpenLayers-based application to display climate rasters over base layers like OSM or Google Maps. The map may also include some other application-specific vector layers and a color bar or other legend features describing the data. Near as I can tell, this all seems do-able with OpenLayers.
One requirement for the project, though, is to be able to export (ideally from the web-app) publication quality (more-or-less) maps. A typical use case would be something like this:
- A user, using the base layer as a guide, navigates to their area of interest
- The user selects a climate parameter (e.g. mean temp for the 2040s) or set of parameters
- The user hits the "export" button and then downloads a good quality map which includes all of the elements described in the first paragraph.
I haven't been able to find anything in OpenLayers about rendering to an image. Does anyone know whether this is possible? And if not what other approaches for rendering could we take? I would suppose that we would need to pass all of the map parameters (bbox, projection, included layers, etc.) out to some external rendering engine; what open source rendering engines are out there?
Best Answer
The main ways to display pretty print maps from openlayers I know are:
-Geoserver with Geoext
-Mapfish with Geoext
Both solutions rely on a java part(e.g. http://geoserver.org/display/GEOS/Printing+in+GeoServer or http://www.mapfish.org/doc/print/)
-Openlayers standalone (See the official doc http://trac.openlayers.org/wiki/Printing)
More recently, a technique appears to render image with PhantomJS (a software simulating browser from command line) http://acuriousanimal.com/blog/2012/09/17/creating-static-maps-in-openlayers-using-phantomjs/
Some recent libraries use browser Canvas rendering abilities to "catch" image like this OpenLayers 3 example or this Leaflet one