google maps - Inconsistent administrative_area_level_1 geocode for same city (accented) -
my simple app has been working quite until client reported bug mentioned in title. google return sometime accent-removed result :
{ "long_name" : "hanoi", "short_name" : "hanoi", "types" : [ "administrative_area_level_1", "political" ] }
and accented one:
{ "long_name" : "hà nội", "short_name" : "hà nội", "types" : [ "administrative_area_level_1", "political" ] }
i have tried applying api key (with language = french) no luck.
as result, logic group address city , district failed!
btw, guys have hints automatically group address district, city, country using data google geocode or other provider
thank you
if want french language of resulting data have mention in language parameter of request.
however, group addresses district city , country can use following api request.
https://maps.googleapis.com/maps/api/geocode/json?address=winnetka&language=fr&key=api_key
in response district administrative_area_level_2 states administrative_area_level_1 while country country parameter.
i posting json above request.
{ results: [1] 0: { address_components: [5] 0: { long_name: "winnetka" short_name: "winnetka" types: [2] 0: "locality" 1: "political" - }- 1: { long_name: "new trier" short_name: "new trier" types: [2] 0: "administrative_area_level_3" 1: "political" - }- 2: { long_name: "comté de cook" short_name: "comté de cook" types: [2] 0: "administrative_area_level_2" 1: "political" - }- 3: { long_name: "illinois" short_name: "il" types: [2] 0: "administrative_area_level_1" 1: "political" - }- 4: { long_name: "États-unis" short_name: "us" types: [2] 0: "country" 1: "political" - }- - formatted_address: "winnetka, illinois, États-unis" geometry: { bounds: { northeast: { lat: 42.1282269 lng: -87.71081629999999 }- southwest: { lat: 42.0886089 lng: -87.7708629 }- }- location: { lat: 42.10808340000001 lng: -87.735895 }- location_type: "approximate" viewport: { northeast: { lat: 42.1282269 lng: -87.71081629999999 }- southwest: { lat: 42.0886089 lng: -87.7708629 }- }- }- place_id: "chijw8va5tned4gry91ng47qy3q" types: [2] 0: "locality" 1: "political" - }- - status: "ok" }
Comments
Post a Comment