I\'ve been googling that question for some time and all I got is headache. I add google marker with infobox on my google map, but the infobox is located lower than marker, h
By default the infoBox will point the bottom left of the marker. You can simply do this:
var ib= new InfoBox({
....//other properties,
pixelOffset: new google.maps.Size(-25, 0) //where your marker's height is 25px
});
set the alignBottom
-property of the infoBox to true
(default is false
). For further adjustments of the position use the pixelOffset
-property of the infoBox
infobox = new InfoBox({
content: document.getElementById("infobox"),
disableAutoPan: false,
maxWidth: 150,
pixelOffset: new google.maps.Size(-140, -45),
zIndex: null,
boxStyle: {
background: "url('http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/examples/tipbox.gif') 0% 100% no-repeat",
opacity: 0.75,
width: "280px"
},
infoBoxClearance: new google.maps.Size(1, 1),
alignBottom: true
});
#infobox {
border:2px solid black;
margin-bottom: 8px;
background:#333;
color:#FFF;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
padding: .5em 1em;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
text-shadow:0 -1px #000000;
-webkit-box-shadow: 0 0 8px #000;
box-shadow: 0 0 8px #000;
}
// Load the customized arrow from local