google map infobox position

前端 未结 3 2078
北荒
北荒 2021-01-12 02:18

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

3条回答
  •  误落风尘
    2021-01-12 02:37

    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
    });
    

提交回复
热议问题