silentDjay / Mapstery

A geography game inspired by my long history of spending hours on end staring at maps
http://silentdjay.github.io/Mapstery/
6 stars 3 forks source link

Google Maps API update broke US States gameplay #22

Closed silentDjay closed 5 years ago

silentDjay commented 6 years ago

in the address component that the US States version of the game uses to match the destination state, the short_name attribute has been changed in the Google Maps API. Here is the new version, for formatted_address: "Kentucky, USA":

0: {long_name: "Kentucky", short_name: "Kentucky", types: ["administrative_area_level_1", "political"]}

Previously, the short_name would have been KY.

Interestingly, in other address components, like this one, for formatted_address: "Leeco, KY 41301, USA", the short_name is still the state's abbreviation:

2: {long_name: "Kentucky", short_name: "KY", types: ["administrative_area_level_1", "political"]}

EVERY instance of `"[State], USA" has the same data pattern. This inconsistent behavior seems like a bug on Google's side of things.

long_name: "Kentucky", short_name: "Kentucky" is simply messy data, not to mention that it's inconsistent with corresponding address components found in the varying levels of addres specificity that Google returns.

silentDjay commented 6 years ago

This page says this:

administrative_area_level_1 indicates a first-order civil entity below the country level. Within the United States, these administrative levels are states. Not all nations exhibit these administrative levels. In most cases, administrative_area_level_1 short names will closely match ISO 3166-2 subdivisions and other widely circulated lists; however this is not guaranteed as our geocoding results are based on a variety of signals and location data.

for some strange reason, this appears to be broken in non-US locations. On my NC-based VPN, the game works, but when I turn it off and I'm using a German IP, the data coming back from the Google maps API is different (for some very odd reason). Not able to reproduce this; the problem exists regardless of whether I'm behind a US-based VPN or not - I'm not exactly sure what was going on, but in any case I was seeing the two-character short_name values at some point after I initially saw the problem in question.

silentDjay commented 6 years ago

Somebody already told Google about the problem and it's been logged internally: https://issuetracker.google.com/issues/116170935

and the issue also affects non-us states. There is an issue with non-US states that has been marked as a duplicate of the one above: https://issuetracker.google.com/issues/115693047

silentDjay commented 5 years ago

Although the issue in question isn't yet marked as fixed by Google (https://issuetracker.google.com/issues/116170935), the problem no longer exists in the geocoding calls that Mapstery is making. Closing this.