を試してみてください。最初私は位置の座標(緯度と経度)を取得するためにロケーションAPIライブラリを使用する経度と緯度
http://maps.googleapis.com/maps/api/geocode/json?latlng=latitiude,longitude&sensor=true
に基づいて、位置の情報または詳細情報を取得するために、Googleの逆ジオロケーションを使用して
次いで
Geolocator geolocator = new Geolocator();
geolocator.DesiredAccuracyInMeters = 50;
try
{
// Request the current position
Geoposition geoposition = await geolocator.GetGeopositionAsync(
maximumAge: TimeSpan.FromMinutes(5),
timeout: TimeSpan.FromSeconds(10)
);
string latitude = geoposition.Coordinate.Latitude.ToString("0.00");
string longitude = geoposition.Coordinate.Longitude.ToString("0.00");
}
catch (Exception ex)
{
if ((uint)ex.HResult == 0x80004004)
{
// the application does not have the right capability or the location master switch is off
MessageBox.Show("Location is disabled in phone settings.", "Can't Detect Location", MessageBoxButton.OK);
}
//else
{
// something else happened acquring the location
System.Diagnostics.Debug.WriteLine(ex.Message);
}
}
すなわち緯度が60であると経度は、JSONの結果から、60
http://maps.googleapis.com/maps/api/geocode/json?latlng=60,60&sensor=true
であれば、あなたは国のロングとショートを取得することができるようになります名。
RegionInfo.CurrentRegion.DisplayNameはどうなっていますか? –
RegionInfo.CurrentRegion.DisplayNameを使用して "United States"という同じ結果が得られます – jade
実際のデバイスでテストを試しましたか? –