我需要使用map.getDiv()函数在Google地图中复制包括要素在内的所有元素。但是在复制div.only标记和显示的图层点后,绘制的图层不显示。
var mapDiv= map.getDiv();
var printContents = mapDiv.innerHTML;
var mywindow = window.open('', 'mapElement', 'height=600,width=600');
mywindow.document.write('<html><head><title>Map Printing</title>');
mywindow.document.write('</head><body>');
mywindow.document.write(printContents);
mywindow.document.write('</body></html>');