title: bing map loading only after resizing the window
body: <p>I am not really good at js and trying to use Bing map in our website but it shows the map few times and doesnt show the map most of the time. Below is the code snippet of loading map function, can someone please let me know whats wrong in this function, I am using this from other application:</p>
  
  <pre><code> function loadMap(storeData) {
          var coordinates = {};
          var map;
          var stores = storeData.stores;
          if( (typeof stores !== 'undefined') &amp;&amp; (typeof stores[0].coordinates !== 'undefined') ) {
            coordinates.lat = stores[0].coordinates.lat;
            coordinates.lng = stores[0].coordinates.lng;
          }else {
            coordinates.lat = 33.74831008911133;
            coordinates.lng = -84.39111328125;
          }
  
          map = new Microsoft.Maps.Map($('#bingMap')[0], {
            credentials: 'mykey',
            liteMode: true,
            enableClickableLogo: false,
            center: new Microsoft.Maps.Location(coordinates.lat, coordinates.lng)
          });
  
          self.center = new Microsoft.Maps.Location(coordinates.lat, coordinates.lng);        
          map.setView({zoom: 13});
  
          return map;
        }
  </code></pre>
  
  <p>I have tried below few steps I got from other stackoverflow queries but it didnt help me:-(</p>
  
  <pre><code>setTimeout(this.loadMap(storeData), 2000);  Microsoft.Maps.Events.addHandler(map,'resize')
  </code></pre>