首页 > asp.net > 如何使用maps.google.ae(阿联酋地图)中的地图而不是maps.google.com中的地图

如何使用maps.google.ae(阿联酋地图)中的地图而不是maps.google.com中的地图 (How to use the map from maps.google.ae (map for UAE) instead of map from maps.google.com)

问题

我想在我的ASP.net应用程序中使用以下谷歌地图API片段来检索用户所选点的纬度和经度。

此代码显示的地图与https://www.google.com/maps/@25.3812696,58.4464073,6z相同。而不是'.com'的地图,我想从'.ae'看到地图。

这是与https://www.google.ae/maps/@25.3812696,58.4464073,6z相同的地图。这两张地图均来自Google的国家/地区。有没有办法实现这个目标?

<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>

感谢和问候,

解决方法

我玩了一下javascript地图一点点,并想通过添加&languange=ae到最后src,你可以有类似的效果。请查看jsfiddle 的示例,并尝试在代码中添加语言src="http://maps.googleapis.com/maps/api/js?sensor=false&language=ae"。希望对你有用。

问题

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,

解决方法

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.

相似信息