Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/302.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在UWP中获得本地化的MapLocation?_C#_Uwp_Bing Maps_Uwp Maps - Fatal编程技术网

C# 如何在UWP中获得本地化的MapLocation?

C# 如何在UWP中获得本地化的MapLocation?,c#,uwp,bing-maps,uwp-maps,C#,Uwp,Bing Maps,Uwp Maps,我使用了一个简单的方法,为我返回地图位置,但我只想得到英文地址 public static async Task<MapLocation> ResolveLocationForGeopoint(Geopoint geopoint) { MapLocationFinderResult result = await MapLocationFinder.FindLocationsAtAsync(geopoint); if (result.Status == MapLoca

我使用了一个简单的方法,为我返回地图位置,但我只想得到英文地址

public static async Task<MapLocation> ResolveLocationForGeopoint(Geopoint geopoint)
{
    MapLocationFinderResult result = await MapLocationFinder.FindLocationsAtAsync(geopoint);

    if (result.Status == MapLocationFinderStatus.Success)
    {
        if (result.Locations.Count != 0)
            // Check if the result is really valid
            if (result.Locations[0].Address.Town != "")
                return result.Locations[0];
    }
    return null;
}
但它似乎不起作用

如何从该方法获取本地化字符串

方法现在不提供指定返回地址中使用的语言的机制。它始终自动使用Windows显示语言。在大多数情况下,和都是当地文化的产物。例如,如果您请求在法国的位置,街道名称将以法语本地化

作为一种解决方法,我们可以使用提供RESTAPI的。对于
FindLocationsAtAsync
方法,我们可以使用如下方法:

http://dev.virtualearth.net/REST/v1/Locations/47.64054,-122.12934?c=en-US&key=BingMapsKey

此外,欢迎您在上提交功能请求以请求此功能。

可能城市名称或位置使用西里尔字母,您为什么要更改它?因为我在匈牙利使用地图,任何匈牙利城市名称中都没有西里尔字母。:D它只显示系统语言中的每个名称。
http://dev.virtualearth.net/REST/v1/Locations/47.64054,-122.12934?c=en-US&key=BingMapsKey