P
P
Petr Volkhanov2018-05-13 11:27:48
JavaScript
Petr Volkhanov, 2018-05-13 11:27:48

How to fix Google Maps API error: MissingKeyMapError?

On the site, on some pages there is a JS warning Google Maps API warning: NoApiKeys https://developers.google.com/maps/documentation/j... and an error Google Maps API error: MissingKeyMapError https://developers.google.com /maps/documentation/j... . Google Maps API has a permission, but maps don't work properly... How can I fix this error?
PtRPu.png
With the API key, everything seems to be OK:
w39xc.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Petr Volkhanov, 2018-05-22
@eprivalov

The error was due to a conflict with the ACF plugin. Here is the code that solves the problem:

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

O
Orkhan Hasanli, 2018-05-13
@azerphoenix

Hello!
Check other plugins, maybe one of them requires you to install an API key. Also update the theme, there may be a problem in the theme. In theory, if you have entered the api key, then the map should work. Well, try to remove the restrictions in the permissions and check again.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question