There is a website, how to make it so that if a user visits the site with the example.com extension, he will see a map in English, and if on example.ru, then in Russian

google.maps.event.addDomListener(window, 'load', init); function init() { // Basic options for a simple Google Map // For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions var mapOptions = { // How zoomed in you want the map to start at (always required) zoom: 18, // The latitude and longitude to center the map (always required) center: new google.maps.LatLng(55.734670, 37.604845), // Disables the default Google Maps UI components disableDefaultUI: true, scrollwheel: false }; // Get the HTML DOM element that will contain your map // We are using a div with id="map" seen below in the <body> var mapElement = document.getElementById('map'); // Create the Google Map using out element and options defined above var map = new google.maps.Map(mapElement, mapOptions); // Custom Map Marker Icon - Customize the map-marker.png file to customize your icon var image = 'images/marker-map.png'; var myLatLng = new google.maps.LatLng(55.734670, 37.604845); var beachMarker = new google.maps.Marker({ position: myLatLng, map: map, icon: image }); } 

    1 answer 1

    Google Maps API by default takes localization information from browser settings.

    However, if you want to change the language, you can add the optional language parameter to the <script> when the API is connected.

    For example (for Japanese) :

     <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&language=ja" type="text/javascript"> </script> 

    More information about localization can be found in the documentation .