Google maps do not load match when first viewing website

While browsing the website, I am developing atm for the project I'm working on - it seems that the first time I visit the site, the google map located in the footer does not load and only loads the location image and not the interactive map. However, when the page reloads, the map works fine: /.

I'm still pretty new to JS, and any help with this would be greatly appreciated.

The website can be seen at http://www.kingsroad.net.au/

and the source of the footer homepage can be seen at http://www.kingsroad.net.au/content/footerMain.php

Also kingsroad.net.au/js/general.js controls the loading of content on the page.

0
source share
1 answer

Could you try:

function loadGoogleMap(){
  var mapOptions = {
    ...
  };
  var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);

  setTimeout(function() {
    google.maps.event.trigger(map, "resize");
  }, 3000);
}
0
source

All Articles