2

In my google map, when infowindow opens, it always open at the top of the marker and when the marker is at boundary line of the container, it moves the whole map. (http://www.advantarealty.com/Search//Condo,Single-Family-Home,Townhome_PropertyType/True_ForMap/)

To prevent this, I used disableAutoPan property of the inforwindow which prevents the map to move. But problem is it always opens the infowindow at the top of the marker, so when the marker is at the top, it's not completely visible.

I want to do something like http://www.zillow.com/homes/for_sale/days_sort/39.088235,-76.686287,38.720073,-77.3592_rect/10_zm/ which determines where to open the infowindow (top or bottom of the marker)

FYI: I already tried Preventing Google Maps Move After Displaying Infowindow etc for the same.

Community
  • 1
  • 1
Jitendra Pancholi
  • 7,897
  • 12
  • 51
  • 84
  • it's different from my question. I already tried disableAutoPan which prevents the map move but it always opens the infowindow at the top. Pls read my question again. His fiddle also does not resolve my problem (http://jsfiddle.net/svigna/SJCNp/) – Jitendra Pancholi Jul 03 '15 at 06:30
  • @Downvoter: kindly leave a reason if you really know. :) – Jitendra Pancholi Jul 03 '15 at 06:38

1 Answers1

2

A google.maps.Infowindow always opens on the top of the particular position, there is no option to change this behaviour.

To achieve it you must calculate the distance between the marker and the edges of the map and implement a custom Infowindow(overlay) which opens at the desired position. It should be possible by using e.g. InfoBox

Dr.Molle
  • 116,463
  • 16
  • 195
  • 201