Print sidebar but not map

58 views
Skip to first unread message

Fred Weaver

unread,
Aug 25, 2011, 7:46:02 AM8/25/11
to google-map...@googlegroups.com
Site: http://webdesign.fredweaver.biz/CycleFest/

When I print the page it only prints the sidebar and does not include the map.

Andrew Leach

unread,
Aug 25, 2011, 12:48:56 PM8/25/11
to google-map...@googlegroups.com

Your css does not include a size for the map when media="print", so
it's been given a zero size.

Fred Weaver

unread,
Aug 25, 2011, 10:32:13 PM8/25/11
to Google Maps JavaScript API v3
css sized the map_canvas

#map_canvas {
padding: 50px;
float: right;
height: 800px;
width: 500px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #000;
border-right-color: #000;
border-bottom-color: #000;
border-left-color: #000;
}


On Aug 25, 9:48 am, Andrew Leach <andrew.leac...@gmail.com> wrote:

Andrew C Leach

unread,
Aug 26, 2011, 4:30:21 AM8/26/11
to google-map...@googlegroups.com
You used CSS with media="screen" which does not include printed output. You need to have a media="print" specification, or separate out some directives into media="all". -- Sent from my phone. Sorry for brevity and any formatting oddities.

css sized the map_canvas

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.


Fred Weaver

unread,
Aug 30, 2011, 8:35:39 AM8/30/11
to Google Maps JavaScript API v3
Tried that too. My workaround was to add a "Print" button that
referenced a page with only the map on it.
<input type="BUTTON" value="Print Map"
onclick="window.location.href='printmetric.html'" />
See http://webdesign.fredweaver.biz/CycleFest/
In V2 I did not have this problem. Although I did place the sidebar
and the map inside a table, now I'm using <div> for the sidebar with a
table inside it, hmmm.

Esa

unread,
Aug 30, 2011, 8:50:14 AM8/30/11
to Google Maps JavaScript API v3
In your html
<link href="style.css" rel="stylesheet" type="text/css"
media="screen" />

Attribute media="screen" makes that you don't have any css rules for
print. Delete the attribute and you will have similar CSS for screen
and printing.
Reply all
Reply to author
Forward
0 new messages