Print a Google Maps API v4 map with polygon
I am trying to print a map I have created with Google Maps API v3. The map
contains a polygon. I am using the pop-up method to try to print it:
var gmapPrint = function() {
var content = window.document.getElementById('map-canvas') // get you
map details
var newWindow = window.open(); // open a new window
newWindow.document.write(content.innerHTML); // write the map into the
new window
newWindow.print(); // print the new window
}
The map prints just fine, but the polygon is missing. At first, it seemed
as though the print dialog was popping up before the polygon was drawn on
the map, so I added a setTimeout. This did not fix the issue. I have also
tried using the static maps API, but the number of points in the boundary
of my polygon exceed the maximum URL size, even when encoded.
Has anyone had any success with this?
No comments:
Post a Comment