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?
An InfoWindow can be placed on a map at a particular position or above a marker, depending on what is specified in the options. Unless auto-pan is disabled, an InfoWindow will pan the map to make itself visible when it is opened. After constructing an InfoWindow, you must call open to display it on the map.
Move an info windowAttach the info window to a new marker using the InfoWindow. open() method. Note: If you call open() without passing a marker, the InfoWindow will use the position specified upon construction through the InfoWindowOptions object literal.
We can explicitly create a reference to a specific infowindow by assigning it to a custom key to the marker object, and then later retrieving it by using that reference when the marker is clicked and the event is fired. By assigning the infowindow to a marker property, each marker can have it's own infowindow.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With