Google API give the opportunity to plugin to display map and calculate distance, time and price depending on pick up address and destination address your customer will use.
(a) When you create a new key, it must be a ‘browser key’.
(b) Leave empty field ‘Accept requests from these HTTP referrers (web sites) (Optional)’
Tutorial is here.
Create your own API key. It allows you to monitor your application’s Maps API usage.
You must enable :
- Google Maps Geocoding API
- Google Maps Directions API
- Google Maps Embed API
- Google Maps Distance Matrix API
Activate each API with activation button
Google actually blogged about this change not long ago.
As of June 22, 2016 we are making the following changes to the Google Maps APIs Standard Plan:
* We no longer support keyless access (any request that doesn’t include an API key). Future product updates are only available for requests made with an API key. API keys allow us to contact developers when required and help us identify misbehaving implementations.
Ok great, so you just have to get the key it seems! I noticed that requests for old URLs that have already accessedMaps API data worked, but any new URLs failed. In addition it looks like localhost access to the API doesn’t work very well now, even when using a key.
So what you need to create is a browser key. Google has a page describing how to get the API key. If you click the‘Get a Key’ button it will take you through the right steps.
First you will be asked to select a project or create a new one.
Then you’re taken to the Credentials page where you can generate the key. It’s a good idea to give this key a meaningful name as well as add a domain to restrict it to. If the key is unrestricted, other domains can make use of your key, which will reduce your quota allowances i.e. bad things will happen.
After you click ‘Create’, your new API Key is presented to you.
Create a Google Maps API Key
Follow these steps to create and implement a free Google Maps API Key.
- Start Google’s Get a Key process then log into your Google account (or create one).
- Click Agree and continue to create a new project representing your website.
- Under Accept requests, add the two entries below (replacing yourname.comwith your own domain). Type the first entry then hit enter on your keyboard to add it. Repeat to add the second entry. Having both entries (with asterisks) will help ensure your maps work on any URL of your website.
- Click Create then copy your key that is now shown on the screen.
- If you’re using our WordPress plugin, go to Settings > Church Theme Contentand paste your key into the Google Maps API Key field then click Save Changes. Otherwise, do similar according to the product you’re using.
Note: Google says it can take up to 5 minutes for your key to become active. We’ve heard reports of it taking 30 minutes or longer. Keep this in mind if your maps do not show right away.
Please ensure your API has two referrers set in the Google Developers Console:
This not work :
but this work :
Quick F12 to developer console and reload gives:
It must be to « none » or IP addresses (web servers, cron jobs, etc.), Not HTTP referrers (web sites)
Your domain must be verified. Follow the steps given by google.