Hide

Right-to-Left Languages

View this example full screen.

JavaScript
function initMap() {
  var cairo = {lat: 30.064742, lng: 31.249509};

  var map = new google.maps.Map(document.getElementById('map'), {
    scaleControl: true,
    center: cairo,
    zoom: 10
  });

  var infowindow = new google.maps.InfoWindow;
  infowindow.setContent('<b>القاهرة</b>');

  var marker = new google.maps.Marker({map: map, position: cairo});
  marker.addListener('click', function() {
    infowindow.open(map, marker);
  });
}
JavaScript + HTML
<!DOCTYPE html>
<html dir="rtl">
  <head>
    <title>Right-to-Left Languages</title>
    <meta charset="utf-8">
    <style>
      html, body {
        height: 100%;
        margin: 0;
        padding: 0;
      }
      #map {
        height: 100%;
      }
    </style>
  </head>
  <body>
    <div id="map"></div>
    <script>

function initMap() {
  var cairo = {lat: 30.064742, lng: 31.249509};

  var map = new google.maps.Map(document.getElementById('map'), {
    scaleControl: true,
    center: cairo,
    zoom: 10
  });

  var infowindow = new google.maps.InfoWindow;
  infowindow.setContent('<b>القاهرة</b>');

  var marker = new google.maps.Marker({map: map, position: cairo});
  marker.addListener('click', function() {
    infowindow.open(map, marker);
  });
}

    </script>
    <script async defer
        src="https://maps.googleapis.com/maps/api/js?signed_in=true&language=ar&callback=initMap"></script>
  </body>
</html>

Send feedback about...

Google Maps JavaScript API
Need help? Visit our support page.