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

Sander Steenhuis notifications at github.com
Fri May 14 01:28:21 UTC 2021


I appreciate you taking the time to explain this in such detail. If I understand correctly, this project is for the website UX/accounts, and it depends on the Mapnik project for editing, the OSMF project for providing the tiles, and the LeafletJS project for drawing the OSMF tiles on screen. High-DPI tiles cannot be provided at the source because it is a complex process.

At the risk of forgetting something important, can I propose this website adds a "Standard 2x" layer that people can choose, a special mode for high-DPI fans who prefer a crisp map over larger street names? It is not ideal with the small names, but neither is a low-DPI map on a high-DPI screen.

It can be constructed by using the existing tiles at half their size.

The layer can be constructed using the `tileSize` and `zoomOffset` options like so:

```js
tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
    tileSize: 128,
    zoomOffset: 1
})
```

Standard:
![image](https://user-images.githubusercontent.com/1702193/118206378-abf9c680-b462-11eb-9d9f-ab1d7177b75b.png)

Standard 2x:
![image](https://user-images.githubusercontent.com/1702193/118206839-a355c000-b463-11eb-8952-6b7351708a37.png)

It's very pleasant to look at on a high-DPI screen, especially when you care more about the lay than the name of the land.

I'm getting ahead of myself a little here, but you can also choose to add it as a toggle, so it can optionally apply to other layers who's map tile sources were painstakingly set up in the "low-DPI era" as well.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/104#issuecomment-840934397
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20210513/79e6c0cd/attachment.htm>


More information about the rails-dev mailing list