Okay
  Public Ticket #1077470
Problem with Google Map
Closed

Comments

  •  2
    pagode started the conversation

    Hi,
    I've a problem with the Google Map, certainly because of the API key.

    I've the following text displayed : "Petit problème... Une erreur s'est produite

    Google Maps ne s'est pas chargé correctement sur cette page. Pour plus d'informations techniques sur cette erreur, veuillez consulter la console JavaScript."

    I read another post that partially solved my problem : I paste the following code into functions.php

    // Google API Key for ACF
    add_filter( 'acf/fields/google_map/api', 'calcium_google_api_key_acf', 10 );

    // Get Google API Key Array for ACF
    function calcium_google_api_key_acf() {
        $api = array(
            'libraries'   => 'places',
            'key'         => 'myKey',
        );
        
        return $api;
    }
    ?>

    This solved the problem in the administration toll but not on the online site.

    Please could you help me ?
    Thanks !

  • [deleted] replied

    Hi pagode,

    Can you please share your WP credentials here, because I need to login to your site and test this issue. Your information is safe here (private) in this thread.

    To include your credentials click Insert Credentials button in editor toolbar. (See how)

    Also please give me your Google API key to use for your maps, and I will fix it for you and tell how I did it.

  •   pagode replied privately
  •   [deleted] replied privately
  •   pagode replied privately
  • [deleted] replied

    Hi there,

    After adding this code in functions.php:

    add_filter( 'calcium_google_maps_api_key', create_function( '$key', 'return "AIzaSyD3JCfMtRAgfVMdLu1F_qpkZOckx1diWe8";' ) );

    It fixed the issue of Google Maps.

    The map is showing now:


    (view large version)

  •  2
    pagode replied

    Perfect !

    Thank you very much !

  •   [deleted] replied privately