[openstreetmap-website] Add retina support (#104)

Frederik Ramm frederik at remote.org
Fri Sep 21 15:59:19 BST 2012


Frederik here. (*)

On 09/21/12 16:40, Tom MacWright wrote:
>     Adding support to OpenLayers shouldn't be too hard. Hosting costs
>     are a different thing of course.
> No, it should and it will. This would necessitate serving 4x as many
> tiles (and thus as much bandwidth), redesigning the OSM style to work
> with a different scale factor (which would likely result in a duplicate
> set of icons, for which we only have bitmaps).

I have already done retina tiles a while ago with a standard, 
Tirex-based tile server and Mapnik 2.1. Instead of serving more tiles, I 
decided to double the size of a meta tile and then use the exact same 
tiling schema for compatibility and less confusion - what is on tile 
z/x/y.png in the standard rendering will also be on z/x/y.png in the 
retina rendering. The advantage of this was that I had less rendering 
artifacts around the meta tile borders than I would have had with 
standard 2048x2048 meta tile size. OpenLayers "supports" this (for some 
value of support) in that nothing breaks, but because OpenLayers 
instructs the browser to scale the 512x512 tile to 256x256, the client 
doesn't see a quality improvement. Other (iOS native) tiling 
applications did however work great. I didn't bother redesigning the 
style and simply instructed mapnik to render at scale factor 2 which, 
thanks to Dane+Artem, now works really well and even scales bitmap 
images in case you don't have access to scalable icons.

But I fully share TomH's notion that we're not about making a slick 
application for users of high resolution displays out there. It would be 
great to have a page on switch2osm.org that explains how you can 
effortlessly make retina tiles but we don't have to make them ourselves.


(*) This in response to 

Frederik Ramm  ##  eMail frederik at remote.org  ##  N49°00'09" E008°23'33"

More information about the rails-dev mailing list