Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google maps change language dynamically (asynchronous loading)

Is there any way to load language in the map options field?
Something like this:

var mapOptions = {
  center : new google.maps.LatLng(43.97918, 53.716647),
  zoom : 10,
  mapTypeId : google.maps.MapTypeId.ROADMAP,
  language : 'fr'
};
like image 341
user1782634 Avatar asked Dec 05 '12 10:12

user1782634


People also ask

How do I change the navigation language on Google Maps?

Change your navigation language 1 On your Android phone or tablet, open the Google Maps app . 2 Tap your profile picture or initial Settings. 3 Tap Navigation settings Voice. 4 Choose a voice and language. More ...

How do I change the country domain on Google Maps?

You can change a country domain or language by using Google Maps. Google Maps automatically shows place names in a country’s local languages, but on your computer, you can change your map language. On your computer, open Google Maps. In the top left, click Menu . Choose Language. Select a language.

How to find a place on Google Maps in another language?

Find Google Maps in another language 1 On your computer, open Google Maps. 2 In the top left, click Menu . 3 Choose Language. 4 Select a language.Map labels will be shown in your country’s local language, but you’ll find place information in the language you selected. 5 Optional: Learn how to change your language for all Google products.

Is the Maps API loaded synchronously or asynchronous?

In this example, the Maps API is loaded synchronously. We omitted the async attribute from the script tag that loads the API, and we also omitted the callback parameter.


2 Answers

Found it!

Using google script https://www.google.com/jsapi

google.load('maps', '3.x', { 'other_params' : 'sensor=true&libraries=geometry&language=' + langCode, 'callback' : mapsLoadeds });

mapsLoaded executes the common code for creating maps.

like image 116
user1782634 Avatar answered Sep 21 '22 07:09

user1782634


You can use the language parameter in the url of google maps :

<script src="http://maps.googleapis.com/maps/api/js?sensor=false&language=ja">
</script>
like image 29
Alexandre Ardhuin Avatar answered Sep 23 '22 07:09

Alexandre Ardhuin