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

Improve custom layer compatibility #2296

Closed
5 tasks
sakitam-fdd opened this issue Sep 20, 2018 · 5 comments
Closed
5 tasks

Improve custom layer compatibility #2296

sakitam-fdd opened this issue Sep 20, 2018 · 5 comments
Assignees
Milestone

Comments

@sakitam-fdd
Copy link
Contributor

Background

For #2264 mapbox custom layer integration, it introduces an external GL context for mapbox. It's exciting, but for other map engines like maptalks canvas in the GL context created externally is not rendered correctly,and I've found some reasons:

animation2

  • So I think the above modifications will have better compatibility.

To Do List

  • Add label and assign to milestone
  • Coding
  • Doc update
  • Whats new update
  • Test
@ibgreen
Copy link
Collaborator

ibgreen commented Sep 20, 2018

So I think the above modifications will have better compatibility.

@sakitam-fdd Thanks for reporting! We are of course interested in improving compatibility with other systems, however using clientWidth and clientHeight is critical in order to correctly support retina displays.

https://webglfundamentals.org/webgl/lessons/webgl-anti-patterns.html.

clientWidth represents the size of the canvas on screen, and in retina mode it will be smaller than the width and height which represent the actual size of the underlying WebGL drawing buffer, which will be scaled to the canvasWidth.

We could use width if clientWidth is not defined. But per your description, it sounds like clientWidth is defined but not updates. I am not sure how to detect that your underlying module does not update clientWidth.

@sakitam-fdd
Copy link
Contributor Author

sakitam-fdd commented Sep 20, 2018

@ibgreen Thank you for your reply. A straightforward reason for this is that instead of drawing in a unified webgl context, it just creates an offscreen Canvas that doesn't really render canvas into the dom, and there won't be any clientWidth updates. I will think about other solutionsor and you have better suggestions?

@fuzhenn
Copy link

fuzhenn commented Oct 8, 2018

@ibgreen Thanks for your attention! @maptalks 's maintainer here.

The problem here is in maptalks, all the layer canvases are pre-rendered off-screen, where clientWidth and clientHeight are always 0. Meanwhile, clientWidth and clientHeight are read-only properties, so they can't be updated by upper module.

Thus it would be nice if deck.gl can fall back to canvas's width/height when clientWidth and clientHeight are 0. This should solve this off-screen canvas problem.

Thanks!

@1chandu
Copy link
Contributor

1chandu commented Dec 5, 2018

Resolved by #2405

@1chandu 1chandu closed this as completed Dec 5, 2018
@Pessimistress
Copy link
Collaborator

Fix published in deck.gl@6.3.3

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

5 participants