Using a GeoJSON layer of town boundaries and OpenLayers, the layer fails to render. No error is thrown, but the log generates the message below.

Exception: Google API returned bad status.\nStatus: ZERO_RESULTS in geocoder_google() (line 51 of /sites/all/modules/geocoder/plugins/geocoder_handler/google.inc).

This is on the development version of a production site that's working with 1.x versions of OpenLayers, etc. - I'm trying to get 2.x working on the dev site before attempting an upgrade.

I don't know if this is OpenLayers, GeoField or something else, but I though here would be a good place to start.

Any suggestions greatly appreciated!

Comments

bcobin’s picture

Could be related to http://drupal.org/node/1941960 - will be following over there and will check back in.

kingfisher64’s picture

Yeah, i've got this exact same error message too, again no output to the page but it's in the log.

I'm running latest drupal 7.22, geocoder, geofield branch 2.x dev versions with one patch from #5 of http://drupal.org/node/1626716 applied to geofield.

Exception: Google API returned bad status.\nStatus: ZERO_RESULTS in geocoder_google() (line 51 of sites/all/modules/geocoder/plugins/geocoder_handler/google.inc).

Gyver06’s picture

Exact same behaviour and message for me.
Any help very welcome.

bcobin’s picture

No joy so far - just added an issue for Geofield here: http://drupal.org/node/1994070

If anyone has figured this out, I'd love to know... thanks!

socialnicheguru’s picture

Title: Watchdog instead of an Exception on Google API returned bad status » Exception: Google API returned bad status
Category: task » support

is there anyway it can write to dblog or syslog and not throw an exception?

Edit: The exception throws a white screen which is bad for usability. I would rather it be an error that I can read in a log.

greggles’s picture

Title: Exception: Google API returned bad status » Watchdog instead of an Exception on Google API returned bad status
Category: support » task

I'd also prefer to see a watchdog that's not an exception.

bcobin’s picture

What would be best, of course, is if there was no error at all; in other words, if somebody could figure out why a perfectly good GeoJSON file doesn't render.

In my case, I'm simply trying to render an existing GeoJSON file that contains boundaries. I have this working perfectly at http://suffolkcountydems.com/district_maps but I can't get this to work on the development site with the latest code versions. I want to use the geofield 2.x branch insofar as it's supposed to offer point location capability that the 1.x branch does not.

The objective, of course, would be for the user to enter in his/her address and see what voting districts they're in.

I'm still in the wilderness here as to how to solve this - Any ideas? Thanks!

weboperator’s picture

Title: Exception: Google API returned bad status » Watchdog instead of an Exception on Google API returned bad status
Category: support » task

In our case just the outgoing drupal_http_request was blocked by a firewall. See line 35 and 36 in google.inc

$url = url("http://maps.googleapis.com/maps/api/geocode/json", array('query' => $query));
$result = drupal_http_request($url);
Anonymous’s picture

In my case it was the browser at fault. The new Firefox 23 has a Mixed Content Blocker which was blocking the json responses from googleapis.com. Apparently the newer versions of Chrome & IE have the same feature.

See https://support.mozilla.org/en-US/kb/how-does-content-isnt-secure-affect...

If you see a shield icon in the URL bar, this is likely what's happening. The new Mixed Content Blocker in Firefox can be turned off on a page for the session, but that will not persist across sessions, windows, or tabs. It also does not allow the whitelisting of URLs. It can, however, be turned off entirely:

http://plsqlnotes.blogspot.com/2013/09/firefox-disable-mixed-content-blo...

If you're using a recently updated Firefox, try this.

jlongbottom’s picture

When I get this error it appears in the database log. No white screen of death.

I also check if the result is empty in my module.

$point = geocoder('google', $address);
if(isset($point->coords)) {
	$geoJSON = $point->out('json');
	//the rest of your geocoding here
}
bcobin’s picture

Revisiting this now that Election Day is over - no joy with any of the suggestions here. http://drupal.org/node/1941960 is a different issue and it's not a browser thing as suggested in #9.

Again, I have all of this working on the production site at the URL in the original post as well as now at http://nassaucountydems.com/dem_clubs (a particularly nice implementation, I think.)

But with Geocoder 2.x, JSON boundaries don't work and I still get the error as listed in the original post. Once again, point locations work fine. GeoJSON boundaries don't.

Any ideas here? It's been quite a while now... still hopeful...

bcobin’s picture

Title: Watchdog instead of an Exception on Google API returned bad status » GeoJSON boundaries fail to render with Geofield 2.x
Issue summary: View changes

Updating issue title/description

UPDATE - I found the boundary issue - I needed to use a different projection for the layer; I changed it and now the boundaries work fine. The Google ZERO_RESULTS error (which is unrelated to the boundary issue) still persists, though...

pol’s picture

Status: Active » Closed (outdated)