Page tree
Skip to end of metadata
Go to start of metadata

Overview

To enable google maps:

  1. Set the Administrator → Setup → Settings → Locations → Map Type setting to "Google".

  2. Set the Administrator → Setup → Settings → Locations → Map Display Type setting to "Dynamic Image".

  3. Obtain Google API keys.  This is used for displaying maps, geocoding and other google related features.

    Google requires two API keys. Both a browser key, used for the display of maps, and a server key, used for geocoding. phpMyDirectory has two setting fields to enter both API keys.

    1. Go to Developer Console https://code.google.com/apis/console/
    2. Create a "Project" and give it any name such as "Directory Website".
    3. Under the new project dashboard, enable the following APIs:
      1. Google Maps JavaScript API
      2. Google Maps Embed API
      3. Google Maps Geocoding API
      4. Google Maps Geolocation API
      5. Google Static Maps API
      6. Google Street View Image API
    4. Create API Key #1 (Browser Key)
      1. Under the "Credentials" section, click the "Create Credentials" dropdown and select API Key.
      2. An API key will be created.  Copy and past this key into the Administrator → Setup → Settings → Other → Google Browser API Key setting.  Return to Google and click the the "Restrict Key" button/link.  Under the "Key Restriction" section, select the "HTTP referrers (web sites)" option.  Enter your domain name in the field provided and save the key.  Depending on if you are on a subdomain or using "www." the referrer will need to match.  Generally you may enter both ".domain/* and "domain/*" to match both.
    5. Create API Key #2 (Server Key)
      1. Under the "Credentials" section, click the "Create Credentials" dropdown and select API Key.
      2. An API key will be created.  Copy and past this key into the Administrator → Setup → Settings → Other → Google Server API Key setting.  Return to Google and click the the "Restrict Key" button/link.  Under the "Key Restriction" section, select the "IP addresses (web servers, cron jobs, etc.)" option.  Enter your server IP in the field provided and save the key.
Map Example

See Also