ol2
ol2 copied to clipboard
Paper-print tiled maps in high-res
I need to print a map on paper, with layers. I created a separate HTML page for that. However, the OSM (OpenStreetMap) base layer prints with a screen resolution of 72dpi, which means: 1) most street names are not visible (and on paper, that's final, no zooming) 2) those streets names that are printed are often very pixelish, almost unreadable.
This is because browsers, at least Mozilla, always print with 72dpi, to make webpages look on paper then same as on screen. But it is possible to provide higher-resolution images:
, with "img1000x1000px.png" having 1000x1000px size, will give a high-res print in Mozilla.
This will print 1000 px on 3,55 cm on paper (100 pixels / 72 dots per inch * 2,56 cm/inch = 3,55 cm), i.e. result in 720 dpi (1000px/100px * 72 dpi).
In other words, the image file must have 10 times the pixel size than the size in page per CSS width/height.
This means, we need to adapt the OSM -> XYZ -> Grid -> Layer class for that. The grid must be 10 times finer than it is for the screen.
Now, the question is: how to achieve this best, in Grid.js? Change tileSize? Change resolution? Both?
You should have a look on tileSize and serverResolutions, but printing at 720dpi tiles that will be made for 72dpi will not get a good result...
Otherwise there is the Mapfish print that mad to print maps: https://github.com/mapfish/mapfish-print/.
Hello.
I have the same issue as benbucksh.
I need to create a 40x40cm (or 17inchx17inch) map. This map will be printed and exhibited, so the higher DPI the better. Actually, in printing, a 300DPI is the minimum.
I have searched over and over on the net and found no solution to my issue. This page : http://trac.osgeo.org/openlayers/wiki/SettingZoomLevels does not relate to the problem.
Also, after trying mapfish demo following the suggestion of sbrunner, I came to the conclusion that this tool is not adapted.
Indeed, when you go to http://demo.mapfish.org/mapfishsample/2.2/
and choose different type of resolution (127 to 256 for example), you should have exactly the same map (that is, same size texts among other things), but with thinner lines. It's not the case with the demo. When you choose resolution 256, the text is much smaller than with 127, since the goal is not reached : I could basically do the same by somehow changing zoomlevel. This is very disappointing, without adding that installing Mapfish is a big project in itself (hours of work at least).
So please, do you have other suggestions ?
Thank you very much.
I have the same problem Did anybody find a solution?