I use Google Maps API to get city name in 2 different languages by users' coordinates. Before version 3.5 of the API I was able to use language option in geocoder's request, but since June 8, 2011 this option is removed.
Can someone give me any idea how can I get the city name in two or more different languages with maps' geocoder?
I included the js script with language option something like this - http://maps.google.com/maps/api/js?sensor=false&language=ja
Google Maps API v3.5 Geocoder language option
Asked Answered
Can you provide a link to a page with code that isn't working the way you expect? It will make things easier for someone if they can look at what you have and play with it to figure out if something is wrong. –
Thermocouple
My project is still in development and currently it's not online –
Hemitrope
It seems that the feature has been removed:
We made this change to simplify the API. The Geocoder uses the browser's preferred language, or language specified when loading the API" (Source)
It still work if used directly:
@fuchs I can make neither AJAX request nor curl to get and fetch geocoding results. It says "REQUEST_DENIED" on status, but only works through browser. How did you make this work? –
Antwanantwerp
@InspiredJW I use server side api to get the geocoding results in the language I need.
$gmaps_url = "http://maps.googleapis.com/maps/api/geocode/json?address=" . $address . "&sensor=false®ion=" .COUNTRY_CODE. "&language=" . $lang; $result = file_get_contents( $gmaps_url ); $gmaps_data = json_decode($result);
–
Hemitrope @fuchs I have resolved problem through making server-side api wrapper by myself. Simply call HTTP request through my server but not by XHR. –
Antwanantwerp
© 2022 - 2024 — McMap. All rights reserved.