Problem printing google maps printing and using 'page-break-before' in IE8

Posted by murdoch on Stack Overflow See other posts from Stack Overflow or by murdoch
Published on 2010-06-11T14:24:54Z Indexed on 2010/06/11 14:42 UTC
Read the original article Hit count: 634


I'm having an annoying problem trying to get an html page with a google map on it to print correctly, I have a google map with an <h2> above it all wrapped in a div and the div is set to 'page-break-before:always;' in the css so that the map and its heading always sits on a new page.

The problem is that in IE8 only i can always see a large portion of the map rendered on the previous page when printed, also the part of the map that is visible on the previous page is that which is outside the visible bounds of the map.


<div id="description">
    <p>Some paragraph of text</p>
    <p>Some paragraph of text</p>
    <p>Some paragraph of text</p>

<div id="map">
    <div id="mapHolder"></div>
    <script type="text/javascript">
       // ... javascript to create the google map


#map { page-break-before:always; }

Here is a screen grab of what it renders like in IE8

It works fine in every other browser i have tried including IE7 so i'm a bit lost, has anyone any ideas of any tricks to stop this from happening?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html