Skip to content
This repository has been 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

Closed
1ec5 opened this issue Feb 25, 2015 · 6 comments · Fixed by #924
Closed

v4 raster layers load with low-resolution tiles on high-resolution screens #919

1ec5 opened this issue Feb 25, 2015 · 6 comments · Fixed by #924
Assignees
Labels
Android Mapbox Maps SDK for Android iOS Mapbox Maps SDK for iOS performance Speed, stability, CPU usage, memory usage, or power usage

Comments

@1ec5
Copy link
Contributor

1ec5 commented Feb 25, 2015

#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:

before after

@1ec5 1ec5 added iOS Mapbox Maps SDK for iOS performance Speed, stability, CPU usage, memory usage, or power usage Android Mapbox Maps SDK for Android labels Feb 25, 2015
@1ec5
Copy link
Contributor Author

1ec5 commented 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?

@1ec5 1ec5 self-assigned this Feb 25, 2015
@incanus
Copy link
Contributor

incanus commented Feb 25, 2015

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.

@1ec5
Copy link
Contributor Author

1ec5 commented 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
Copy link
Contributor

incanus commented 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
Copy link
Contributor

All Mapbox v4 raster tiles support @2x.

Relevant JS code: 1, 2

@incanus
Copy link
Contributor

incanus commented 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 2x good-looking version (which I did at justin.NACIS2012Retina).

1ec5 added a commit that referenced this issue Feb 27, 2015
Based on mapbox.normalizeTileURL() in mapbox/mapbox-gl-js, but insert a “{ratio}” placeholder instead of “@2x” in order to keep the pixelRatio logic in TileData::request().

Fixes #919.
1ec5 added a commit that referenced this issue Mar 2, 2015
Apparently we can’t rely on the existence of <regex> yet.

Fixes #919.
1ec5 added a commit that referenced this issue Mar 6, 2015
Based on mapbox.normalizeTileURL() in mapbox/mapbox-gl-js, but insert a “{ratio}” placeholder instead of “@2x” in order to keep the pixelRatio logic in TileData::request().

Fixes #919.
1ec5 added a commit that referenced this issue Mar 6, 2015
Apparently we can’t rely on the existence of <regex> yet.

Fixes #919.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android iOS Mapbox Maps SDK for iOS performance Speed, stability, CPU usage, memory usage, or power usage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants