title: Load google map dynamicly in twitter bootstrap modal
body: <p>I'm Trying to add a map dynamically inside a modal window of a twitter bootstrap but it dose not seem to work.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
      &lt;head&gt;
          &lt;link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"&gt;
          &lt;style type="text/css"&gt;
    #map-canvas  {
    margin: 0;
    padding: 0;
    height: 100%;
  }
  
  #map-canvas {
    width:100%;
    height:400px;
  }
          &lt;/style&gt;
      &lt;/head&gt;
  
      &lt;body  &gt;
  
          &lt;h1 class=""&gt;Lazy Load Google Map&lt;/h1&gt; 
  &lt;a href="javascript:;" class="view" data-lat="23, 18.33"&gt;Launch Map Modal&lt;/a&gt;
  
  &lt;div class="modal fade" id="myMapModal"&gt;
      &lt;div class="modal-dialog"&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="modal-header"&gt;
                  &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;×&lt;/button&gt;
                   &lt;h4 class="modal-title"&gt;Modal title&lt;/h4&gt;
  
              &lt;/div&gt;
              &lt;div class="modal-body"&gt;
                  &lt;div class="container"&gt;
                      &lt;div class="row"&gt;
                          &lt;div id="map-canvas" class=""&gt;&lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="modal-footer"&gt;
                  &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
                  &lt;button type="button" class="btn btn-primary"&gt;Save changes&lt;/button&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;!-- /.modal-content --&gt;
      &lt;/div&gt;
      &lt;!-- /.modal-dialog --&gt;
      &lt;/div&gt;
      &lt;!-- /.modal --&gt;
  
          &lt;script type='text/javascript' src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt;
  
  
  
          &lt;script type='text/javascript' src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"&gt;&lt;/script&gt;
  
  
  &lt;script type='text/javascript' src="http://maps.googleapis.com/maps/api/js?sensor=false&amp;extension=.js&amp;output=embed"&gt;&lt;/script&gt;
  
  
  
  
  
          &lt;script type='text/javascript'&gt;
  
          $(".view").click(function(){
              var element = $(this);
  
          var map;        
              var myCenter=new google.maps.LatLng(element.attr("data-lat"));
  var marker=new google.maps.Marker({
      position:myCenter
  });
  $('#myMapModal').modal('show');
  
  function initialize() {
    var mapProp = {
        center:myCenter,
        zoom: 14,
        draggable: false,
        scrollwheel: false,
        mapTypeId:google.maps.MapTypeId.ROADMAP
    };
  
    map=new google.maps.Map(document.getElementById("map-canvas"),mapProp);
    marker.setMap(map);
  
    google.maps.event.addListener(marker, 'click', function() {
  
      infowindow.setContent(contentString);
      infowindow.open(map, marker);
  
    }); 
  };
  google.maps.event.addDomListener(window, 'load', initialize);
  
  google.maps.event.addDomListener(window, "resize", resizingMap());
  $('#myMapModal').on('show.bs.modal', function() {
     //Must wait until the render of the modal appear, thats why we use the resizeMap and NOT resizingMap!! ;-)
     resizeMap();
  })
  
  function resizeMap() {
     if(typeof map =="undefined") return;
     setTimeout( function(){resizingMap();} , 400);
  }
  
  function resizingMap() {
     if(typeof map =="undefined") return;
     var center = map.getCenter();
     google.maps.event.trigger(map, "resize");
     map.setCenter(center); 
  }
  
              });
  
  
  
          &lt;/script&gt;
  
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Please help me out.</p>