c# Windows Phone 8.1 如何获取地理坐标对象
c# Windows Phone 8.1 How to get Geocoordinate object
我需要用我的经度和纬度获取地理坐标对象。无法通过 new() 获取地理坐标
https://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.geolocation.geocoordinate
例如,一种方法是此代码
var locator = new Geolocator();
locator.DesiredAccuracyInMeters = 50;
var position = await locator.GetGeopositionAsync();
Geocoordinate Coordinate = position.Coordinate;
获取GPS坐标。但我需要用我的经度和纬度进行地理坐标。
您无法创建 Geocoordinate
,因为它是密封的只读 class。相反,绑定到 Geopoint
,它包含您需要的所有位置信息,而没有 Geocoordinate
具有的位置服务包袱。
public Geopoint Location { get; set; }
Maps:MapControl.Location="{Binding Location}"
我需要用我的经度和纬度获取地理坐标对象。无法通过 new() 获取地理坐标 https://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.geolocation.geocoordinate 例如,一种方法是此代码
var locator = new Geolocator();
locator.DesiredAccuracyInMeters = 50;
var position = await locator.GetGeopositionAsync();
Geocoordinate Coordinate = position.Coordinate;
获取GPS坐标。但我需要用我的经度和纬度进行地理坐标。
您无法创建 Geocoordinate
,因为它是密封的只读 class。相反,绑定到 Geopoint
,它包含您需要的所有位置信息,而没有 Geocoordinate
具有的位置服务包袱。
public Geopoint Location { get; set; }
Maps:MapControl.Location="{Binding Location}"