Hmm I tried those things and it didn't work (testing in FireFox 3)--I
hope I didn't do it wrong!

One, I tried adding a GEvent.addDomListener like this:
        GEvent.addDomListener(document.getElementById('map'), 'resize',
function()
        { map.setCenter(map._lastCenter); });
(my map div ID is "map")
I also tried that with the div ID "main" which is the container for
"map" (and with both higher-level containers)
Is that the way it should be done?

Two, I added
        map.checkResize();
at the end of the
        if (GBrowserIsCompatible()){ }
block.

All this is at http://www.healthypetmobilevet.com/demomap.shtml if you
want to look.

Arrgh!
-Brian

On Apr 22, 5:18 pm, Brian P <[email protected]> wrote:
> My map div changes size when the font size changes, and also when it's
> printed. I'm less worried about making it recenter after a font size
> change than I am about when it's printed, but solving the the first
> should solve the second (I think).
>
> I'll try adding a checkResize(), and will read up on the
> GEvent.addDomListener and see if that will help.
>
> Thanks,
> Brian
>
> On Apr 22, 4:34 pm, Andrew Leach <[email protected]>
> wrote:
>
> > On Apr 22, 8:55 pm, Brian P <[email protected]> wrote:
>
> > > OK so it looks like I should be using:
> > >    GMap2.savePosition()
> > >    GMap2.returnToSavedPosition()
> > > and maybe
> > >    GMap2.checkResize()
>
> > > But I haven't figured out how to tell when the div changes size (or,
> > > alternatively, when the document is printed). So far my
> > > experimentation hasn't fixed it.
>
> > The div will only change size if the window changes size (I think: can
> > you think of another scenario?) so a window.onresize event will catch
> > that. GEvent.addDomListener might be useful.
>
> > Catching when the document is printed is not quite so obvious,
> > perhaps. What you could do is put a checkResize() call as the last
> > thing done. With an ordinary webpage, it won't do anything useful;
> > when rendering for print, it might work.
>
> > Andrew
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to