D
D
Dmitry Samoilov2021-02-14 15:47:37
Google Maps
Dmitry Samoilov, 2021-02-14 15:47:37

How to specify geolocation on posts through ACF if Google does not allow you to use the map api for free?

Hello, I planned to mark places through the Yandex map, so that when you click on the balloon, you can go to the page of this place on the site, here is an example of a map. 60291a0cc8c46907280622.jpeg
But for this you need to set coordinates for posts through acf, at first it seemed to me a good idea, but for some reason acf I didn’t work with the map and gave an error 60291a6b94be5759706130.jpeg
. Then I read that you need to specify the Google Maps api key in function.php, I got it and went to configure it, here is the code:

function my_acf_google_map_api( $api ){
  
  $api['key'] = 'ключ; // Ваш ключ Google API
  
  return $api;
  
}

add_filter('acf/fields/google_map/api', 'my_acf_google_map_api');


The map still continued to give an error, then I decided to go make a local site, just Index.html, to check the operation of the key, I took an example of a map from the Google documentation, set the key and an error appeared in the console that you need to confirm the billing account. 60291b2986cd8087090002.jpeg
I didn’t work much with Google api, Yandex looks more convenient, so I want to know if it really won’t work without a payment account? writes that after 3 months of the trial version, you will need to pay 300 bucks a month for Google services.
Maybe there is a way to somehow use this map for free or set the coordinates of the posts in another way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Samoilov, 2021-02-14
@distCom

The issue was resolved, they don’t write off money right away, there is a limit on usage per month for which you don’t pay, well, as I understand it, I hope they don’t write off 300 bucks now

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question