apneadiving / Google-Maps-for-Rails

Enables easy Google map + overlays creation in Ruby apps
https://apneadiving.github.io/
MIT License
2.27k stars 382 forks source link

How to make responsive map? #545

Open Jatapiaro opened 7 years ago

Jatapiaro commented 7 years ago

Solved, just put your map inside a div.

<div id="map-container">
    <div id="map"></div>
</div>

Then add the following .css

<style type="text/css">
    #map-container {
      padding: 6px;
      border-width: 1px;
      border-style: solid;
      border-color: #ccc #ccc #999 #ccc;
      -webkit-box-shadow: rgba(64, 64, 64, 0.5) 0 2px 5px;
      -moz-box-shadow: rgba(64, 64, 64, 0.5) 0 2px 5px;
      box-shadow: rgba(64, 64, 64, 0.1) 0 2px 5px;
    //  width: 500px;
    }
    #map {
    //  width: 500px;
        height: 500px;
    }
</style>