• Home
  • GEOMMUNITY MAPS
  • About GoogleMaps API Key

GoogleMaps API key requirement

Google provides the Googlemaps service for free, but — probably due to a change of the policy — Since June 22nd 2016 , an API key is required for all new GoogleMaps API projects. If there is no such key, the maps will not be displayed. Instead you will see an error message. Did you create and publish a Geommunity Map and then don't see a map but a warning like the following? 

Oops! Something went wrong.
This page didn't load Google Maps correctly. See the JavaScript console for technical details. 

In this case there will probably be one or more error messages in the "console" of your browser.
(See "Chrome > Devtools > Using the Console or "Firefox Developer Tools > Web Console" to learn more.) If there is a MissingKeyMapError, a InvalidKeyMapErrorRefererNotAllowedMapError, or another one of the "Google Maps JavaScript API Error Codes" in your browser's console there is a problem with the Googlemaps API. Either you did not yet insert the API key into the Geommunity3 settings, or the key it is invalid/wrong, or the API is not properly configured or something else is wrong with it.(See "Google Maps JavaScript API Error Codes for Developers" for details about the error messages and warnings.)
  • If you don't have a Googlemaps API yet, go to https://console.developers.google.com/apis and create one.If you don't have such an account yet and feel unsure about how to create it, please ask your site's webmaster for assistance.
  • If you have and API key and it is entered in the Geommunity3 settings, but you still get errors related to the API:
  • When creating/configuring the API key make sure to enable at least the "Google Maps JavaScript API" and the "Google Maps Geocoding API" (click on the "More" link at the bottom of the "Google Maps APIs" list to expand it and show all available variants):
    Image

    The "Geocoding" API is responsible for translating a literal address (with a street and city name for instance) to a location on the map. It is not to be confused with the "Geolocation" API! (Thanks to "lousyfool" for pointing that out.) So if you wonder why entering an address to set the marker doesn't work, a missing or wrongly configured "Geocoding" API is most likely the cause.

  • Configure the "referers". With mydomain.com as an example (replace that by your domain name!) you should set at least these two referrers:
    *.mydomain.com/  
    *mydomain.com/
  • Important: Depending on your domain, your Google account and several other aspects these settings could be different!
  • Update:User "pawell" states that the "Google Places API Web Service" is also important to find an address. So activate this feature as well.
Where in doubt about the API and how to create or configure it, please refer to Google's manuals or ask your site's webmaster for assistance.Once this is taken care of, the Googlemaps should be displayed as expected.