• Resolved Robswaimea

    (@robswaimea)


    Maps Not Loading.. problem with “deferring javascript”

    Been working on Google’s PageSpeed Insights… so in the process testing plugin’s to do this…

    Apparently that deferring javascript is not allowing the Maps to show on a Location’s page.

    The plugin is this one… WP Deferred Javascripts
    https://www.ads-software.com/plugins/wp-deferred-javascripts/
    They suggest using the techniques found here…
    https://codex.www.ads-software.com/Function_Reference/wp_enqueue_script

    But I am quite clueless to go about this… other than knowing that I would put the code into my functions.php file. Or maybe in the Events Manger php files somewhere.

    As people are trying to defer.. aka Optimize, their page load times, by placing scripts in the footer, and or asyn them…

    Would you maybe have any help with the Maps not showing because of a “deferring” situation.

    Maybe it is with the Google API for the maps ?? but then I don’t really know what I am talking about just guessing ??

    Thanks again… the plugin is wonderful and you guys work hard in the support.

    https://www.ads-software.com/plugins/events-manager/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Robswaimea

    (@robswaimea)

    Ok.. this may help a little.. with the WP Deferred Scripts activated..

    I get this error in the inspector console “js” area..
    A call to document.write() from an asynchronously-loaded external script was ignored. js:8:0
    TypeError: google.maps.LatLng is not a constructor

    Unfortunately the plugin doesn’t have any setting to exclude certain scripts… as some others. But the other ones mess up my CSS quite a bit.. and this one “seems” the cleanest.

    Thanks again.

    Plugin Support angelo_nwl

    (@angelo_nwl)

    sorry can’t help you with regards to other plugins however maybe you can try option under Events > Settings > General > Performance Optimization > JavaScript Files

    Thread Starter Robswaimea

    (@robswaimea)

    Thank you for your time on this issue.

    I have tested a number of other plugins for optimization…
    Four of them… 2 break the locations maps, and using a shortcode for a map.
    The other two work but break other parts of my site.

    I’ll either figure this out on my own… or if necessary just remove the Location’s Map, and hard code a map for each Location Page.

    Hopefully no one else will this have this problem, maybe tuck this topic in the ol’ brain folder, if somebody chimes in with Maps not loading, and if perhaps they have an optimization or asyn deferring plugin installed.

    Thanks again.

    Thread Starter Robswaimea

    (@robswaimea)

    Also an added note…
    Putting this into my header.php
    <script src="https://maps.googleapis.com/maps/api/js?v=3.12"></script>

    Allows the maps to appear, but without the ‘marker’ and the small white ‘information box’ . Which is understandable because the parameters are not being passed calling the maps directly from within the EM plugin.

    Adding <script async src=”https://map&#8230;.

    Leads to the maps failing completely again.

    oh well.. none the less !
    Have a great day !

    Plugin Support angelo_nwl

    (@angelo_nwl)

    did you already tried to deactivate all other plugins or temporarily switch to default theme to see if there’s any conflict?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Maps Not Loading.. problem with "deferring javascript"’ is closed to new replies.