1

我正在使用一种简单的方法为我返回地图位置,但我只想用英文获取该地址。

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 语言是俄语时,它会返回 cirillic 字符。

我试图覆盖应用程序语言:

ApplicationLanguages.PrimaryLanguageOverride = "en";

但是好像不行。。。

我怎样才能从这个方法中得到本地化的字符串?

4

1 回答 1

1

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

作为一种解决方法,我们可以使用Bing Maps REST 服务,它提供了可以指定Culture Parameter的 REST API 。对于FindLocationsAtAsync方法,我们可以使用按点查找位置,如下所示:

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

此外,欢迎您在WPDev 用户语音上提交功能请求以请求此功能。

于 2016-10-07T09:31:49.990 回答