Support

Account

Home Forums Backend Issues (wp-admin) Google maps – MissingKeyMapError

Solved

Google maps – MissingKeyMapError

  • Hi,

    Today I installed WordPress 4.5.3 and the newest ACF plugin. I added google map field to my custom post type. When I add/edit new post I got this error:

    Oops! Something went wrong.
    This page didn’t load Google Maps correctly. See the JavaScript console for technical details.

    In console we can see this:

    Google Maps API error: MissingKeyMapError

    How to solve that problem?

    I’m not native English man so sorry for my grammar if it’s wrong πŸ™‚

    Regards,

  • The Google Maps APIs require an API key for new domains as of today. See announcement: http://googlegeodevelopers.blogspot.com.au/2016/06/building-for-scale-updates-to-google.html

    For developers: I think Google Maps API key should be added to ACF settings and used calling Google Maps API.

  • Ok, thanks for reply.

    • killexx

    • June 23, 2016 at 10:41 pm

    Bajaczysko, my answer is not a solution of a problem, please keep issue unsolved – so developer can see this issue and fix it in next update.

  • killexx, yeah you are right but I can’t remove “solved” from your post. Anyway I created ticket with this problem too and I got respond that team will be inform with this bug πŸ™‚ In the next update problem will be solved.

  • Thanks πŸ™‚

  • I have reported this issue to the developer

  • There is a fix for this in the new version of ACF Pro. You can get it by logging into your account and downloading from there. It is 5.4.0-beta3.

    • beil

    • July 6, 2016 at 8:40 pm

    I try out the beta and nothing is fixed for me!

  • Just tried the beta and still getting the same error.
    I see that this issue is also tagged as “solved” so I wonder if I am missing something.

    • rugbert

    • July 15, 2016 at 10:41 pm

    I just downloaded the Beta and that still doesn’t work.

    Edit – You’ll need to add a filter to get the key in:

    add_filter('acf/settings/google_api_key', function () {
        return 'your-api-key';
    });

    Credit goes to aaemnnosttv

  • This works for backend but in frontend I still have the error.

  • For those like me who are late to the party, ACF posted a solution. This worked for me on version 4.4.11 of the free plugin.

    Drop this in your functions.php file and replace ‘xxx’ with your API key:

    function my_acf_google_map_api( $api ){
    	
    	$api['key'] = 'xxx';
    	
    	return $api;
    	
    }
    
    add_filter('acf/fields/google_map/api', 'my_acf_google_map_api');

    https://www.advancedcustomfields.com/resources/acf-fields-google_map-api/

    • lallen

    • January 31, 2017 at 3:02 pm

    Using WordPress 4.7.2, ACF 4.4.11 and ACF: Location Field 1.0.0, the acf/fields/google_map/api filter did not work for me. What did work was to directly edit acf-location-field-master/location-v3.php and acf-location-field-master/location-v4.php to alter function admin_head() and function input_admin_head() to specify the API key:

    echo '<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp&key=[your key]"></script>';

    To fix front end, I added same script link to header.php.

  • It might not be obvious, needing to add your field key is noted in the google map field documentation https://www.advancedcustomfields.com/resources/google-map/. It’s in the 3rd code example, the one under Helpers at about line 16.

    This code could be added to header using an filter on wp_head or put directly into your header.php file.

  • Hi all,

    I solved this with this plugin :
    https://wordpress.org/plugins/api-key-for-google-maps/

    Hope it helps.

    StΓ©phane

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

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.