• Resolved En18Zone

    (@en18zone)


    Hi

    I’m having some javascript issue kindly help me narrow down the problem

    Uncaught TypeError: Cannot read property 'firstChild' of undefined
        at Object._.ng (js:85)
        at new sg (js:86)
        at Object.MYMAP.init (wpgmaps.js:108)
        at InitMap (wpgmaps.js:15)
        at HTMLDocument.<anonymous> (wpgmaps.js:33)
        at i (jquery.js:2)
        at Object.fireWith [as resolveWith] (jquery.js:2)
        at Function.ready (jquery.js:2)
        at HTMLDocument.K (jquery.js:2)
    wpgmaps.js:162 Uncaught TypeError: Cannot read property 'setCenter' of null
        at wpgmaps.js:162

    P.s Thanks for the awesome plugin.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Jarryd Long

    (@jarryd-long)

    Hi there

    Thank you for getting in touch with us and for your kind words!

    Please advise what version of the plugin you currently have installed? Does this occur when loading the map on the page, or while adding a marker?

    Thread Starter En18Zone

    (@en18zone)

    Thanks for the reply. I’m using Version 6.4.03 of the plugin and the map loads fine but i’m getting those errors on the console.

    On further inspection i noticed those errors appear only when i use php conditionals to load the map on only a specific page.

    Jarryd Long

    (@jarryd-long)

    Hi there

    Would you mind sending me a sample of your PHP code so that I can look further into this for you, and possibly try run the same code on my side to find a solution to work around this?

    Thread Starter En18Zone

    (@en18zone)

    I’m not using any advanced php as i’m a beginner myself

    <?php if( is_page( 'contact' ) ): ?>
        [Map Shortcode]
    <?php endif; ?>
    Jarryd Long

    (@jarryd-long)

    Hi there

    Would you mind trying the following PHP code and let me know if this helps at all?

    <?php 
    if( is_page( 'contact' ) ):
        echo do_shortcode("[Map Shortcode]");
    endif; 
    ?>
    Thread Starter En18Zone

    (@en18zone)

    That fixes it, thank you very much for your help and for taking the time to look at this.

    Jarryd Long

    (@jarryd-long)

    Only a pleasure! So glad to hear this helped.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘javascript errors: undefined’ is closed to new replies.