Google maps api v3 infowindow position in custom image

Nick picture Nick · Feb 29, 2012 · Viewed 18.4k times · Source

I implemented the v3 of google maps in my site. I created custom images to show points on the map.

One of the custom images is 120px X 120px size and i would like to point the arrow of infowindow in the center of this image and not on the top middle.

How can i do that?

Answer

Heitor Chang picture Heitor Chang · Feb 29, 2012

Try using the pixelOffset option in InfoWindowOptions.

    myinfo = new google.maps.InfoWindow({ 
      content: "my content",
      pixelOffset: new google.maps.Size(0, 60)
    });
    myinfo.open(map, marker);

Positive y-offset values send the InfoWindow down.