Oh by the way, this will likely cause trouble with print. I couldn't get print media to center exactly right with a variable-sized map div and finally gave up. The only browser that got it right was Chrome.
-Brian On May 18, 9:31 am, Brian P <[email protected]> wrote: > Yep this is just CSS, though you have some issues when the div is re- > sized. You need to listen for that and re-center the map, or changing > the window size will put the map off-center. > > This code snippet will help with that, it comes from my map > implementation (and originally from some post in here I think) > athttp://www.healthypetmobilevet.com/area.shtml > with JS code athttp://www.healthypetmobilevet.com/map.js > > map._lastCenter=map.getCenter(); > GEvent.addListener(map, 'moveend', function() > { map._lastCenter=map.getCenter(); }); > GEvent.addListener(map, 'resize', function() > { map.setCenter(map._lastCenter); }); > > That keeps the map centered when the window is re-sized, but if your > div re-sizes due to a font size change that won't do it. You'd have to > add something like this: > > setInterval(function() { map.checkResize(); }, 500); > > (It didn't sound like you'll have that problem if you're just sizing > at 90/10%) > > -Brian > > On May 18, 5:20 am, [email protected] wrote: > > > This is a Javascript problem not a Maps API one. There are a number of > > different ways to do this. Just applying 90% and 10% as the width > > styles for the divs will do it. There are many other ways of making > > the sidebar fixed and the map variable. > > > One of my solutions was:http://www.lanerealty.com.au/HomesMap.html(a > > bit complex and I am sure there are better ways to do this, but.... if > > it ain't broke don't fix it!) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
