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

FR: Expose method for rendering single tile to canvas #4420

Closed
d1manson opened this issue Mar 14, 2017 · 3 comments
Closed

FR: Expose method for rendering single tile to canvas #4420

d1manson opened this issue Mar 14, 2017 · 3 comments

Comments

@d1manson
Copy link

d1manson commented Mar 14, 2017

I've not used any of the code yet, but I have had a look through, and couldn't find a simple way to render a single tile to a specific point on a canvas. Something like:

.renderTile(tileData, elCanvas, {x,y,w,h}, options)

Ideally the function would return a promise/accept a callback, for when the rendering is done, but I know that might not be easy to accomplish with WebGL 1.0.

@lucaswoj
Copy link
Contributor

As I understand it, you're asking for an API that allows you to render map tiles at an arbitrary spot in your canvas as part of a more complex rendering. Is that correct?

We don't have an API that does this. You may be able to accomplish this end by rendering Mapbox GL to one canvas and then copying it into your other canvas, where the more complex rendering is taking place.

Closing because this is not an API we would be able to support in the medium term.

@d1manson
Copy link
Author

For anyone interested, I am now building something that does what I wanted. It doesn't seem to be too hard...but I'm only interested in my specific use case...

https://gist.github.com/d1manson/a987e6af63a47129ab54c73b31a7b1bd

@d1manson
Copy link
Author

That is now a more fully fledged thing..
https://landtechnologies.github.io/Mapbox-vector-tiles-basic-js-renderer/debug/basic/

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

2 participants