simonw / datasette-tiles

Mapping tile server for Datasette, serving tiles from MBTiles packages
https://datasette.io/plugins/datasette-tiles
7 stars 5 forks source link

Support serving retina tiles #12

Closed simonw closed 3 years ago

simonw commented 3 years ago

I don't fully understand how this works - something to do with a @2x.png extension, e.g. http://c.tile.stamen.com/toner/17/20960/50662@2x.png

simonw commented 3 years ago

The MBTiles spec doesn't appear to cover this. https://github.com/infostreams/mbtiles-php/issues/15 suggests (back in 2014) that the solution was to have two separate MBTiles files - one containing 256px tiles and one containing 512px retina tiles - and then use the @2x.png extension to switch between them.

simonw commented 3 years ago

This works fine already. If your MBTiles file contains 512x512 PNG images Leaflet will serve them at 256x256 which means retina devices will display then in high resolution.

I should mention this in the README.