Google Maps Error

I hope someone encounters this problem. I am new to all this, so I apologize in advance for my knowledge.

I currently have the Google Maps API on my Wordpress site. When I search on a site, that is, a page containing a Google Map, the listing results were not found. After further investigation, I was informed that:

There is a JS error on my website coming from the Maps API. Chrome Dev console shows:

js? key = ++ AIzaSyC_GzbCPmMM8Jme9ZAi-IbKOdaXo_SfK_I + & libraries = places & ver = 3b47f53 ......: 34 InvalidValueError: setComponentRestrictions: not an object

Original submission of the page that allows displaying Google JS card https://maps.google.com/maps/api/js?key=++AIzaSyC_GzbCPmMM8Jme9ZAi-IbKOdaXo_SfK_I+&libraries=places&ver=3b47f534942a304aaad0d1a98d2531f8

the "& ver = 3b47f534942a304aaad0d1a98d2531f8" part (it is added to each JS file) should not be present, so we assume that it should come from some plugin that I have, which may cause this problem.

Before you start disabling every plugin on my Wordpress site, has anyone encountered this error before?

Any help would be greatly appreciated.

Thank,

Justin

+4
source share
4 answers

- , , 3.27 Google Maps.

https://code.google.com/p/gmaps-api-issues/issues/detail?id=11253&q=setComponentRestrictions&colspec=ID%20Type%20Status%20Introduced%20Fixed%20Summary%20Stars%20ApiType%20Internal

Google .

:

! . JavaScript API 3.26, .

. , . :

autocomplete.setComponentRestrictions({'country': []});
+8

, InvalidValueError: setComponentRestrictions: in property country: not a string; and not an Array. , {}, componentRestrictions Place Autocomplete.

, componentRestrictions API Google, . , Google , , .

, , componentRestrictions.

0
source

Update Google Maps to version 3.28.

0
source

Source: https://habr.com/ru/post/1666427/


All Articles