bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

bootstrap.css interfering with Google Maps InfoWindow

Open tkompare opened this issue 14 years ago • 24 comments

Something in bootstrap.css (v2.0.1) is interfering with Google Maps info window's display. When you click on a map point, the information bubble display is altered. For example: http://311servic.es/treetrim/ Click on any dot on the map to see what I mean. when I remove the bootstrap CSS file, Google Maps information bubbles looks correct.

Other than that, I'm loving Bootstrap.

tkompare avatar Mar 05 '12 16:03 tkompare

I'm seeing the exact same behaviour here.

franciso avatar Mar 05 '12 17:03 franciso

We don't have time yet to track this one down, and I'm not familiar with Google Maps at all on this level. Can you try to isolate the problem?

mdo avatar Mar 06 '12 04:03 mdo

I'll see what I can do. I'm no CSS expert, but can fumble through it, generally. However, I will be working on a project soon with a CSS ninja and we're using Bootstrap with Google Maps in a similar fashion to what is already described. We'll definitely have to find a way around this bug then. I'll keep you posted.

tkompare avatar Mar 06 '12 05:03 tkompare

work with t'is

#map_canvas img { max-width: none; }

Where your id map name #map_canvas

gfpl001 avatar Mar 06 '12 10:03 gfpl001

gfpl001's works. Fixed this issue right up. I added:

#theMap img {
    max-width: none;
}

Magic. Not sure why one has to set 'max-width'. But it works and its not a Twitter Boostrap bug. Seems more related to how Google is styling its info windows. Saw this after more internet digging: http://stackoverflow.com/questions/1554893/google-maps-api-v3-infowindow-not-sizing-correctly.

Thanks for the hint. This saved me untold hours.

tkompare avatar Mar 07 '12 02:03 tkompare

I experienced a similar problem when adding a weather layer to a Google Map http://greatname.se/marcus/weather with twitter bootstrap; besides the max-width issue i got unwanted x- and z-scrollbars in the info window for the weather info. Tracked it down to "line-height:1.231;" in the bootstrap css. Removed it and it worked out fine. Info might help someone else.

marcusasplund avatar Apr 06 '12 17:04 marcusasplund

Thanks @gfpl001, that fixed my issue too.

goldcaddy77 avatar Apr 20 '12 06:04 goldcaddy77

I would suggest this as a more generic solution, although it is relying on the Google CDN url not changing. Google maps does not use any unique classes or ids that cover all images.

img[src^="http://maps.gstatic.com/"] {
    max-width: none;
}

datasage avatar Apr 25 '12 16:04 datasage

Hello guys, I'm facing the same problem. I fixed it ok with the solution you presented, BUT, for the responsive version, on an Iphone Safari and also on an Android phone I got a problem: The infowindow itself presents OK, but the CLOSE button dont work and appear weird ... Any clue on this? Thx a lot

mriso79 avatar May 08 '12 16:05 mriso79

send a screenshot ;) but where is the close ???

gfpl001 avatar May 08 '12 20:05 gfpl001

Here we go. Please note that the "X" to close the infowindow is distorted.

http://risox.com/img/x.png

mriso79 avatar May 09 '12 12:05 mriso79

datasage that worked perfectly. Thanks

rachaelroland avatar May 25 '12 21:05 rachaelroland

@marcosriso Android 3.2 browser does not seem to like max-width: none. Setting this property to "lots of pixels", i.e. max-width: 9999px, solved the problem for me.

raphaelnova avatar Jul 26 '12 14:07 raphaelnova

Thank you @rboanova i will try it out

mriso79 avatar Aug 07 '12 02:08 mriso79

thx also solved my problem.

subdesign avatar Sep 08 '12 09:09 subdesign

improving on @datasage css as images are fetched from many subdomains/domains.

img[src*="gstatic.com/"], img[src*="googleapis.com/"]  {
    max-width: 99999px;
}

anassuhaimi avatar Oct 07 '12 10:10 anassuhaimi

Thanx for the help, fixed the problem for me as well. Glad I found this sooner rather than later.

cincinatti02 avatar Nov 14 '12 13:11 cincinatti02

On my side, I had a display problem whit the zoom and streetview buttons. http://i.imgur.com/xZ8Vw.png

This solution also fixed my problem.

jfmmm avatar Dec 09 '12 22:12 jfmmm

Approximate duplicate of #1506.

cvrebert avatar Feb 28 '13 18:02 cvrebert

anas-suhaimi,

Thanks for your solution. It worked for me.

Best regards!

frontconnect avatar Mar 25 '13 12:03 frontconnect