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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 2759431-google-maps-api-error.patch | 1.11 KB | josh.fabean |
| #10 | openlayers-google_maps_api_error-2759431-10-D7.patch | 2.93 KB | nikolas.costa |
Comments
Comment #2
josh.fabeanComment #3
josh.fabeanComment #4
josh.fabeanComment #5
josh.fabeanComment #6
tessa bakkerWorks perfect!
Comment #7
hachreak commentedThe 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? :)
Comment #8
sohal khatwani commentedThis 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.
Comment #9
tinohuda commentedpatch #3 work perfectly
thanks.
Comment #10
nikolas.costa commentedI removed the warning due to incorrect RetiredVersion and SensorNotRequired values submission.
Comment #11
reszlipatch #10 works fine for me, so RTBC again
Comment #12
akolahi commentedPatch #10 seems to resolve the issue.
Comment #13
zread commented+1 for patch #10