How to Reduce the padding of the Google Maps Places API v3 InfoWindow

 ̄綄美尐妖づ 提交于 2020-01-02 17:55:34

问题


I tried to get the id of the object with FireBug, but no success.

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.


回答1:


Line 17 of the page you linked to shows how the infowindow content is constructed:

infowindow.setContent('<div><strong>' + place.name + '</strong><br>' + address);

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


来源:https://stackoverflow.com/questions/8972084/how-to-reduce-the-padding-of-the-google-maps-places-api-v3-infowindow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!