The maps display perfectly fine in a regular div, but when placed inside a Bootstrap modal, only half or part of the map is visible. However, when I open the console, the issue resolves itself and the entire map is shown.
Photo without console opened
Photo with console opened
This is how I styled it:
<style>
#map_canvas{
width:100%;
height: 230px;
border: 1px solid #333335;
margin-bottom:20px;
}
</style>
HTML for the modal:
<!-- Map Modal -->
<div class="modal fade" id="mapModal" tabindex="-1" role="dialog" aria-labelledby="mapModalLabel" aria-hidden="false">
<div class="modal-dialog" >
<div class="modal-content">
<div class="modal-header" >
<button type="button" class="close" data-dismiss="modal" aria-hidden="false">×</button>
<h4 class="modal-title" id="mapModalLabel">Map: </h4>
</div>
<div class="modal-body" >
<map id="map_canvas" nid="{{nhd.nid}}"></map>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->