Twitter Bootstrap CSS affecting Google Maps

后端 未结 11 1804
情深已故
情深已故 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 11:08

    latest twitter bootstrap 2.0.4 includes this fix directly.

    If you are wrapping your content in the a (div class="container") as in the demo page of twitter bootstrap, you should add a style="height: 100%"

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

    There is also an issue with printing maps using Print in any browser. The img { max-width: 100% !important; } will not be fixed by the code above: you need to add an !important declaration like so:

    @media print {
      img {
        max-width: auto !important;
      }
    }
    
    0 讨论(0)
  • 2020-11-27 11:12

    I am using gmaps4rails, this fix did it for me:

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

    None of these answers worked for me, so I went in to my div and looked at its children I saw a new div with class "gm-style", so I put this in my CSS:

    .gm-style img {
        max-width: none;
      }
    
      .gm-style label {
        width: auto; display:inline;
      }
    

    ..and that solved the problem for me.

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

    Give your map canvas div an id of map_canvas.

    This bootstrap commit includes the max-width: none fix for the id map_canvas (but it won't work for mapCanvas).

    0 讨论(0)
提交回复
热议问题