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

Screenshot #202

Closed
jrjdavidson opened this issue Oct 1, 2020 · 2 comments
Closed

Screenshot #202

jrjdavidson opened this issue Oct 1, 2020 · 2 comments

Comments

@jrjdavidson
Copy link

I noticed there is a function to generate a screenshot(shift+p in inspector) .. I want to add a button that will save a screenshot of the map and all the geodata on top. Any chance you can point me in the right direction?

thanks

@davidmtech
Copy link
Member

There is a function for saving screen shots:

renderer.saveScreenshot(output, filename, filetype);

e.g:
renderer.saveScreenshot('file', 'screenshot.png', 'png');

But important prerequisite is to initialize browser with browser option rendererAllowScreenshots : true. This option sets WebGL into mode where WebGL screen pixels are accessible. Otherwise you will receive empty screenshot. This option can lead to worse performance so it is not enabled by default.

https://github.com/melowntech/vts-browser-js/wiki/VTS-Browser-API#advanced-options

@jrjdavidson
Copy link
Author

Works great, thanks!

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