You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
v4 raster layers load with low-resolution tiles on high-resolution screens #919
#916 removed a special case for HiDPI that bumped up the zoom level, the idea being that vector tiles have a sufficiently high resolution that the HiDPI experience wouldn’t suffer. But this same code runs for raster layers. Now the Satellite layer is half as sharp:
It should be possible to stick a “{ratio}” somewhere in the URL so that TileData::request() will insert @2x. The 2x variant does at least exist for mapbox.satellite – can we depend on its existence in general?
Yes, @2x is supported for any Mapbox-hosted raster tile. If it's a custom tile that's uploaded not from OSM-based stuff, it'll fail silently, but for everything else, it'll work.
Activity
1ec5 commentedon Feb 25, 2015
It should be possible to stick a “{ratio}” somewhere in the URL so that
TileData::request()will insert@2x. The 2x variant does at least exist for mapbox.satellite – can we depend on its existence in general?incanus commentedon Feb 25, 2015
Yes,
@2xis supported for any Mapbox-hosted raster tile. If it's a custom tile that's uploaded not from OSM-based stuff, it'll fail silently, but for everything else, it'll work.1ec5 commentedon Feb 25, 2015
@incanus how silently? Will we need to fall back to a 1× URL or will mapbox just return a 1× tile anyways?
incanus commentedon Feb 25, 2015
The latter. I'd say supporting non-auto-retina raster tiles in GL is not a major use case so this is fine.
jfirebaugh commentedon Feb 25, 2015
All Mapbox v4 raster tiles support @2x.
Relevant JS code: 1, 2
incanus commentedon Feb 25, 2015
I'm talking about such cases as this
justin.NACIS2012, which I created in TileMill and uploaded rasters of.1x:2x:So, the sizing is just naively blown up, but the URL works.
I'd be on the creator to create a
2xgood-looking version (which I did atjustin.NACIS2012Retina).Load 2× raster tiles on HiDPI screens
Replace regex usage with basic string manipulation
Load 2× raster tiles on HiDPI screens
Replace regex usage with basic string manipulation