0

why i can't print the polygon when i using library @react-google-maps/api ? when i make it as pdf the data goes in, but when i click dowload which code like this

const print =() => {
     var printContents = document.getElementById('canvas').innerHTML;
     var originalContents = document.body.innerHTML;

     document.body.innerHTML = printContents;

     window.print();

     document.body.innerHTML = originalContents;
}

the google maps data not generated, the polygon missing.

Has anyone had any success with this?

Dicka Reynaldi
  • 329
  • 2
  • 11

1 Answers1

0

The issue is that the Google Maps API is modifying the display with CSS for print.

enter image description here https://developers.google.com/maps/faq#print

Justin Poehnelt
  • 2,992
  • 1
  • 19
  • 23