Support

Account

Home Forums Front-end Issues Google Maps Not Displaying On Front End Reply To: Google Maps Not Displaying On Front End

  • var googleMap = ‘<div id=”map”></div>’;

    // Calls the initializeMap() function when the page loads
    window.addEventListener(‘load’, initializeMap);

    // Vanilla JS way to listen for resizing of the window
    // and adjust map bounds
    window.addEventListener(‘resize’, function(e) {
    // Make sure the map bounds get updated on page resize
    map.fitBounds(mapBounds);
    });

    // show Map
    $(“#mapDiv”).append(googleMap);