[GIS] Google Infowindow Position

google mapsinfowindow

I am using google maps and using markers on the map. When user clicks on any marker showing related information in the Infowindow and every thing is working fine.

But every time the infowindow opens on top of the marker. Our requirement is infowindow should open/come left,right,top or bottom with respective to the available space.

Thanks

 google.maps.event.addListener(marker, 'click', function() {
         if(infowindow){
             infowindow.close();
         }
         infowindow  = new google.maps.InfoWindow();
         //var centerPos = new google.maps.LatLng(latlng.lat(), latlng.lng());
         //map.setCenter(centerPos,65);
         infowindow.setContent(contentString);
         infowindow.open(map,marker);

    });

Best Answer

The standard info window will only show above the marker. If you want an info window to be positioned elsewhere, you will have to look at the various custom info windows that others have created, or created your own.

Related Question