Twitter Bootstrap CSS affecting Google Maps

后端 未结 11 1803
情深已故
情深已故 2020-11-27 10:31

I\'m using Twitter Bootstrap, and have a Google map.

Images on the map, such as marker are being skewed by the CSS in Bootstrap.

In the Bootstrap CSS there i

相关标签:
11条回答
  • 2020-11-27 10:53

    There is also an issue with the dropdown selectors for terrain and overlays, adding both these will fix the issues...

    #mapCanvas img { 
      max-width: none;
    }
    
    #mapCanvas label { 
      width: auto; display:inline; 
    } 
    

    The second style will sort of other issues with the terrain and overlay box in some browsers.

    0 讨论(0)
  • 2020-11-27 10:53

    Changing the #MapCanvas didn't work for us using gmap4rails gem, but did when we changed to

    .map_container img {
        max-width: none;
    }
    
    .map_container label {
        width: auto; display:inline;
    }
    
    0 讨论(0)
  • 2020-11-27 10:55

    All answers were max-widht:none

    for me, max-height:inherit worked.....

    People are using #map, #map_canvas, etc. Look at your parent div. If it's blue, than it will be #blue img { }

    0 讨论(0)
  • 2020-11-27 10:56

    I also had to turn box-shadow off, and because of the order of my includes, I added the !important flag.

    #mapCanvas img {
        max-width: none !important;
        box-shadow: none !important;
    }
    
    0 讨论(0)
  • 2020-11-27 11:03

    You want to over-ride the max-width rule in the CSS section by using max-width: none; This seems to be the way around this problem

    0 讨论(0)
  • 2020-11-27 11:04

    With Bootstrap 2.0, this seemed to do the trick:

    #mapCanvas img {
      max-width: none;
    }
    
    0 讨论(0)
提交回复
热议问题