Google map in a bootstrap tab - specific code
<p>The map doesn't load properly when using bootstrap tabs. The solution is to resize the map upon clicking the specific tab. I have been fooling with this for way too long. I have used other solutions I found on stack but I have no idea why its still not working. </p>

<p>Here is all of my code. I apologize for the sloppiness. I usually go back and pretty it up when I have finished the project.</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
    &lt;!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --&gt;
    &lt;meta name="description" content=""&gt;
    &lt;meta name="author" content=""&gt;
    &lt;link rel="icon" href="../../favicon.ico"&gt;
    &lt;link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Lobster|Oswald|Titillium Web|Roboto  "&gt;

    &lt;title&gt;Starter Template for Bootstrap&lt;/title&gt;

    &lt;!-- Bootstrap core CSS --&gt;
    &lt;link href="../../dist/css/bootstrap.min.css" rel="stylesheet"&gt;

    &lt;!-- Custom styles for this template --&gt;
    &lt;link href="starter-template.css" rel="stylesheet"&gt;
    &lt;script src="../../assets/js/ie-emulation-modes-warning.js"&gt;&lt;/script&gt;

    &lt;!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --&gt;
    &lt;!--[if lt IE 9]&gt;
      &lt;script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"&gt;&lt;/script&gt;
      &lt;script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"&gt;&lt;/script&gt;
    &lt;![endif]--&gt;


    &lt;script src="https://maps.googleapis.com/maps/api/js"&gt;&lt;/script&gt;
    &lt;script&gt;
      function initialize() {
        var mapCanvas = document.getElementById('map');
        var myLatLng = {lat: 64.8370761, lng: -147.697845};
        var mapOptions = {
          center: myLatLng,
          zoom: 16,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        }
        var map = new google.maps.Map(mapCanvas, mapOptions)
        var marker = new google.maps.Marker({
            position: myLatLng,
            map: map,
            title: "Nelson's Photography"
        });
      }

        $('a[data-toggle="tab"]').on('shown.bs.tab', function(e) {
            initialize();
        });

    &lt;/script&gt;
  &lt;/head&gt;



  &lt;body&gt;
    &lt;nav class="navbardos navbar-inverse navbar-fixed-top"&gt;
      &lt;div class="container"&gt;
        &lt;div class="navbar-header"&gt;
          &lt;a class="navbar-brand" href="#"&gt;&lt;img src="/images/titlegraphic.jpg" class="logo"&gt;&lt;/a&gt;
        &lt;/div&gt;
          &lt;ul class="nav navbar-navdos"&gt;
            &lt;li&gt;&lt;a class="number"&gt;(907)452-3116&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a&gt;606 Bentley Drive | Fairbanks, AK&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/div&gt;
    &lt;/nav&gt;
    &lt;nav class="navbar navbar-inverse navbar-fixed-top"&gt;
      &lt;div class="container"&gt;
        &lt;div class="navbar-header"&gt;
          &lt;button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"&gt;
            &lt;span class="sr-only"&gt;Toggle navigation&lt;/span&gt;
            &lt;span class="icon-bar"&gt;&lt;/span&gt;
            &lt;span class="icon-bar"&gt;&lt;/span&gt;
            &lt;span class="icon-bar"&gt;&lt;/span&gt;
          &lt;/button&gt;
        &lt;/div&gt;
        &lt;div id="navbar" class="collapse navbar-collapse"&gt;
          &lt;ul class="nav nav-pills"&gt;
            &lt;li class="active"&gt;&lt;a data-toggle="pill" href="#home"&gt;Home&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a data-toggle="pill" href="#about"&gt;About&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a data-toggle="pill" href="#services"&gt;Services&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a data-toggle="pill" href="#portfolio"&gt;Portfolio&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a data-toggle="pill" href="#contact"&gt;Contact&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
        &lt;/div&gt;&lt;!--/.nav-collapse --&gt;
      &lt;/div&gt;
    &lt;/nav&gt;

    &lt;div class="tab-content"&gt;

      &lt;div id="home" class="tab-pane fade in active"&gt;
        &lt;div id="myCarousel" class="carousel slide" data-ride="carousel"&gt;
      &lt;!-- Indicators --&gt;
      &lt;ol class="carousel-indicators"&gt;
        &lt;li data-target="#myCarousel" data-slide-to="0" class="active"&gt;&lt;/li&gt;
        &lt;li data-target="#myCarousel" data-slide-to="1"&gt;&lt;/li&gt;
        &lt;li data-target="#myCarousel" data-slide-to="2"&gt;&lt;/li&gt;
      &lt;/ol&gt;
      &lt;div class="carousel-inner" role="listbox"&gt;
        &lt;div class="item active"&gt;
          &lt;img class="first-slide" src="/images/10x10reflect-lg.jpg" alt="First slide"&gt;
          &lt;div class="container"&gt;
            &lt;div class="carousel-caption"&gt;
              &lt;h1&gt;Music Production Studio&lt;/h1&gt;
              &lt;p&gt;&lt;/p&gt;
              &lt;p&gt;&lt;a class="btn btn-lg btn-primary" href="#" role="button"&gt;Learn More&lt;/a&gt;&lt;/p&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="item"&gt;
          &lt;img class="second-slide" src="/images/11830247_10207115344978900_1142161344_n.jpg" alt="Second slide"&gt;
          &lt;div class="container"&gt;
            &lt;div class="carousel-caption"&gt;
              &lt;h1&gt;Beat Gallery&lt;/h1&gt;
              &lt;p&gt;&lt;/p&gt;
              &lt;p&gt;&lt;a class="btn btn-lg btn-primary" href="#" role="button"&gt;Listen&lt;/a&gt;&lt;/p&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="item"&gt;
          &lt;img class="third-slide" src="/images/TMPstudio.jpg" alt="Third slide" style="width: 600px;"&gt;
          &lt;div class="container"&gt;
            &lt;div class="carousel-caption"&gt;
              &lt;h1&gt;Studio Services&lt;/h1&gt;
              &lt;p&gt;&lt;/p&gt;
              &lt;p&gt;&lt;a class="btn btn-lg btn-primary" href="#" role="button"&gt;Check-It Out&lt;/a&gt;&lt;/p&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev"&gt;
        &lt;span class="glyphicon glyphicon-chevron-left" aria-hidden="true"&gt;&lt;/span&gt;
        &lt;span class="sr-only"&gt;Previous&lt;/span&gt;
      &lt;/a&gt;
      &lt;a class="right carousel-control" href="#myCarousel" role="button" data-slide="next"&gt;
        &lt;span class="glyphicon glyphicon-chevron-right" aria-hidden="true"&gt;&lt;/span&gt;
        &lt;span class="sr-only"&gt;Next&lt;/span&gt;
      &lt;/a&gt;
    &lt;/div&gt;&lt;!-- /.carousel --&gt;
      &lt;/div&gt;

      &lt;div id="about" class="tab-pane fade"&gt;
        &lt;img src="images/entry.jpg" id="AboutPic1"&gt;
        &lt;h1&gt;&lt;/h1&gt;
        &lt;p id="lead"&gt;
            Use this document as a way to quickly start any new project.&lt;br&gt; 
            All you get is this text and a mostly barebones HTML document.
        &lt;/p&gt;
      &lt;/div&gt;

      &lt;div id="services" class="tab-pane fade"&gt;
        &lt;h1&gt;FUCK me&lt;/h1&gt;
        &lt;p class="lead"&gt;Use this document as a way to quickly start any new project.&lt;br&gt; All you get is this text and a mostly barebones HTML document.&lt;/p&gt;
      &lt;/div&gt;

      &lt;div id="portfolio" class="tab-pane fade"&gt;
        &lt;h1&gt;FUCK me&lt;/h1&gt;
        &lt;p class="lead"&gt;Use this document as a way to quickly start any new project.&lt;br&gt; All you get is this text and a mostly barebones HTML document.&lt;/p&gt;
      &lt;/div&gt;

      &lt;div id="contact" class="tab-pane fade"&gt;
        &lt;div id="map"&gt;&lt;/div&gt;
        &lt;div id="contact-content"&gt;
        &lt;h1&gt;We're looking forward to&lt;br&gt; 
            hearing from you!&lt;/h1&gt;&lt;br&gt;
        &lt;h2 style="text-decoration: underline"&gt;Phone Number:&lt;/h2&gt;
        &lt;h2&gt;907-452-3116&lt;/h2&gt;&lt;br&gt;
        &lt;h2 style="text-decoration: underline"&gt;Email:&lt;/h2&gt;
        &lt;h2&gt;email&lt;/h2&gt;&lt;br&gt;
        &lt;h2 style="text-decoration: underline"&gt;Address:&lt;/h2&gt;
        &lt;h2&gt;
            Nelson's Professional Photography&lt;br&gt;
            address&lt;br&gt;
            Fairbanks, Alaska 99701&lt;br&gt;
        &lt;/h2&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;&lt;!-- /.container --&gt;


    &lt;!-- Bootstrap core JavaScript
    ================================================== --&gt;
    &lt;!-- Placed at the end of the document so the pages load faster --&gt;
    &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"&gt;&lt;/script&gt;
    &lt;script src="../../dist/js/bootstrap.min.js"&gt;&lt;/script&gt;
    &lt;!-- IE10 viewport hack for Surface/desktop Windows 8 bug --&gt;
    &lt;script src="../../assets/js/ie10-viewport-bug-workaround.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>CSS:</p>

<pre><code>body {
  padding-top: 50px;
  background-color: #777
}

h1, h2, h3 {
    margin-top: 0;
    margin-bottom: 0;
}
.starter-template {
  padding: 40px 15px;
  text-align: center;


}

.navbar.navbar-inverse.navbar-fixed-top {
    position: absolute;
    background-color: #336699;
    border: 0px;
    height: 51px;
    margin-top: 120px;
}

/*.nav.nav-pills{


}*/
.nav.nav-pills li a{
    color: white;
    font-family: Roboto, Titillium Web, Arial, Verdana, sans-serif; 
    padding-left: 76px;
    padding-right: 76px;
    font-size: 22px;
    margin-top: 0px;

}
.nav-pills li a:hover{
      color: grey;

}



.navbardos.navbar-inverse.navbar-fixed-top { 
    position: absolute;
    background-color: black;
    border: 0px;
    height: 120px;
}

.nav.navbar-navdos{
    float: right;
    font-size: 13px;
    margin-top: 30px;
    margin-right: 24px;
    width: 200px;
}

.nav.navbar-navdos li a{

    padding:0px;
    color: white;

}

.nav.navbar-navdos li a:hover{
    background-color: black;
}

.number {
    font-size: 30px;

}
.logo {
    width: 400px;
    margin-left: -130px;
}

#home{
    margin-top: 100px;
    position: absolute;

}

#about{
    margin-top: 150px;
    width:100%
}

#services{
    margin-top: 150px;
    position: absolute;
}

#portfolio{
    margin-top: 150px;
    position: absolute;
}

#contact{
    font-family: Titillium Web, Arial, Verdana, sans-serif;
    color:  #E8E8E8;
}

#contact-content{
    position: absolute;
    float: left;
    margin-top: 176px;
    margin-left: 100px;
}

#map {
    margin-left: 650px;
    margin-top: 180px;
    position: absolute;
    float: right;  
    width: 550px;
    height: 400px;
}

/* Carousel base class */
.carousel {
  margin-left: 30px;
  height: 500px;
  width: 100%;
  margin-bottom: 60px;
  margin-top: 20px;

}
/* Since positioning the image, we need to help out the caption */
.carousel-caption {
  height: 500px;
}

.btn.btn-lg.btn-primary {
  background-color: #FF9900 ; 
}

.btn.btn-lg.btn-primary:hover {
  background-color: #B22400    ; 
}
/* Declare heights because of positioning of img element */
.carousel .item {
  height: 800px;
  background-color: #777;
}
.carousel-inner &gt; .item &gt; img {
  position: fixed;
  top: 0;
  left: 0;
  min-width: 100%;
  height: 800px;
}

.carousel-control.right, .carousel-control.left {
  background-image:none;
  margin-top: 200px;
}
</code></pre>