question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem to generate the image of map (Google Maps)

See original GitHub issue

hi, guys. I need to generate a image of my dialog:

1

Using html2canvas, but the image create doesn’t show the map:

2

My code:

            function imagem()
            {
                var html2obj = html2canvas($('#dialogPrint'));
                var queue  = html2obj.parse();
                var canvas = html2obj.render(queue);
                var img = canvas.toDataURL();
                window.open(img);
            };

i need help, please. thanks

Issue Analytics

  • State:open
  • Created 10 years ago
  • Comments:53 (7 by maintainers)

github_iconTop GitHub Comments

15reactions
rSensationcommented, Feb 27, 2018

Seems that in the new version of google maps transform is applied to the different div. Using @GCorbel’s solution but with this selector (“.gm-style>div:first>div:first>div:last>div”) seems to work. Though I haven’t yet tested it thoroughly.

10reactions
hseedacommented, Sep 11, 2018
    html2canvas($('.gm-style>div:eq(0)')[0],{
        useCORS: true,
        allowTaint: true,
        async:false,
    }).then(canvas => {document.body.appendChild(canvas)});
Read more comments on GitHub >

github_iconTop Results From Across the Web

Get Started | Maps Static API - Google Developers
size (required) defines the rectangular dimensions of the map image. This parameter takes a string of the form {horizontal_value}x{vertical_value} . For example ...
Read more >
Troubleshoot Street View publishing issues - Google Maps Help
Make sure you have a clear GPS signal, then re-capture your image. Unable to process location information: Re-capture the Street View.
Read more >
Google Maps image? - Stack Overflow
I just found out that the static map can also draw lines. The points are sent through the URL. E.g. maps.google.com/… This still...
Read more >
Python | Get a google map image of specified location using ...
Google Static Maps API lets embed a Google Maps image on the web page without requiring JavaScript or any dynamic page loading.
Read more >
Create a map or story in Google Earth Web
Let's Get Started! The new creation tools in Google Earth allow you to easily create and share maps and stories about our world...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found