Home Forums Front-end Issues Enqueue Google Map Reply To: Enqueue Google Map

  • Hi @rudtek

    Thanks for the reply. Can’t believe I missed the typo.

    Ok, I’ve amended the typo and tried with true (several ways) but still no joy:

    function prefix_enqueue_scripts() {
        wp_enqueue_script( 'google-maps', '' );   
    	#wp_enqueue_script( 'google-maps', '', true );  
    	#wp_enqueue_script( 'google-maps', '', '', true );  
        wp_enqueue_script( 'google-map-init', get_template_directory_uri() . '/js/acf-map.js', array('jquery', 'google-maps'), '', true);
    add_action( 'wp_enqueue_scripts', 'prefix_enqueue_scripts' );

    Checking the console logs, it shows:
    Google Maps JavaScript API warning: NoApiKeys

    If I check the source code, I can see the script is called but seems to get truncated:
    <script type='text/javascript' src=''></script>
    It’ missing the API key or is that correct?