i would say extend the bound a percentage in width to compensate, it might
need to tweaking, but that might just work. That was just make sure you
compensatie for the side bar offset in the center.

Something like,

Get the bound
extend them in width a percentage (perhaps related how much width the
sidebar takes up?)
offset the center by 200px (you can ask the api how many lat/lng a pixel
is).

That might give best results.

2009/4/28 René <[email protected]>

>
> That's one way, but I'm sure there must be someway to add/subtract a
> pixel value to the bounds value, as if assuming a smaller viewport.
>
> On Apr 28, 2:28 pm, Rossko <[email protected]> wrote:
> > > ...my question is, how should I compensate for the sidebar div, so
> > > that when the map is zoomed and re-centered, the sidebar doesn't cover
> > > the markers?
> >
> > You could get the API to do most of the work by having a second map,
> > invisible but created with a proper size - same height but 200px
> > narrower than the visible one.
> > Do your bounds, centre and zoom work on the invisible version.
> > Work out a primary map centre by  - get LatLngtoPixel from the
> > invisible centre, add on a 200px displacement (so the target centre is
> > right-shifted from the bounds centre), and reconvert Pixel to LatLng.
> >
> > cheers, Ross K
> >
>


-- 
Bjorn Brala
----------------
www.GeoStart.nl/english/ - Google maps - Swis Webdesign
twitter.com/bbrala

--~--~---------~--~----~------------~-------~--~----~
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