• Resolved nikolay100

    (@nikolay100)


    When I activate the JS deffer option, for some reason the OpenStreetMap is not loading at all.

    Here is the location of the map when the JS deffer is turned off:
    https://pasteboard.co/w1kvOW226KyM.png

    And here is the live page with the JS deffer turned on:
    https://testenv.bestrestaurantsfinder.com/best-restaurants-in-serbia/

    As you can see the map is gone. I tried adding to the JS Deferred / Delayed Excludes section all of the JS files that have to do with the location and OpenStreetMap like these:

    leaflet.min.js
    leaflet.js
    leaflet
    bouncemarker.min.js
    bouncemarker.js
    bouncemarker
    location-leaflet-map.min.js
    location-leaflet-map.js
    leaflet.markercluster.min.js
    leaflet.markercluster.js
    leaflet-gesture-handling.min.js
    leaflet-gesture-handling.js
    location-map.min.js
    location-map.js
    location-api.min.js
    location-api.js
    map-api.min.js
    map-api.js

    But it did not help. The map still does not show up.

    I also checked if there is conflict with another plugin, but there is not. This happens only when I turn on the JS deffer. And the non cached version of the plugin is rendering the map normally.

    Please advise how to resolve this or what should I add to the exclude section in order to render the map.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support qtwrk

    (@qtwrk)

    you may need to check inline js as well

    try add map and api into the list, purge all , see how it goes

    Thread Starter nikolay100

    (@nikolay100)

    Hi @qtwrk

    Thank you for the reply.

    I added the following strings:

    map
    api
    drts-platform-render
    drts-form
    DRTS.ajax
    adsbygoogle
    DRTS.Map.api.getMap
    location
    data:text/javascript

    But it did not help.

    I also checked the inline JS and compared the page code with the JS deffer setting on and off. There is a little to no difference in the code, but for some reason the deffer setting is causing the map to disappear.

    Is there some other functionality when the JS deffer is activated? What else could cause that?

    Any help will be appreciated.

    Plugin Support qtwrk

    (@qtwrk)

    please try add wp- into the list as well, purge all , see how it goes

    Thread Starter nikolay100

    (@nikolay100)

    That worked, thank you. I even removed all the strings I have added before and it still works.

    Could you please tell me what does this mean? That some core WordPress JS is differed and it is preventing the map to load?

    I would like to exclude the particular js code if possible.

    Thanks again for the help.

    Plugin Support qtwrk

    (@qtwrk)

    if wp- works , that means the responsible file is within wp-content and wp-includes directories , now you can keep narrow it down until you find the right one.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Deferring JS prevents OpenStreetMap from loading’ is closed to new replies.