views:

65

answers:

2

I have a class based on google.maps.OverlayView which implements a custom replacement for a standard InfoWindow.

You can see my custom overlays in action at http://www.qype.co.uk/uki/explore/category/883-eating-and-drinking

I need to be able to pan a map when the overlay doesn't fit completely in the visible area (standard behaviour for InfoWindows) and I can't figure out a way to do that.

I've tried something like this.map.panTo(this.getProjection().fromDivPixelToLatLng(this.getProjection().center)) but it didn't work the way I expected, so I'm somewhat lost.

+1  A: 

Hi,

i used this example ones, in that there is a method panMap which probably exactly does what you need.

http://gmaps-samples-v3.googlecode.com/svn/trunk/infowindow_custom/infowindow-custom.html

Hope it helps. The example looks very similar to your info window.

cheers

Tosa
Thanks, this code example helped. There's quite a bit more than one line of code required to implement this :)
leonya