【发布时间】:2014-07-04 17:17:00
【问题描述】:
我正在尝试从 Windows Phone 8.1 中的地理位置获取 CivicAddress
我尝试过使用以下代码:
// Get Current Location
var geolocator = new Geolocator();
geolocator.DesiredAccuracyInMeters = 100;
var position = await geolocator.GetGeopositionAsync();
// Get Country
var country = position.CivicAddress.Country;
当 CivicAddress 字段为空时抛出 NullReferenceException。我了解 Windows 8 没有提供 CivicAddress 提供程序。我想检查 Windows Phone 8.1 是否是这种情况如果是这样,我如何获取/编写 CivicAddress 提供程序?
【问题讨论】:
标签: c# windows-phone-8 geolocation windows-runtime windows-phone-8.1