Google Maps Integration Not Working Properly

This topic contains 8 replies, has 3 voices, and was last updated by  Alex Rollin 5 years, 3 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #508792

    Hayley Kirkman
    Expired Member
    Post count: 37

    Hi,

    I cannot seem to get the Google Maps API to work properly. On the backend when I add a new place I get no warning and the map loads the default location.

    However, on the front end I go to the Javascript Console and see several errors. Including…

    – js?ver=5.2.3:127 You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors.

    – InvalidValueError: setMap: not an instance of Map; and not an instance of StreetViewPanorama

    – You are using this API without a key.

    We are using the theme called “Baker” please advise. Thanks.

    #508793

    Hayley Kirkman
    Expired Member
    Post count: 37
    #508794

    Hayley Kirkman
    Expired Member
    Post count: 37
    This reply has been marked as private.
    #508802

    Hayley Kirkman
    Expired Member
    Post count: 37

    I tested this further and when I switch to the Twenty Nineteen default theme the issue seems to be resolved and the Google maps load with no warnings.

    I found the following thread where a custom snippet was provided for a user with a similar theme conflict. I feel my issue may be similar to this. Please advice. I have already installed a custom snippet plugin. I am just unsure what code is causing the conflict. Thanks!

    https://wpgeodirectory.com/support/topic/google-maps-javascript-api-multiple-times/

    #508808

    Alex Rollin
    Moderator
    Post count: 27815

    Please share WP Admin credentials and FTP so we can debug the issue.

    Thanks

    “WordPress Credentials
    WP Admin Login URL:
    WP Admin Username:
    WP Admin Password:

    FTP Credentials
    FTP Host:
    FTP Port:
    FTP User:
    FTP Password:”

    #508813

    Hayley Kirkman
    Expired Member
    Post count: 37
    This reply has been marked as private.
    #508898

    Kiran
    Moderator
    Post count: 7069

    Hi Hayley,

    There was a Google map conflict with Baker theme.

    I have added following PHP snippet under Snippets to fix this conflict.

    
    
    /**
     * Fix Baker theme Google map conflict.
     */
    function gd_snippet_190918_baker_fix_google_map_conflict() {
    	if ( wp_script_is( 'baker_edge_google_map_api', 'enqueued' ) && wp_script_is( 'geodir-google-maps', 'enqueued' ) ) {
            wp_dequeue_script( 'baker_edge_google_map_api' );
        }
    }
    add_action( 'wp_enqueue_scripts', 'gd_snippet_190918_baker_fix_google_map_conflict', 600 );

    Kiran

    #509042

    Hayley Kirkman
    Expired Member
    Post count: 37

    Thank you very much Kiran! I have one more issue that probably needs a new support ticket; however I did not want to have to provide the FTP and WP admin info again from above.

    I specifically need to use the “GeoDirectory Pricing Manager” add on and it was well as many other of the addons cause the site admin are to go 500 error. Please advise.

    Thanks,
    Hayley

    #509130

    Alex Rollin
    Moderator
    Post count: 27815

    Please make a new ticket as this one is now resolved.

    You can followup immediately with a private reply that includes credentials if we need to check settings.

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

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

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount