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