Google Maps JavaScript API multiple times

This topic contains 7 replies, has 3 voices, and was last updated by  P O 4 years, 9 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #502115

    P O
    Expired Member
    Post count: 501

    Hello.

    I just did a clean install.
    1- Install WordPress
    2- Install Geodirectory
    3- Install Theme. (Enfold)

    Go to add place and get this:

    1- You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors.
    2- InvalidValueError: setMap: not an instance of Map; and not an instance of StreetViewPanorama
    3- TypeError: _.n is not a function. (In '_.n()', '_.n' is an instance of Lg)
    4- TypeError: undefined is not an object (evaluating 'a.B[2]')

    There is nothing installed, just a clean and fresh WordPress with your plugin.

    What can the problem be?

    Thanks.

    #502116

    Kor
    Moderator
    Post count: 16516

    Hi P O,

    Thanks for your post. It could be from your theme. If you want us to troubleshoot this further for you, kindly renew your membership and share your Website WP admin access here is private reply.

    Thanks!

    #502117

    P O
    Expired Member
    Post count: 501

    You don’t offer support for the main plugin ? I have to pay for that?

    Thanks.

    #502140

    Alex Rollin
    Moderator
    Post count: 27815

    That is a problem with the theme. Remove the maps key from the theme (which should disable the theme loading the API).

    #502141

    P O
    Expired Member
    Post count: 501

    There is no API in the theme.

    As you have Enfold as one of the supported themes, you can test it. A clean install throws the error.

    #502180

    Alex Rollin
    Moderator
    Post count: 27815

    OK! We will check on it and get back to you here with an update. Thanks for reporting the issue!

    #502229

    Alex Rollin
    Moderator
    Post count: 27815

    Here is a snippet you can try. Add to functions.php or even better use the code snippets plugin:

    
    
    
    /**
     * Fix Enfold theme Google map conflict.
     */
    function gd_snippet_190216_enfold_fix_google_map_conflict() {
    	if ( wp_script_is( 'avia-google-maps-api', 'enqueued' ) && wp_script_is( 'geodir-google-maps', 'enqueued' ) ) {
            wp_dequeue_script( 'avia-google-maps-api' );
        }
    }
    add_action( 'admin_enqueue_scripts', 'gd_snippet_190216_enfold_fix_google_map_conflict', 600 );
    
    #502231

    P O
    Expired Member
    Post count: 501

    Thank you. That fixed it.

Viewing 8 posts - 1 through 8 (of 8 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket