Map doesn't load via Ajax

New home Forums Gold Add-on Troubleshooting Map doesn't load via Ajax

Tagged: 

This topic contains 21 replies, has 2 voices, and was last updated by  CV 1 week, 6 days ago.

Viewing 8 posts - 16 through 23 (of 23 total)
  • Author
    Posts
  • #34018

    CV
    Member

    All is good, the error was me being stupid for a couple of minutes there.
    It works perfectly even after update.
    Thanks again!

    #34030

    Perry
    Moderator

    Hi there,

    No problem! I’m glad that’s solved in any case 🙂

    Kind regards
    – Perry

    #51068

    CV
    Member

    Hi Perry, Hope you’ve been well!

    Could the fix be adjusted to load 2 different maps on the same page?
    Say in addition to id=”1″ to add another map with id=”4″.

    I’ve adjusted the code you provided last time (JS and php files) and the 2 maps load, however I get a js error that breaks other js dependent plugins.
    Most likely because I’m passing 2 map id’s to the init function in the php file

    add_action('init', function () {
    
    	
    
    	do_shortcode('shortcodeWithID="1".shortcodeWithID="4"');
    
    });
    • This reply was modified 2 weeks ago by  CV.
    • This reply was modified 2 weeks ago by  CV.
    • This reply was modified 2 weeks ago by  CV.
    #51075

    Perry
    Moderator

    Hello again

    I hope this finds you well!

    That should work, however because you are doing it in the init hook, I would imagine the order of execution is not correct for our plugin to load correctly. We would need to see the entire JS error to advise on that.

    Could you alter it to have a later priority, or use a different action?

    Kind regards
    – Perry

    #51083

    CV
    Member

    Hi Perry,

    The JS error is as follows:

    js?language=en&key=AIzaSyBP7eyxP_l7rwHsDn9NCN2BslHfzSHlegw&libraries=geometry%2Cplaces%2Cvisualization:132 Uncaught TypeError: Cannot read property 'firstChild' of undefined
        at Object._.Zg (js?language=en&key=AIzaSyBP7eyxP_l7rwHsDn9NCN2BslHfzSHlegw&libraries=geometry%2Cplaces%2Cvisualization:132)
        at new dh (js?language=en&key=AIzaSyBP7eyxP_l7rwHsDn9NCN2BslHfzSHlegw&libraries=geometry%2Cplaces%2Cvisualization:133)
        at Object.MYMAP.<computed>.init (wpgmaps_core.min.js:141)
        at InitMap (wpgmaps_core.min.js:20)
        at HTMLDocument.<anonymous> (wpgmaps_core.min.js:113)
        at k (jquery.js:2)
        at Object.fireWith [as resolveWith] (jquery.js:2)
        at Function.ready (jquery.js:2)
        at HTMLDocument.D (jquery.js:2)
    #51087

    Perry
    Moderator

    Hi there

    The div element that holds the map is missing.

    This is probably because you’re calling those shortcodes in a non-standard way and in the init event.

    If you move that into the body, it will most likely work. Could we try that?

    Kind regards
    – Perry

    #51129

    CV
    Member

    Thanks for your help! All sorted.

    #51131

    Perry
    Moderator

    Hi there

    You’re very welcome!

    If you have a spare minute and would be kind enough to leave me a review at https://wordpress.org/support/plugin/wp-google-maps/reviews/ me and the team would be very grateful!

    Kind regards
    – Perry

Viewing 8 posts - 16 through 23 (of 23 total)

You must be logged in to reply to this topic.