Address search was experiencing issues

by October 29, 2014

Update: Things should be working much better now. A detailed account of our efforts is at the bottom of the post.

The address search found on the Electable home page is one of the core features of our site, but we’re working out some issues with it.

Yesterday it seemed to be working fine, but today we are seeing several problems. An address search in Washington, D.C. is returning a location in Wenatchee, Washington. Most addresses are ignoring the street address and returning results for the center of the city/town. Additionally, searches are failing unless they include a zip code – which was not required yesterday.

What happened? Only Google can answer that.

We use the Google Maps Javascript API to parse an address; returning the latitude and longitude as well as individual address components.

When an API goes down, it’s good to have a backup. We’ve programmed some error messages to explain issues with results; but additionally, we’re looking into a Yahoo! API that should perform a similar task.

For now, we’re at the mercy of Google.

Update: 8/29, 6:00 pm

Google may have come to the rescue. Things started working much better this afternoon after I reached out on Stack Overflow. That always seems to happen, just to make me look silly.

Regardless, we’ve installed some failsafes. The search was initially programmed to return an error if the API could not decipher the address at all, but the problem was it was returning more generic results.

In this case, if the Google API fails to return a street address, we’ll assume the latitude/longitude is not accurate enough. In that event, we’ll use Yahoo’s service.

If Yahoo also fails for some reason, we display an error that the address may not be correct and provide a map for the area that Google is giving us. This allows us to be transparent about the problem, at the very least.