Search code examples
asp.netgoogle-mapsgoogle-maps-api-2

How to use the map from maps.google.ae (map for UAE) instead of map from maps.google.com


I would like to use the following google map API snippet in my ASP.net application to retrieve the latitude and longitude of the selected point by the user.

This code show the map same as https://www.google.com/maps/@25.3812696,58.4464073,6z. Instead of the map from '.com', I want to see the map from '.ae'.

That is the map same as https://www.google.ae/maps/@25.3812696,58.4464073,6z. Both maps are from google based on the country. Is there any way to achieve this ?

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Location Tracking</title>
</head>
<body>
  <script type="text/javascript"src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
    window.onload = function () {
        var mapOptions = {
            center: new google.maps.LatLng(24,  54),
            zoom: 14,
            mapTypeId: google.maps.MapTypeId.ROADMAP

        };
        var infoWindow = new google.maps.InfoWindow();
        var latlngbounds = new google.maps.LatLngBounds();
        var map = new google.maps.Map(document.getElementById("dvMap"), mapOptions);
        google.maps.event.addListener(map, 'click', function (e) {
            //this part will return the coordinates to the parent page
            alert("Latitude: " + e.latLng.lat() + "\r\nLongitude: " + e.latLng.lng());
        });
    }
</script>
<div id="dvMap" style="width: 500px; height: 500px">
</div>

With Thanks and Regards,


Solution

  • I played around with javascript map for a little bit and figured out that by adding &languange=ae at the end of the src, you can have a similar effect. Please check out the example for jsfiddle, and try to add language to your code src="http://maps.googleapis.com/maps/api/js?sensor=false&language=ae". Hope that works for you.