-
Notifications
You must be signed in to change notification settings - Fork 38
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
Google Map not appearing in the Screenshot #30
Comments
Google map uses a canvas of type "webgl2" which cannot be captured unless You can use the workaround in https://stackoverflow.com/a/55762772 |
@leonzdev hi checked out the link you shared, tried to implement it didnt work, can you show a snippet of it being used in a react/nextjs component? |
I have a // @ts-nocheck
// source: https://stackoverflow.com/a/55762772
HTMLCanvasElement.prototype.getContext = function(origFn) {
return function(type, attribs) {
attribs = attribs || {};
if (type === 'webgl' || type === 'webgl2') {
attribs.preserveDrawingBuffer = true;
}
return origFn.call(this, type, attribs);
};
}(HTMLCanvasElement.prototype.getContext);
export {} Then in my // other imports
import ‘./injectHacks’;
// other stuff
function App() {
// some React code
}
export default App; The key is to override |
I think its working.. tho I'm getting another error. its probably because of the library im using.. gonna post the error here just in case someone knows the solution
|
We can't take screenshots of Google Maps. This is because the google map component behind the scene is wrapped in an iframe tag which is a separate document hence the package is not able to take its screenshot. |
The text was updated successfully, but these errors were encountered: