On Sep 4, 9:25 am, Servo <[EMAIL PROTECTED]> wrote:
> marcelo wrote:
> > It's not off to the right of the marker. That's just how far the
> > clickable area extends, and the center-left of the marker's
> > clickable area is covered by the control.
>
> Of course! You are correct, Marcelo. Thank you. Don't know what I was
> thinking.
>
> > 3. use a mouseover event handler on the marker, in which
> > you hide the control.
>
> Intriguing idea. I'll have to play with that one. Though I'm not sure
> how intuitive the behavior would be.
>
> [EMAIL PROTECTED] wrote:
> > Modify the place you center the map so the marker isn't
> > under the control.  I thought this:
> > map.setCenter(bounds.getCenter(),map.getBoundsZoomLevel(bounds));
> > would avoid the control, but it doesn't seem to.  You are manually
> > centering your map anyway, so just nudge the center to the left so the
> > marker click target isn't obscured by the control.
>
> Thanks Larry. This does seem like the proper solution. I went to
> centering the map manually because I wasn't able to get
> bounds.getCenter(), map.getBoundsZoomLevel() to work correctly
> (different issue). Though, ultimately, I'd love to move back to that
> method since my manual method isn't 100% reliable.
> But, you're right, the automatic method does nothing to avoid the
> GLargeMapControl.
> If I were to stick with the manual centering, I'd only really want to
> nudge the center if there was actually a marker under the mapcontrol
> (otherwise, everything would be needlessly shifted to the right). Just
> not sure how to detect that.
> Alternatively, perhaps there's a way to actually (manually) "pad" the
> bounds polygon on the left, so space for the mapcontrol is considered
> when calling .getCenter().

Yes.  Manually "pad" the bounds polygon on the left.
// DANGER *** untested code ***
var southWest = bounds.getSouthWest();
southWest = new GLatLng(southWest.lat(),southWest.lng()-padding);
bounds.extend(southWest);

The "right" way to do it would be to adjust the size used in the
bounds calculation for the map by the width of the control.
  -- Larry

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