• Resolved analogguy

    (@analogguy)


    I’m using the latest EME frontend submit with the latest EME version.
    When submiting a new event it shows up in EME (backend) & the defined page. In EME Backend and EME frontside submit it shows up with correct Google maps location.
    On the post page the event shows the Google Map window for a short time green and than grey and a note “undefined”.
    A valid Google API Key is set up in settings. I had a look on this issue:
    I enabled the Google Maps integration, but instead of the map there is a green background. What should I do?
    https://www.e-dynamics.be/wordpress/faq/
    I’m using custom community theme (buddypress/ bbpress compatible) and the header.php shows this:
    <head>
    <meta charset=”<?php bloginfo( ‘charset’ ); ?>” />
    <meta name=”viewport” content=”width=device-width, initial-scale=1.0″ />
    <link rel=”profile” href=”https://gmpg.org/xfn/11&#8243; />
    <link rel=”pingback” href=”<?php bloginfo( ‘pingback_url’ ); ?>” />
    <?php wp_head(); ?>
    </head>

    Hopefully this is my user error and can be fixed with one or two clicks and is not a bug/ server problem.

Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Author Franky

    (@liedekef)

    Do you have an example I can check?

    Plugin Author Franky

    (@liedekef)

    Also: I had the same problem on my side, but a simple refresh of the page resolved it (so it is in fact a browser cache problem I experienced).

    Thread Starter analogguy

    (@analogguy)

    Try this. Site is in the middle of the build. Just opened it/ disabled maintenance mode for a test:
    https://microemobility.org/en/events/8/test/
    Safari and Firefox showing the same short green box and and than grey with undefined.
    Only when presenting in the final view the Google Map disappears. You can see it it in the EME backend and while submitting in the webform of eme frontside submit

    • This reply was modified 7 years, 5 months ago by analogguy.
    • This reply was modified 7 years, 5 months ago by analogguy.
    Plugin Author Franky

    (@liedekef)

    Seems to me this is due to another google-maps related plugin you have active, it interferes with the way EME loads the google maps API. I tried installing geo-my-wp and wp-gpx-maps here, and in both cases the map still shows ok afterwards. So try disabling all plugins (except EME) and re-enable one by one until you find the one that interferes with EME.

    Plugin Author Franky

    (@liedekef)

    Also, maybe try if this small change helps you in any way:
    https://plugins.trac.www.ads-software.com/changeset/1676777/

    Thread Starter analogguy

    (@analogguy)

    After disabling all (incl. frontside submit) the problem was still there. So I deactivated EME also and activated again – still there. Than I changed the theme which I did this morning (with all plugins activ) and this time changing from custom community 2.0 to twenty twelve showed the mac correct. Switching the Theme a couple of time made the proof.
    So I need to deal with the Theme developer or search for a new theme also compatible to BuddyPress, 1 sub layer menus and comes with a footer…

    Plugin Author Franky

    (@liedekef)

    Seems an older theme to me, but still … I’ll check it out here too.
    Did the small change help in any way?

    Plugin Author Franky

    (@liedekef)

    Btw: using my change (and your theme) here locally, the map shows fine. Without the extra change, the map doesn’t load (it seems the theme removes some linebreaks, and that causes issues with the redundant javascript comment lines that were still present).

    Hi Franky,

    I think I am seeing the same issue as reported in this thread. For info:
    – on the public side, each map is OK in 1.8.4, but a green block in 1.8.5-1.8.7
    – it is not a browser cache issue because I get the same when I change browsers and devices
    – the maps on the backend/private side, ie. location page, is fine (at least in 1.8.7)
    – an example page is: https://cfd.direct/openfoam-training/london – where I have reverted to 1.8.4.

    Catching up on this thread, do you suggest trying 1.8.7 with the following patch?:
    https://plugins.trac.www.ads-software.com/changeset/1676777/

    Let me know, and I will test and report back.

    Thanks,

    Chris

    Thread Starter analogguy

    (@analogguy)

    I’ve went back t the theme “causing” the problem. Did the patch mentioned here:


    Also, maybe try if this small change helps you in any way:
    https://plugins.trac.www.ads-software.com/changeset/1676777/

    It looks fine. I do some other test events and come back

    Thread Starter analogguy

    (@analogguy)

    Awesome. Did 3 testevents and it works fine on this tests. Thanks a lot.

    Plugin Author Franky

    (@liedekef)

    1.8.7 contains this fix (in fact it probably never worked or should have worked in older versions and that theme).
    You seem to have another problem. What is your theme? And php version, wordpress version, any javascript errors in the browser console?

    Edit: your theme seems to be “Spacious pro”, but it seems to be a very old (and no longer maintained) theme, is that true? Also: it is of course impossible for me to fix something that works (your 1.8.4 site), so I’d need a test setup on your side. Did you try with a default WP theme?

    • This reply was modified 7 years, 5 months ago by Franky.
    Thread Starter analogguy

    (@analogguy)

    Theme is called Custom Community 2.0 (https://www.ads-software.com/themes/custom-community/). When using BuddyPress/ bbPress, 2 sub layer menus and footer you haven’t a big choice of themes anymore. Maybe to have a closer look at Emmet Lite – not sure about the menu stuff.
    PHP version should be 7. For tests I use Twenty twelve if encountering problems.
    How can I help you with tests on my site? Do you need an account or should I put in some special events?

    • This reply was modified 7 years, 5 months ago by analogguy.
    Plugin Author Franky

    (@liedekef)

    @analogguy: your problem is fixed.
    The question above was directed at @cfddirect.

    Hi Franky (@liedekef)

    I had a look into this further. With 1.8.7, I am actually finding that map loading is random in Firefox. Sometimes they load, sometimes they don’t – roughly 50%:50%.

    I ran Web Developer -> Inspector and noticed it was giving a reference error:
    “Reference Error: google is not defined”

    I googled this and it seems this is caused by the “maps.google.com/maps/api/js…” not being loaded before the file that uses it:
    https://stackoverflow.com/questions/33495879/uncaught-referenceerror-google-is-not-defined-at-google-maps-marker
    (In this case the file using it is eme_location_map.js)

    The file is not loaded is because the loading uses the async flag. I deleted the async and defer flags on line 3694 of eme_events.php in the eme_general_footer()
    function as follows:
    echo “<script type=’text/javascript’ src=’//maps.google.com/maps/api/js?”.$gmap_api_key.”‘></script>\n”;

    The maps now load 100% of the time in Firefox.

    See for example:
    https://cfd.direct/openfoam-training/munich/
    https://cfd.direct/openfoam-training/chicago/
    https://cfd.direct/openfoam-training/london/

    I appreciate that we want ideally to load the google/js file asynchronously, but I don’t know if it is possible to pause loading the eme_location_map.js file until the google/js file is loaded.

    I note the same code is in the eme_general_head() function also

    By the way, is there a reason for not using coding style
    … async>
    rather than
    … async=”async”>

    Thanks,

    Chris

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Map shows undefined’ is closed to new replies.