如何降低谷歌地图API的地方V3的填充信息窗口 [英] How to Reduce the padding of the Google Maps Places API v3 InfoWindow
问题描述
我试图让与萤火虫对象的ID,但没有成功。
I tried to get the id of the object with FireBug, but no success.
我也研究了一下,从谷歌地图的信息框code,但过于复杂,对于小的事情,我需要的,它只是降低了信息窗口的填充。
I've also played around with the InfoBox code from google Maps, but was too complex, for the little thing I need, which is just to reduce the padding of the infowindow.
推荐答案
您链接到显示了如何信息窗口的内容构造页的第17行:
Line 17 of the page you linked to shows how the infowindow content is constructed:
infowindow.setContent('<div><strong>' + place.name + '</strong><br>' + address);
您需要设置填充的内联(例如,样式=边距:0px;
)或通过CSS类(例如,类=myInfoWindow
),然后将你的头或一个单独的CSS文件中的CSS属性。
You'll need to set the padding for the either inline (e.g., style="padding: 0px;"
) or through a CSS class (e.g., class="myInfoWindow"
) and then set the CSS properties in your head or a separate CSS file.
因此,使用前者,你会改变该行:
So using the former, you would change the line to:
infowindow.setContent('<div style="padding: 0px;"><strong>' + place.name + '</strong><br>' + address);
这篇关于如何降低谷歌地图API的地方V3的填充信息窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!