• Resolved shampie

    (@shampie)


    Hi everyone,

    since a few weeks we have a problem on our wordpress page and just don’t know what to do.
    The Google map does not appear, but sometimes if you refresh the page more often, it works. In the console the following error occurs:

    Uncaught ReferenceError: google is not defined
        at mfn_google_maps_622a168ac7ce2 (<anonymous>:2:55)
        at HTMLDocument.<anonymous> (<anonymous>:2:906)
        at e (jquery.min.js?ver=3.6.0:2:30038)
        at t (jquery.min.js?ver=3.6.0:2:30340)

    In Safe Mode it works, and also if we turn off Google Maps in the integrations.

    The link to the page is here: https://wepec.de/team/

    Does anyone have any ideas? We are grateful for any help!
    Thank you in advance!

    Best wishes
    Shampie

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Aert Hulsebos

    (@aahulsebos)

    Hi @shampie,

    This seems a dependency issue with Google Maps, are you using the Script Center by any chance? We can add a dependency there if needed.

    Otherwise, I need to get my hands on BeTheme and create an integration.

    The issue here is that the script mfn_google_maps should wait for the Google API to load. Let me know how much you want to code yourself, so I can make a suggestion,

    regards Aert

    Thread Starter shampie

    (@shampie)

    Hi @aahulsebos,

    thank you so much for your message!

    I’m not using the Script Center yet…

    I tried to add a little code, so that this function would wait until “google” exists, but then something else complained about not finding “google” :/ Was that the right way of doing it?

    I added this code, to the function call:

    jQuery(document).ready(function(){
        if(!google){
            window.setTimeout(function(){
                mfn_google_maps_622b74ab6f200();
                console.log("nope");
            }, 100);
        } else {
            mfn_google_maps_622b74ab6f200();
            console.log("yay");
        }
    });

    before it was just this:

    jQuery(document).ready(function(){
            mfn_google_maps_622b74ab6f200();
    });

    Thanks again for your help!
    Shampie

    • This reply was modified 2 years, 12 months ago by shampie.
    • This reply was modified 2 years, 12 months ago by shampie.
    Plugin Author Aert Hulsebos

    (@aahulsebos)

    Hi @shampie,

    I would suggest using this set-up; https://github.com/Really-Simple-Plugins/complianz-integrations/blob/master/custom-google-maps.php and add it as a MU plugin.

    I have a copy of BeTheme, so whoever is first:-)

    regards Aert

    Thread Starter shampie

    (@shampie)

    Hi @aahulsebos,

    I did as described in the “How to use these integrations” section. But I still don’t get it to work ??
    In the plugin is written

    Replace initMap with a variable from the inline script which runs the init, or the URL where this script resides.

    and I replaced it with “map” – but I’m not sure if that’s correct though?

    best wishes
    Shampie

    Plugin Author Aert Hulsebos

    (@aahulsebos)

    Hi @shampie,

    I mentioned getting the BeTheme, but all I got received was a Dev License by BeTheme, I asked for the files, but not yet received them.

    Sorry for the delay, if you are able you could send us your copy as well, so we can use it with our license via complianz.io/contact/ or us wetransfer.com.

    regards Aert

    Plugin Author Aert Hulsebos

    (@aahulsebos)

    Hi @shampie,

    This works for me locally; https://github.com/Really-Simple-Plugins/complianz-integrations/blob/master/custom-betheme-google-maps.php

    Disable the Google Maps integration.

    regards Aert

    Thread Starter shampie

    (@shampie)

    Hi @aahulsebos,

    thank you for this! The error message is gone, but my Google Map won’t show up neither… Any idea?

    Greetings
    Shampie

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Uncaught ReferenceError: google is not defined’ is closed to new replies.