Launched a new site today and started getting a JavaScript alert saying

This page was unable to display a Google Maps element. Please contact the site administrator. If you are the administrator of this site, please check the JavaScript console or check the following page for troubleshooting: http://g.co/mapsJSApiErrors

And in console I get js?sensor=false&v=3.5:32 Google Maps API error: Google Maps API error: MissingKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error

After some research it appears that Google changed it's requirements and all new sites using v3+ of the api require an API key, as found here: http://stackoverflow.com/questions/37991340/error-google-maps-api-error-...

I noticed on lines 137-146 of plugins/layer_types/openlayers_layer_type_google.incis where the check for version 2 or not happen. Only on version 2 are we adding the key to the url.

Created a patch that works for me on a production site.

Comments

josh.fabean created an issue. See original summary.

josh.fabean’s picture

Issue summary: View changes
josh.fabean’s picture

Issue summary: View changes
StatusFileSize
new1.27 KB
josh.fabean’s picture

StatusFileSize
new1.11 KB
josh.fabean’s picture

tessa bakker’s picture

Status: Active » Reviewed & tested by the community

Works perfect!

hachreak’s picture

The patch works, but I continuous to not see the map! T_T
At least if I use "google maps hybrid" or "google maps normal".
Apparently "google maps satellite" works... @.@
It say "Google Maps API warning: RetiredVersion".
Probably is too old the 3.5 version but I don't have idea how the new stable version is compatible with openlayers-v2.. T_T
Any suggestions? :)

sohal khatwani’s picture

This patch worked for us on the Google Normal Maps. We also changed the selection to maps.googleapis.com in the API key section and installed our key.

tinohuda’s picture

patch #3 work perfectly

thanks.

nikolas.costa’s picture

I removed the warning due to incorrect RetiredVersion and SensorNotRequired values submission.

reszli’s picture

patch #10 works fine for me, so RTBC again

akolahi’s picture

Patch #10 seems to resolve the issue.

zread’s picture

+1 for patch #10