OK, I have a demo page that shows this problem. I took out a lot of
what appears on the page I listed earlier in this thread, but there is
still some CSS that does the important stuff. Also, the javascript is
all in the page. Here's the demo:
http://www.healthypetmobilevet.com/demomap.shtml
I re-sized the floats significantly on print so the problem would be
evident. When going from a window size of 1920x1200 to the 8.5x11 inch
print div, I see the problem in FF3, but it's not as noticeable when
going from 1024x768 to print on the original page. This page does a
more severe re-size of the floats so the problem is easy to see. It
happens in FireFox, IE6+, latest Opera, and latest Safari, but does
NOT seem to occur in the latest Chrome (though Chrome doesn't seem to
print transparency to Adobe PDF--I didn't print to dead tree).
This page MAY crash IE 6. I don't know since I don't have it, but it
crashed the IE6 tab in "IETester" (my only way to test IE6 display),
but then didn't crash a second time. Also, IE6 doesn't work correctly
(that's an understatement) so there's some additional CSS to repair
IE6's broken rendering in a separate file.
Anyone have a clue what's going on here? And is there any way to get
the map centered on print?
Part of the problem might be that the map re-centers only when the
window changes size, not when the map div changes size. You can
probably watch the map div change size by switching font sizes (Ctrl+<
+> or Ctrl+<-> for most browsers). There are limits, so if your window
is small (1024x768) you might have to go down a lot in font size. If
your window is really small (800x600) it might not re-size at all.
Does anyone know a listener I can add to check for a change in div
size instead of window size?
This is the section that watches for window resizing:
GEvent.addListener(map, 'moveend', function()
{ map._lastCenter=map.getCenter(); });
GEvent.addListener(map, 'resize', function()
{ map.setCenter(map._lastCenter); });
Thanks,
Brian
On Apr 21, 5:31 pm, Brian P <[email protected]> wrote:
> Thanks Marcelo,
>
> I think you're right--I should try to set up a demo page and see if I
> can find the problem. I definitely have quite a bit of CSS going on
> here: a main CSS, an IE-specific CSS, a print CSS, two CSS's from
> Google, plus another CSS to fix display problems from Google's CSS!
> All to try to get things to display well at different font sizes and
> browser window sizes. Of course old browsers don't work well at
> anything, especially IE6. Not surprised that IE6 doesn't know how to
> print using CSS, that I can accept. Now I need to look at it with FF2
> though--been using 3 and it's mostly great except for the printing
> issues I'm trying to iron out. In fact it's FF3 that causes the
> greatest shift when trying to print for me.
>
> I'll try to put together a demo page to see if I can recreate the
> behavior--I'm sure I'll need some CSS since the dynamic sizing of the
> map div is what's causing it. The thing that makes me nuts is that re-
> sizing the map div is fine as long as it's not done for printing. I
> use this:
>
> <code>
> map._lastCenter=map.getCenter();
> GEvent.addListener(map, 'moveend', function()
> { map._lastCenter=map.getCenter(); });
> GEvent.addListener(map, 'resize', function()
> { map.setCenter(map._lastCenter); });
> </code>
> (saw that here somewhere I think)
>
> And changes to the map div size result in an update to the map center.
> The div changes size when the user changes the font size or
> potentially the window size as well (up to limits).
>
> I'll post here again if I can create the problem with a simpler demo
> page, and I'll put the script and CSS all in the page (except for
> Google's stuff--BTW, that's for the google.maps.LocalSearch control,
> which is described
> at:http://www.google.com/uds/solutions/localsearch/reference.html).
>
> Thanks again,
> Brian
>
> On Apr 21, 4:33 pm, marcelo <[email protected]> wrote:
>
> > On Apr 21, 9:58 pm, Brian P <[email protected]> wrote:
>
> > > Please someone let me know if I'm asking a reasonable question here.
>
> > The reason why no one has responded so far could be that your page
> > requires some special conditions to be examined.
> > I don't have a printer and I don't have IE7, so I had to install a
> > printer in order to view your page with "print preview".
>
> > I looked at it with FF2 and IE6.
>
> > On FF2, the map prints on the same position as it is seen in the
> > browser, but the polygons do not print, and the page width is some
> > fixed value.
> > In IE6, the page is much wider, (full screen width), and therefore
> > wider than the print page.
>
> > I think your issue is in the CSS, but you're loading as many as 6 CSS
> > files and I really don't have the time to examine them all in detail.
> > I'd suggest asking in a CSS group, otherwise it would probably help if
> > you could build a simpler stripped down page that demonstrates the
> > problem, and in the process of doing that you might find the answer
> > yourself.
>
> > --
> > Marcelo -http://maps.forum.nu
> > --
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---