title: PhoneGap + JQuery Mobile + Google Maps v3: map shows Top Left tiles?
body: <p>I have a PhoneGap application that uses JQuery mobile to navigate between pages.</p>
  
  <p>When I navigate from the main page to a page containing a Google map, the map shows only a single tile at a time in the top left corner like this:
  <img src="https://i.stack.imgur.com/mecbp.png" alt="enter image description here"></p>
  
  <p>What can be the reason for this ?</p>
  
  <p>**</p>
  
  <blockquote>
    <p><strong>Source Code:</strong>
    The following script is in the head of my page</p>
  </blockquote>
  
  <pre><code>&lt;script&gt;
              $(document).on("pageinit", "#stores", function () {
                  var centerLocation = new google.maps.LatLng('57.77828', '14.17200');
  
          var myOptions = {
              center: centerLocation,
              zoom: 8,
              mapTypeId: google.maps.MapTypeId.ROADMAP,
              callback: function () { alert('callback'); }
          };
  
          map_element = document.getElementById("map_canvas");
  
  
  
  
          map = new google.maps.Map(map_element, myOptions);
  
          var mapwidth = $(window).width();
          var mapheight = $(window).height();
          $("#map_canvas").height(mapheight);
          $("#map_canvas").width(mapwidth);
          google.maps.event.trigger(map, 'resize');
  
              });
          &lt;/script&gt;
  </code></pre>
  
  <p>My Page is like this</p>
  
  <pre><code>&lt;!-- Home --&gt;
          &lt;div data-role="page" id="home"&gt;
  .
  .
  .
  &lt;/div&gt;
  
  &lt;div data-role="page" id="stores"&gt;
  &lt;div data-role="content" id="map_canvas"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I navigate from home to the maps page like this:</p>
  
  <pre><code>&lt;a href="#stores"&gt;Stores&lt;/a&gt;
  </code></pre>
  
  <blockquote>
    <p><strong>Update</strong>
    after applying Gajotres solution the tiles become like this
    <img src="https://i.stack.imgur.com/hjCf7.png" alt="enter image description here"></p>
  </blockquote>