Jitendra Pancholi
Jitendra Pancholi

Reputation: 7562

Google Map infowindow moves the whole map

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.

Upvotes: 2

Views: 453

Answers (1)

Dr.Molle
Dr.Molle

Reputation: 117334

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

Upvotes: 2

Related Questions