Great little function google maps pan over

So lets say you have a google map, and you want to open a marker, but when you open it the infowindow is cut off by the top of the map.

Well, next time try this,…

google.maps.event.trigger(thisMarker,’click’);
map.setCenter(thisMarker.getPosition());
var mapCenterOff = thisMarker.getPosition().lat() + .015;
var offSet = new google.maps.LatLng(mapCenterOff, thisMarker.getPosition().lng());
map.panTo(offSet);

And it should pan to the offset.,

Comments are closed.