Geocoding, Importing and Google Maps API Restrictions
This topic contains 17 replies, has 5 voices, and was last updated by Paul Braun 6 years, 3 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
June 14, 2019 at 7:29 pm #493038
Hi,
We have a new v2 install, and have found that both the maps and the geocoding during import will only work when the API key is unrestricted.If we use “HTTP referrers” restriction, then the geocoding during import fails, but the maps still work. Manually adding/editing a listing and using “Set Address On Map” button works to set Lat/Long.
If we use “IP addresses” restriction (with server IP), the geocoding during import works, but the maps fail. “Set Address on Map” does not work.
Setting restrictions to “None” allows both map functions to work.
It appears we need one key for geocoding during import, and one key for normal map usage.
Is this a known bug?
Is the workaround to use a different key during import?Thanks,
PaulJune 14, 2019 at 8:19 pm #493040Hi Paul Braun,
Thanks for your post. This isn’t a known issue and could you share your Website WP admin access here in private reply so that I could forward this to a developer?
Thanks!
June 14, 2019 at 8:30 pm #493043This reply has been marked as private.June 15, 2019 at 12:49 am #493066I am not sure, but the problem may be with your Google Settings.
https://wpgeodirectory.com/docs-v2/integrations/google/#manualDifferent functions use different APIs. Geocoding and Geolocation need different APIs.
There is also a difference between “Website restrictions” and “API restrictions”.
Try setting “API restrictions” to “off”. See image.
Let us know, and I’ll get a developer to comment too.
June 15, 2019 at 5:18 am #493076Hi Paul,
It shows error “API keys with referer restrictions cannot be used with this API.” in console.
Here are solutions:
https://developers.google.com/maps/faq#browser-keys-blocked-error
https://wpstorelocator.co/document/create-google-api-keys/#server-key-referrerKiran
June 16, 2019 at 1:31 pm #493222Thanks Guust,
Yes the keys are unrestricted for API.June 16, 2019 at 1:37 pm #493223Thank you for your reply Kiran,
So you are confirming that we do need two different keys to use maps AND geocoding with GeoDirectory. The problem is that I only see one place to enter a single key.
Since we shouldn’t use an unrestricted key, will GeoDirectory add a second entry field for a second secured key?
Thanks again!
June 16, 2019 at 6:59 pm #493269No, you only need one key, and one field for entering that key.
Once you have verified that an unrestricted key works, then add restrictions to it. Make sense?June 16, 2019 at 10:49 pm #493291Hi Alex,
It would make sense if a single key would work for both Geocoding AND Maps.But…
Geocoding requires IP restrictions
Maps requires Http restrictionsOne key can’t have both restrictions.
Right?Thanks,
PaulJune 17, 2019 at 12:04 am #493293Many APIs can be added to one application or project.
Keys belong to the application, not the APIs.
You restrict applications by HTTP or IP, not APIs.
So restrict your application to your URL but do not restrict the APIs.June 17, 2019 at 12:04 am #493294Many APIs can be added to one application or project.
Keys belong to the application, not the APIs.
You restrict applications by HTTP or IP, not APIs.
So restrict your application to your URL but do not restrict the APIs.June 17, 2019 at 12:48 pm #493423Hi Guust,
I am not restricting by API.Geocoding requires IP application restrictions
Maps requires Http application restrictionsGoogle states we can set one application restriction per key.
Can you see the problem we face now?
Please advise,
PaulJune 17, 2019 at 1:26 pm #493430Oops.
All I can think off is to turn of referer when you import.
That is the only time geocoding is required.
I never encountered that before.
I’ll get Kiran to confirm.June 17, 2019 at 1:30 pm #493432This reply has been marked as private.June 17, 2019 at 2:04 pm #493438No issues with either maps or geocoding.
This is an unrestricted key right?
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket