Contact Info/Map Widget: Better Error Messaging
Summary
On self-hosted sites (doesn't seem to impact WPcom *) the Contact Info/Map widget is not accepting any address. This includes the default address shipped with the plugin:
Image Link: http://cld.wthms.co/z2lJQW
Tested using an unrestricted API key with access to the Maps Embed API:
Image Link: http://cld.wthms.co/2xRH1O
NOTE: Since I'm posting this in the public repo, I've regenerated both API keys. They're no longer valid.
Bug replicated across different platforms:
- Pressable
- Atomic
- Self-hosted (Google Cloud Platform)
- A user's site
Unclear if this has an impact on existing widgets that already saved the address. Didn't have any to check on.
* WPcom-specific stuff; check here, there's another oddity:
- p1539903252000100-slack-jpop-support
Internal ref: 1494815-zen
When initially signing up for a Maps API key, following Google's instructions (that we link to), you're presented with these options...
Image Link: http://cld.wthms.co/JJXLsa
You must also select Places, so that the Geocoding API is included. Otherwise, the widget won't work:
- https://developers.google.com/maps/documentation/geocoding/start
The Geocoding API is a service that provides geocoding and reverse geocoding of addresses.
I'll update the affected user and we'll work on updating our docs to make this "gotcha!" clearer.
Reopening to enquire if there's any way we can detect if the key does not have the Geocoding API enabled, or at least give a hint in the widget that that could be the issue.
It may be possible. There are a number of status codes the API will return that would indicate some type of key error https://developers.google.com/maps/documentation/geocoding/intro#StatusCodes
We probably could at least pass the error message through.
1506303-zen
Error Message - update it here so this issue is more searchable:
Sorry. We can not plot this address. A map will not be displayed. Is the address formatted correctly?
1506303-zen
@mzakariya - When working on this ticket, I've tested more than one time and in my testing, I just need to choose Maps without Places, the key is still working for me.
1548677-zen
Another case in the dotcom forums.
1644371-zen
1668616-zen
Looking at Google's documentation you must now enable Billing to get this API to work https://developers.google.com/maps/documentation/geocoding/usage-and-billing
(Image link: http://cld.wthms.co/WkRcWC )
1674153-zen
1699926-zen
1692948-zen
1707581-zen
1727750-zen
Chat: 6131015-hc Follow-up: 1771283-zen
I replicated the issue on the Atomic site where the address show the error Sorry. We can not plot this address. A map will not be displayed. Is the address formatted correctly?. Whereas for the same address and API, works fine on a simple site.
Chat: #10083042-hc Ticket: #1776470-zen
Chat: 10139652-hc Follow-up: 1783357-zen
1777442-zen
#1835564-zen