2012-04-02 34 views
3

我的Chrome版本为18.0.1025.142米。Chrome将不会打印自定义Google地图(即div内)

我使用JS API来制作这个Google Map,但地图部分不会显示在Chrome的打印预览中,或者实际上在纸上打印。

然后我试图shrink the map。现在,这些内容显然适合于一个页面,并显示在IE,FF和Opera的打印预览中。所以尺寸不是问题。

我有任何非正统的HTML或JS?有没有办法重写页面(也许添加正确的CSS),以便在Chrome中打印?忽略大多数JS,这是这里无关紧要的,这是我写的东西(的map_canvas提供DIV显示地图)

<!DOCTYPE html> 
<html> 
    <head> 
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> 
    <style type="text/css"> 
     html { height: 100% } 
     body { height: 100%; margin: 0; padding: 0 } 
     #map_canvas { height: 67%; width: 30% } 
    </style> 
    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script> 
    <script type="text/javascript"> 
     var map; 
... 
function initialize() { 
     geocoder = new google.maps.Geocoder(); 
     map = new google.maps.Map(document.getElementById("map_canvas"), 
      mapOptions); 
... 
</script> 
    </head> 
    <body> 
    <div id="menu"> 
     <b>address:</b> 
     <input id="text_address" type="text" size="60" onkeyup="checkReturn(event)"> 
     <input id="check_sp" type="checkbox" checked="checked">SP 
     <input type="button" value="clear" onclick="document.getElementById('text_address').value=''; document.getElementById('text_address').focus()"> 
     <input id="button3" type="button" value="clear markers" onclick="clearMarkers()"> 
    </div> 
    <div id="map_canvas"> 
    </div> 

    </body> 
</html> 
+0

也许在打印时将地图元素交换为静态地图图像? – 2012-04-20 10:17:00

回答

3

好,似乎打印工作千篇一律的页面时。因此,将其缩小到适合A4页面的尺寸并且您很好:)您可以:

<div id="map_canvas" style="width:800px; height:1000px;"> 
+0

伟大的时机!你得到+50! – 2012-04-20 13:20:26