General - Maps, geocoding services and API keys

With Property Hive installed you can manage your map integrations from within 'Property Hive > Settings > General > Maps':

If you don't see the 'Settings' submenu option available it could mean your user role doesn't have the right permissions as this is only available to administrators.

If you use an add on that does additional server side geocoding requests (property import, radial search etc) you will also have an extra field show here:

What's geocoding?

It's the process of converting a human-readable address (e.g. 123 High Street, Birmingham, B31 4TH) into a set of latitude and longitude co-ordinates (e.g. 54.1313, -0.12323) for use on maps and for performing distance/radial based calculations.

Choosing a map provider

In Property Hive you can customise the map provider used to display maps and for geocoding requests and choose between Google and OpenStreetMap for both.

By default this will be Google, however we understand that sites with high traffic may begin to incur costs after a certain number of map views so allow the option of open source OpenStreetMap too.

As mentioned, OpenStreetMap is open source which is great because it means it's free. but it can also mean results may not be as accurate. We've found some locations work better than others, especially when it comes to geocoding.

Be careful if you opt to use Google for the Geocoding service but OpenStreetMap for displaying the maps. We believe this goes against the Google T&C's and take no responsibility for this.

Creating API keys

If you've selected Google then you'll be prompted to enter an API key(s). One by default, but two if you're using an add on that does additional server side geocoding requests (property import, radial search etc).

Why two different API keys?

It all comes down to securing your API key and adding restrictions. You could use the same API key in both fields without any restrictions, but someone could take your API key and use it on any site.

We therefore recommend that you always add restrictions to your API keys. The trouble is client-side requests (e.g. outputting the map on the website) require a 'Website Restriction' and server-side requests (i.e. geocoding an address) require an 'IP Restriction'.

As a result, you'll need 2 separate keys with different restrictions.

All API keys can be managed through Google with documentation about how to do this here:

https://developers.google.com/maps/documentation/javascript/cloud-setup

On your primary Google Maps API key you'll want to add a 'Website' restriction:

If you need to setup a secondary Google Maps API key for geocoding you'll need to ensure it has an 'IP address' restriction:

You'll also need to ensure the Geocoding API is enabled under the 'Enabled APIs & Services' section of the Google Cloud Platform:

Troubleshooting

My maps aren't displaying

If your maps aren't showing or are showing but are overlaid with an error, the very first place to check is the browser console. This can be opened in the browser in most cases by pressing F12 on the keyboard.

If there is an issue it will be shown here along with a link with more information:

In the example above, I have an invalid API key entered but other common reasons could be that billing hasn't been enabled on the Google account, or that the restrictions applied to the API key are wrong or for the wrong site.