-
Notifications
You must be signed in to change notification settings - Fork 505
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
Unable to capture 'screenshot' of Google map #116
Comments
Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. |
Hiya! Thanks for being a part of the Antv community! 💪💯 |
Run into the same issue. Any updates? |
Hiya! Thanks for being a part of the Antv community! 💪💯 |
Hey again! |
I also have same issue, Why are you closing without fixing? |
I managed to solve this issue with the If anyone needs, I'm sharing my custom React hook below:
|
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread. |
First of all, great work. This is the easiest to use and WORKING module.
I tried to save Google map as an image. The generated image is not exactly the same. In some case, it is very different.
Expected Behavior
The image should look the same as the google map
Current Behavior
See attached screenshots. The left is a Google map using agm-map. The right is generated data PNG. In picture 1, the generated image is very different. In picture 2, only part of the Google map is in the PNG.
My code is nothing fancy:
htmlToImage.toPng(element).then((dataUrl) => {
that.imageData = dataUrl;
}).catch(function (error) {
console.error('oops, something went wrong!', error);
});
I noticed the error message in the console:
Error while reading CSS rules from https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Google+Sans:400,500,700 SecurityError: Failed to read the 'cssRules' property from 'CSSStyleSheet': Cannot access rules
Not sure if this is what screws up the image rendering.
Your Environment
"dependencies": {
"@agm/core": "^3.0.0-beta.0",
"@angular/animations": "~8.2.14",
"@angular/common": "~8.2.14",
"@angular/compiler": "~8.2.14",
"@angular/core": "~8.2.14",
"@angular/forms": "~8.2.14",
"@angular/platform-browser": "~8.2.14",
"@angular/platform-browser-dynamic": "~8.2.14",
"@angular/router": "~8.2.14",
"@types/googlemaps": "^3.39.8",
"dom-to-image": "^2.6.0",
"html-to-image": "^1.6.0",
"html2canvas": "^1.0.0-rc.7",
"rxjs": "~6.4.0",
"tslib": "^1.10.0",
"zone.js": "~0.9.1"
}
The text was updated successfully, but these errors were encountered: