Hi all,

I've been using Gmap with Location for a few months without any problem, but suddenly (On sunday march 10) gmap stoped geocoding my locations when someone added one. It means that in the 'location' table, 'source' is set to 0 (instead of 3 for geocoding) and lat&long are set to 0.0000 each.
The problem appeared after I installed the module email_registration but it was probably a coincidence as the problem persisted after a full backup of the database (before installing the module).
I don't know how to debug this, mainly because when going on the Google API console, I can see that my key is working and google receives all my requests for geocoding (the counter increments everytime I save a location on my website).

I first thought it was due to the deprecation of the API v2 but it seems that it will still be running for a few months. Also I tried the Gmap v. 7.x.2.4 and I had the same results.

Thank you very much for your help,

Michaël

Related

#1940474: Google geocoding returned status code: 610
#1944120: [6.x-3.x] Google geocoding returned status code: 610

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ericjvandervelden’s picture

Same for me.

doostinharrell’s picture

Same here.

bill-13’s picture

Likewise. I didn't install any new plugin. GMap cannot get the latitude and longitude from a submitted address. There is no error in drupal's error log or in apaches error log.

johnv’s picture

And no-one of you did an upgrade of any module?

podarok’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Active » Postponed (maintainer needs more info)

this should be tested against latest dev
Google is in API v2 stoping phase

mikavirt’s picture

Tested against latest dev (7.x-2.5-alpha3+0-dev) without any result.

I neither did upgrade any module for a few weeks.

podarok’s picture

Status: Postponed (maintainer needs more info) » Active
Mschudders’s picture

I've fixed the gmap geocoding already because I am only using this.

But you can start fixing the code by help of my changes:

$data = drupal_http_request(gmap_views_protocol() . '://maps.googleapis.' . $tld . '/maps/api/geocode/json?address=' . urlencode($address) . '&sensor=false');

so what changed ?

- maps.googleapis instead of old maps...
- /maps/api/geocode/json?address (NO more Q + NO moreCSV ==> json now or XML)
- required sensor parameter
- no more key it is useless now ==> can be removed from all the code

I'll try to fix everything if I have the time

Mschudders’s picture

A working gmap geocode code:

function gmap_geocode($address, $tld = 'com') {
  $data = drupal_http_request(gmap_views_protocol() . '://maps.googleapis.' . $tld . '/maps/api/geocode/json?address=' . urlencode($address) . '&sensor=false');

  if ($data->code == 200) {
    $data_decoded = json_decode($data->data);
    return array(
      'status' => $data_decoded->status,
      'accuracy' => $data_decoded->results[0]->geometry->location_type,
      'latitude' => $data_decoded->results[0]->geometry->location->lat,
      'longitude' => $data_decoded->results[0]->geometry->location->lng,
    );
  }
  // Non 200 is G_GEO_SERVER_ERROR (500).
  return array(
    'status' => 500,
  );
}
Mschudders’s picture

FileSize
1.19 KB

Patch attached :-)

Mschudders’s picture

Status: Active » Patch (to be ported)
mikavirt’s picture

Podarok, thanks for your link, I made the changes recommended on the issue and it indeed solved my problem! Seems that in my narrow vision of things, I didn't thought that the solution could be found in the location module.

Mschudders, thanks for your help, I will try this afternoon to take a moment and see if your patch solves also the issue!

thanks buddies ;)

podarok’s picture

Status: Patch (to be ported) » Needs review

bot

Status: Needs review » Needs work

The last submitted patch, gmap_geocoding_fix.patch, failed testing.

podarok’s picture

http://drupal.org/patch/submit should be in git diff format against latest dev version

git clone --branch 7.x-2.x git://git.drupal.org:project/gmap.git
cd gmap
make Your changes
git diff > 1940654.patch
upload it with needs review status for testbot 

Thanks!!!

podarok’s picture

Assigned: Unassigned » podarok
Status: Needs work » Needs review
FileSize
1.34 KB

#10 reroll

podarok’s picture

It`s greed
tags

johnv’s picture

@Mschudders, for this patch #1931138-29: Fixing all 'single marker' issues I testeed both //maps.googleapis and //maps.google .
I decided upon the //maps.google , since both were working.
Is there any reason why googleapis is better?

manoloka’s picture

Hi there,

Can this be ported to D6? Please

Thanks
Manuel

podarok’s picture

#19 look at the #16 and try to make You own changes against 6.x-3.x and upload patch
)

manoloka’s picture

Patch of post #2 and comment #9 from http://drupal.org/node/1940474 solved the issue for me.

I'm and I'm on D6

thank you!

bill-13’s picture

I also want to ask if the changes can be ported to 6.x please. Also if I knew how to do it I would do but I don't...

Mschudders’s picture

@Johnv

Since I checked the original documentation and that is the correct url. Maybe that url is still working for now but it could be that it wouldn't in the near future I do not know that.

Documentation : https://developers.google.com/maps/documentation/geocoding/#GeocodingReq...

Only suggests the "apis" url.

johnv’s picture

@Mschudders , thanks.

ellastelter’s picture

I opened a new bug report for D6. I tried messing with the D7 versions, but don't know enough to make it work either. http://drupal.org/node/1944120

ellastelter’s picture

Issue summary: View changes

Updated issue summary.

geekmuse’s picture

For anyone still in version 6 land, I was having this problem as well but was able to fix mine with a patch to the Location module.

I am using a Google API key switched on only for v3 of Maps.

I'm using Location 6.x-3.2 and the current 6.x-2.x Gmap dev (6.x-2.0-beta1+11-dev).

I posted a patch against the requisite Location module file in this comment. I hope this helps someone!

johnv’s picture

Title: Geocoding stoped working » Geocoding stopped working (D7)
Status: Needs review » Fixed

For D7, this is (accidentally?) committed on Mar-13, http://drupalcode.org/project/gmap.git/commit/9c61400

For D6, see #25, #26.

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

Anonymous’s picture

Issue summary: View changes

Updated issue summary.