GeoDirectory currently offers you a choice between two different Maps APIs. You can use Open Street Map, or Google. On this page you can review various information about the use of the Google Maps API.
Making use of Google APIs isn’t quite as easy as just clicking a button. If this is your first time using Google’s developer console and cloud services, here are few things you need to know.
- Recommended background reading: https://wpgeodirectory.com/google-maps-platform-changes-directory-developers/
- Services are not ‘free’. Google may give you a certain amount of usage per month for free, but that can always change. See Google’s pricing sheet for more details.
- A billing account is required. Setup of a Billing account is required to get started with real usage of the APIs. It is possible to login and acquire an API key, but without setup up a billing account, your site will not be able to work properly because the quotas are so low.
- GeoDirectory makes use of many different APIs, and so we recommend automated setup. If you are getting an error you should use our Generate API key button and remove any restrictions to test your key to make sure it works correctly. Once it works then add restrictions.
- Even if you have a theme and other plugins that also ask for a Google Maps API key, you should only add the key once, and only to the GeoDirectory settings.
- See the FAQ at the bottom of this page if you need a solution.
Find the settings for the Google Maps API at:
GeoDirectory – Settings – General (Tab) – General (Subtab)
New to Google Maps? Try the tutorial first.
In the screenshot above numbered 1-3
- Google Maps API Key – Already configured your key? Enter it here.
- Generate API Key – Automatic configuration of a new key. You must be logged in to the Google Cloud console to use this Popup configurator.
- Link “Or get one here” – takes you to the Google Cloud Console and attempts to configure a new key with the appropriate APIs.
Too many choices? Read more below about the fastest and easiest way to get this done.
There are two parts to the process:
- Use your Gmail (or other Google) account to setup your Project and Billing account.
- Return to the GeoDirectory settings, enter your key and save the settings.
Visit the Google Cloud console here: https://cloud.google.com/maps-platform/
Choose all three products and click next.
Make note of the new project name
Get your Credit Card and select “Create Billing Account”
Billing Account Setup Complete?
Return to GeoDirectory settings and click “Generate API Key”
Wait for the new Popup window
Select the same project you created earlier
Copy the new API Key
Use the X in the top right to close the popup window
Return to the GeoDirectory Settings
Paste the API key into the API key field
Save the settings
There is one sure way to know if your Google project is setup correctly and that is to check the Quotas.
- Login to Google cloud console: https://cloud.google.com/maps-platform/
- Go to IAM -> Quotas
If your quota reads as 1/day you will need to setup billing. Check out the tutorial for a step by step.
If the quotas look right but you are still seeing errors, then remove the referrer restrictions from the key. Once you save the settings, then wait a few minutes and test to see if the key works. If the key works, then there was a problem with the referrer restrictions. See our notes below about securing your key.
You can check for errors on your site by opening up the site in Chrome and using the inspector. Just press F12, or use the shortcut ctrl-shift-i to open the inspector. Then find the word ‘console’ and click. Look for red text related to Google Maps API.
- Geocode – REQUEST DENIED – Either the Geocoding API has not been added, your project has no billing, or your referrer settings are blocking the site
- Referrer not allowed – Key restrictions need to be updated with your site URL.
- Quota exceeded – see trial account info above.
Click the “or get one here” link to walk through the configuration of your key in the console.
The link will take you to a screen confirming the APIs that will be enabled and allow you to select a project.
No, only Google can fix Google data, but you can report errors to Google Maps here:
If you have entered your API into your theme or another plugin in addition to GeoDirectory, you may find that all your maps stop working. If you check the chrome console you may see “Google Maps API loaded more than once on this page” in red.
Remove all the keys from every plugin or theme except GeoDirectory.
Each site only needs one API key, even if multiple plugins and the theme and GeoDirectory all need a Google API Key. GeoDirectory is where you should add your API key, and leave all the others blank. GeoDirectory will load the map API key in such a way that all the other plugins can use it.
If you encounter an issue after removing the keys from the theme and other plugins, ask for support.
The easiest way is to restrict with the HTTP Referrer setting. Please refer to the documentation below from Google about how to use the HTTP Referrer setting to restrict your API key to your site.
See : https://developers.google.com/maps/api-key-best-practices#restrict_apikey
The most common rule is the following:
If you need hands on support with the use of Google Console settings you can contact a developer here: http://geodirectoryexperts.com
Absolutely! Make a support request here: https://wpgeodirectory.com/support/
It isn’t our place to judge between them, but we can point out a few items of note.
Google Maps API
- + Global reach with data from almost everywhere.
- + Consistant formatting for street addresses.
- + Consistant and predictable ‘admin’ areas; cities are (almost) always cities (and not regions, for example).
- + Map translations available, meaning you can set the language of the map.
- – Custom Styling with the Custom Maps addon and Snazzy Maps means you can make the map match your site’s color scheme.
- – Users cannot fix errors, but incorrect data can be reported to Google.
- – Can be costly once free quota has been exceeded.
Open Street Maps API
- + Free.
- + Several map styles (tilesets) available with different styles through the Custom Maps Addon.
- + Data errors can be correct by directly editing the map on the OSM site.
- – Cannot be styled with Snazzy Maps, meaning maps won’t match your site style/colors perfectly.
- – Global community, but a much lower overall volume of data.
- – Inconsistencies in address formatting, especially between countries.