Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map containers larger than 4096px are scaled #2673

Closed
andrewharvey opened this issue Jun 5, 2016 · 5 comments
Closed

map containers larger than 4096px are scaled #2673

andrewharvey opened this issue Jun 5, 2016 · 5 comments

Comments

@andrewharvey
Copy link
Collaborator

andrewharvey commented Jun 5, 2016

mapbox-gl-js version: 0.19.1

Steps to Trigger Behavior

  1. Initialise a simple map (eg. https://www.mapbox.com/mapbox-gl-js/examples/) but set the HTML container to a width & height of 8192x8192px.
    demo: http://jsbin.com/hadiravumo/1/edit?html,output

Expected Behavior

I expect the map to be crisp and not over scaled. This is what the 4096x4096px map looks like, nice and crisp, and what I expect the 8192x8192px map to look like (just a larger area as the zoom is the same in both cases).

4096

Actual Behavior

It's blurry because it is rendered at 4096x4096px map but scaled by 2x. The 8192x8192px map looks like this:

8192

var gl = canvas.getContext('experimental-webgl');
console.log(gl.getParameter(gl.MAX_RENDERBUFFER_SIZE));

returns 8192 which indicates that WebGL canvases that big should work? window.devicePixelRatio is 1.

@mourner
Copy link
Member

mourner commented Jun 5, 2016

I don't think we can do anything about this in GL JS code if it's a browser limitation. Apparently max renderbuffer size translates to half of that in pixels.

@andrewharvey
Copy link
Collaborator Author

I don't think we can do anything about this in GL JS code if it's a browser limitation. Apparently max renderbuffer size translates to half of that in pixels.

@mourner Thanks for the explanation, I didn't realise that gl.MAX_RENDERBUFFER_SIZE translates to half of it in pixels, so I thought it was an issue in GL JS. I'm interested why it translates to half.

But given that, I'll have to go ahead with a workaround for my specific use case of generating high-res images for print by pasting together 4096x4096 tiles.

@mourner
Copy link
Member

mourner commented Jun 5, 2016

That's just a guess, — I don't know for sure. Let's reopen if this turns out to be something that can be fixed on our side.

@andrewharvey andrewharvey reopened this Jun 6, 2016
@lucaswoj
Copy link
Contributor

lucaswoj commented Jun 9, 2016

Let's reopen if this turns out to be something that can be fixed on our side.

@andrewharvey
Copy link
Collaborator Author

From #3915 (comment)

I’m unable to get #2673 to reproduce in v0.28.0

@1ec5 I can confirm this. For me on Chrome 0.19.1 still suffers from this issue, but it appears fixed in 0.28.0. Which is awesome!

My gl.MAX_RENDERBUFFER_SIZE is still 8192 which is the size of the map I used to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants