Google Map v3 InfoBox和closeBox [英] Google Map v3 InfoBox and closeBox
本文介绍了Google Map v3 InfoBox和closeBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我目前有一个自定义的infoBox,并使用JScript设置属性
I currently have a customised infoBox and I set properties using JScript
var infoBoxOptions = {
content: infoContent
,disableAutoPan: false
,maxWidth: 0
,pixelOffset: new google.maps.Size(-140, 0)
,zIndex: null
,boxStyle: {
background: "url('/files/0/11/tipbox.gif') no-repeat"
,width: "255px"
,padding:"9px"
}
,closeBoxURL: "/files/0/11/icon-close.gif"
,infoBoxClearance: new google.maps.Size(1, 1)
,isHidden: false
,pane: "floatPane"
,enableEventPropagation: false
};
当我检查HTML中的BoxClose图像时,如下所示:
when I check HTML the BoxClose image is as follows
<img align="right" style=" position: relative; cursor: pointer; margin: 2px;" src="/files/0/11/icon-close.gif">
如何将位置设置为绝对值并将顶部属性和右侧属性设置为关闭按钮? p>
How can I set the position to absolute and give top and right properties to the close button?
推荐答案
有一个名为Close Box Margin的属性,它允许您使用CSS边距定位关闭框。我不认为它增加了一个绝对的位置,但它可以让你自由移动关闭框。
There is a property called Close Box Margin, this allows you to position the close box with CSS margins. I don't think it adds a position of absolute, but it will allow you to move the close box freely.
//Setting the options for the information window
var infoBoxOptions = {
closeBoxURL: "/Content/images/TempImages/close.png",
closeBoxMargin: "-10px -60px 10px 10px"
}
这帮助我将我的收盘箱放在我需要的地方。
This helped me position my close box exactly where I needed it.
这篇关于Google Map v3 InfoBox和closeBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文