简体   繁体   中英

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

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.

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 (eg, style="padding: 0px;" ) or through a CSS class (eg, 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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM