Google maps api v3 infowindow position in custom image
-
14-11-2019 - |
Question
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?
Solution
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow