Now google maps requires api key, see below:
"If you are using the Google Maps API on localhost or your domain was not active prior to June 22nd, 2016, it will require a key going forward. To fix this problem, please see the Google Maps APIs documentation to get a key and add it to your application: https://developers.google.com/maps/documentation/javascript/get-api-key see " more details here: https://www.latecnosfera.com/2016/06/google-maps-api-error-missing-keyma...

ERROR:

and even though there's a settings /admin/config/services/googlemaps to add api key it doesn't work, it is because in source code needs some modification

PROPOSAL SOLUTION:

PATCH #2 fixes the issue!

IMAGES that display map are working:

When you add or edit a geolocation field by using geolocation google maps submodule

When you view a node and has a field that has geolocation with display "dynamic google maps"

Comments

edutrul created an issue. See original summary.

edutrul’s picture

StatusFileSize
new1.86 KB

This patch fixes the issue mentioned in this issue

edutrul’s picture

Issue summary: View changes
edutrul’s picture

Issue summary: View changes
StatusFileSize
new114.61 KB
new378.12 KB
edutrul’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: google_maps_api_error-2758889-2.patch, failed testing.

vidalmb’s picture

It seems that the patch works, but reduces very much the performance of the site.

Sometimes when a user tries to update or access on read-only mode to any node that has a geolocalization field (with google maps formatter) on it, the page keep loading for several seconds (and the shows "Waiting for maps.google.com" below).

anas_maw’s picture

Patch #2 works for me.
Thanks

marysmech’s picture

Patch #2 works for me too.
Thank you.

MahmoodZidan’s picture

Oh man I love you. Patch #2 kicks ass.

andyanderso’s picture

Patch #2 worked for me as well.
It does seem to slow the page load significantly though.
Version 7.x-1.6

anas_maw’s picture

Status: Needs work » Reviewed & tested by the community
giorgosk’s picture

applied against the latest dev from 2016-03-10 version = "7.x-1.6+12-dev"
the patch gave this error

a.patch:26: trailing whitespace.
  if (!$js_added_already) {  
Checking patch modules/geolocation_googlemaps/geolocation_googlemaps.module...
Applied patch modules/geolocation_googlemaps/geolocation_googlemaps.module cleanly.
warning: 1 line adds whitespace errors.

The patches should be always against the latest dev is this the case with this patch ?

Actually it does not seem to work with latest dev
please follow the related issue instead

hash6’s picture

The #2 patch does not work for me , I have added the patch , but i still get MissingAPIKey Error .

hash6’s picture

I have found the issue and #2 is working perfectly , it was actualy an issue of geolocation proximity module.
Patch for which is here: https://www.drupal.org/node/2771621
Thanks

wesleybpereira’s picture

StatusFileSize
new162.84 KB

Hello. I applied the patch # 2 and insert the API but my map does not appear. Please help me.

hash6’s picture

StatusFileSize
new22.49 KB

Hi @wesleybpereira ,

The error in console is as shown below

RefererNotAllowedMapError
The current URL loading the Google Maps JavaScript API has not been added to the list of allowed referrers. Please check the referrer settings of your API key on the Google API Console.

which indicates that you have not allowed your site url to access the map api.

wesleybpereira’s picture

@hash6 thank you for the answer. But I've seen that does not work on localhost only when it is in an online server. How to solve it?

engmdik’s picture

Thanks :) it works for me, I spent two days to try to figure it out and finally you saved me :)

aris.rep’s picture

Thanks a lot!!! Yes, PATCH #2 fixed the issue to my Drupal7 website!

jomarocas’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

Yes the patch 2 working but the perfomance is very slow, i know this come to google but in my server that have amazon is the first time to i have slow server. but the patch working please port

klevyke’s picture

For those who try to fix this error:
Google recently announced:

As of June 22, 2016 we are making the following changes to the Google Maps APIs Standard Plan:
We no longer support keyless access (any request that doesn't include an API key). Future product updates are only available for requests made with an API key. API keys allow us to contact developers when required and help us identify misbehaving implementations.

You can get one here.

Jelmer85’s picture

I don´t know how to apply patches, so I guess I have to change to a completely different module to show geolocations on my site? :/

conorc’s picture

Thank you Luis (edutrul), Patch #2 worked for me.

PS: Jelmer85, you can find info on applying patches here
https://www.drupal.org/patch/apply

slashrsm’s picture

Status: Patch (to be ported) » Reviewed & tested by the community

I can confirm that patch fixes the problem. It has some whitespace issues, but they should be fixable on commit.

I see no reasons why this patch would cause significant performance problems (as mentioned in #21).

rcodina’s picture

The patch on #2 works for me too using latest dev release!

To get the API KEY and enable Google APIs: https://console.developers.google.com
To set the API KEY: admin/config/services/googlemaps

wasiiim’s picture

It worked for me as well Thanks a lot ...

  • edutrul authored 3c5bdf7 on 7.x-1.x
    Issue #2758889 by edutrul, hash6, wesleybpereira: Google Maps API error...
christianadamski’s picture

Status: Reviewed & tested by the community » Fixed

I did not test this at all. I pushed as is, combined with some other fixes around.

Thanks for everybody working on this and testing.

ok_lyndsey’s picture

Hi - I feel like I shouldn't post on a Fixed task! This is pretty much my first ever post - this seemed closest issue #newbie
Can you/have you added to description to enable Google Maps Geocoding API, I found you need that and Google Maps JavaScript API to get the geocoding working?

Propose Google Maps API help text as:

Google requires users to use a valid API key. Using the Google API Manager, you can enable the Google Maps JavaScript API and Google Maps Geocoding API. That will create (or reuse) a Browser key which you can paste here.

christianadamski’s picture

Hey ok_lyndsey,

could you create a new issue instead? And also describe where you want that text to appear?

I do not use the D7 module, like, at all. I'm just standing in for @jochenmeyer while he is busy.

njacobson’s picture

Is there a patch for Drupal 8 version?

christianadamski’s picture

@njacobson,

the D8 branch has a configuration page to enter the Google Maps API key. It will be used where needed from there.

njacobson’s picture

@ChristianAdamski - Thank you for responding! I was able to create a key and entered it into the geolocation settings page in drupal. When i try to view my map it has an error. I posted a comment in this thread with more detail: https://www.drupal.org/node/2771621#comment-11835487

christianadamski’s picture

Hey @njacobson,

please do not post D8 questions in D7 issues. That won't help anybody. Instead be bold, create a new issue.

Regarding this specific request: the D8 branch is pretty well tested by now. It works almost everywhere. Please double check the API key is in and caches are cleared.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

njacobson’s picture

sorry - I was actually trying the module in both D7 and D8 and getting the same error in both versions. Is the patch the only solution right now or will there be an update for the module soon?

pinueve’s picture

patch #2, works perfect! thanks, apply patch on 7.x-1.6 version, dev version does not apply.

flocondetoile’s picture

It would be nice if a new stable version could be released. Too bad to have to install the dev version module for a so small but critical bug.

Bests

yasik’s picture

Patch #2 works for me.
Thanks

amiroo0’s picture

Component: Google Maps geolocation » Geolocation Field / Backend

It works perfect. Thank you