Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Load 2× raster tiles on HiDPI screens - #924

Merged
jfirebaugh merged 4 commits into
masterfrom
919-2x-raster
Mar 6, 2015
Merged

jfirebaugh merged 4 commits into
masterfrom
919-2x-raster

Conversation

@1ec5

@1ec5 1ec5 commented Feb 27, 2015

Copy link
Copy Markdown
Contributor

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, so Satellite should look like it did before feae53f:

fixed

Comment thread src/mbgl/util/mapbox.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also important that this only insert {ratio} on Mapbox sources, since we can't guarantee that other sources support @2x. That's why gl-js check the source URL against mapbox://.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed gl-js support for other image formats in mapbox/mapbox-gl-js@241a07d.

@1ec5

1ec5 commented Mar 2, 2015

Copy link
Copy Markdown
Contributor Author

@incanus @jfirebaugh are we good to go here?

@jfirebaugh

Copy link
Copy Markdown
Contributor

Previous use of std::regex was discussed in #292 and #521. Did we switch to targeting gcc 4.9?

@1ec5

1ec5 commented Mar 2, 2015

Copy link
Copy Markdown
Contributor Author

Oh, according to the README, we’re still targeting g++ 4.8 for Linux. I’ll get rid of the dependency.

@jfirebaugh

Copy link
Copy Markdown
Contributor

I wonder how the linux+gcc travis build using std::regex still passed though...

@springmeyer springmeyer mentioned this pull request Mar 2, 2015
@1ec5 1ec5 mentioned this pull request Mar 3, 2015
@mb12

mb12 commented Mar 3, 2015

Copy link
Copy Markdown

Instead of hardcoding for file extensions (.jpg, .png etc), you can use source.type == SourceInfo::Raster in TileData::Request.

@jfirebaugh jfirebaugh self-assigned this Mar 3, 2015
@jfirebaugh
jfirebaugh force-pushed the 919-2x-raster branch 2 times, most recently from 3871552 to 42cbfbc Compare March 4, 2015 23:59
@1ec5

1ec5 commented Mar 5, 2015

Copy link
Copy Markdown
Contributor Author

Looks like it’s still failing on Linux with error code 2. Is it possible that this compiler is defaulting to some syntax other than ECMAScript?

@1ec5

1ec5 commented Mar 5, 2015

Copy link
Copy Markdown
Contributor Author

It’s error_escape apparently.

@1ec5

1ec5 commented Mar 5, 2015

Copy link
Copy Markdown
Contributor Author

I think we’re still looking at a stubbed-out std::regex implementation in GCC 4.8. It seems to only support basic regex even if you specify ECMAScript syntax (which should be the default).

@jfirebaugh

Copy link
Copy Markdown
Contributor

sigh

Ok, let's revert to the string based implementation and open an issue about upgrading to gcc 4.9.

@mb12

mb12 commented Mar 5, 2015

Copy link
Copy Markdown

There is no need to do any string manipulation for this issue. Just pass an additional boolean flag to normalize method that '@ratio' needs to be appended. In caller just use SourceInfo.type == SourceType::Raster for this boolean flag.

@1ec5

1ec5 commented Mar 5, 2015

Copy link
Copy Markdown
Contributor Author

“{ratio}” needs to be inserted before the file extension and any parameters, not appended, hence the regex / string manipulation. But SourceInfo.type is a good idea.

1ec5 added 4 commits March 6, 2015 13:51
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.
Apparently we can’t rely on the existence of <regex> yet.

Fixes #919.
Left out several tests that were redundant because mapbox.cpp only looks at the passed in access token.
Thanks to @mb12 for the suggestion.
jfirebaugh added a commit that referenced this pull request Mar 6, 2015
Load 2× raster tiles on HiDPI screens
@jfirebaugh
jfirebaugh merged commit de591b5 into master Mar 6, 2015
@jfirebaugh
jfirebaugh deleted the 919-2x-raster branch March 6, 2015 22:44
@incanus incanus mentioned this pull request Mar 7, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants