• Resolved laconicsky

    (@laconicsky)


    As soon as I set the Load JS Deferred setting to Delayed, the Google Maps API starts misbehaving.

    For example the map doesn’t load and the location search on my site (that is driven by the google maps api) doesn’t work.

    I’ve tried adding the following to Tuning and JS Deferred / Delayed Excludes in Litespeed settings:

    map

    maps

    and also the following as spotted in page speed insights all of which are maps.googleapis.com files:

    util.js

    controls.js

    common.js

    Nothing works though.

    Could you help please.

Viewing 15 replies - 1 through 15 (of 22 total)
  • Thread Starter laconicsky

    (@laconicsky)

    Report number: KMWQIBAH

    Google Maps requires javascript, but if javascript is set to delayed, .js files will only load after user actions like clicking or scrolling, so you won’t be able to use the delayed option.

    If you are able to identify the .js file for Google Maps you can try to use “JS Deferred / Delayed Excludes” in Page Optimization > Tuning tab.

    Thread Starter laconicsky

    (@laconicsky)

    Thank you for your reply. Your second comment is exactly what I have tried to do. I’ve added the .js file names to the Tuning tab for the google map related files in order to allow them to be excluded from the delay.

    However when I do this the files don’t get loaded at all so I’m still in the same position where the Google map functionality is not working.

    Thread Starter laconicsky

    (@laconicsky)

    For example for the file https://maps.googleapis.com/maps-api-v3/api/js/51/3/common.js I’m adding common.js to “JS Deferred / Delayed Excludes” in Page Optimization > Tuning tab.

    When I run page speed or gtmetrix after this though this file doesn’t show (which it should as I’m adding to the exclude list).

    Test sites like PageSpeed or Gtmetrix are not suitable for debugging anything. Use your browser’s developer console for this or post the link to your site.

    Thread Starter laconicsky

    (@laconicsky)

    Thank you. My link is https://winejobs.uk

    Load JS is set to delayed at the moment (but search and maps are not working correctly). I have added the following to the JS Deferred / Delayed Excludes section of Tuning:

    maps.google.com/maps/api/js
    maps.googleapis.com
    maps
    common.js
    util.js
    controls.js
    places_impl.js
    geocoder.js

    Add page.js and core.9b4ec89f.js and maps-api-v3 to exclude filter.

    • This reply was modified 1 year, 11 months ago by serpentdriver.

    Don’t forget to purge the cache after every change of setting.

    Thread Starter laconicsky

    (@laconicsky)

    Thanks again.

    Unfortunately I’m seeing the same issues (I’ve been purging (Purge All) after each setting change).

    When typing a word in the Location field on the home page it should start suggesting places but doesn’t.

    When clicking on Browse Jobs I’m the Featured Jobs section there should be map on the bottom right. When viewing any single job there should also be a map displayed. None of this is currently happening unless I turn off the delayed option.

    Please remove all entries that you made recently and replace them with the following:

    maps/api/js
    maps-api-v3/api/js

    If the last filter doesn’t work try to enter your API key:

    AIzaSyCmXARfbmBx5v27yv9fbYeuaSCIoL1fAFM

    Thread Starter laconicsky

    (@laconicsky)

    I’ve made those tweaks but still getting the same results unfortunately.

    Thread Starter laconicsky

    (@laconicsky)

    Just enter the whole API key in the exclude box?

    Yes, but the last used filter already works, but it seems Google Maps needs more Javascript to work. Maybe it’s either code from Google Tag Manger or|and Google Analytics.

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Google Maps doesn’t load with Load JS Delayed’ is closed to new replies.