问题
Im trying to implement a button which fills after click
- Latitude
- Longitude
- Street
- Streetnumber
- Postalcode
- City
myGeoposition.CivicAddress. gives me City and Postalcode
myGeoposition.Coordinate. gives me the Lati/Longitude
where do I get the rest?
I am using a Map-Control (not bing map!) from: Microsoft.Phone.Maps.Controls;assembly=Microsoft.Phone.Maps
try
{
Geolocator geolocator = new Geolocator();
geolocator.DesiredAccuracy = PositionAccuracy.Default;
IAsyncOperation<Geoposition> locationTask = null;
try
{
locationTask = geolocator.GetGeopositionAsync(TimeSpan.FromMinutes(1), TimeSpan.FromSeconds(15));
Geoposition myGeoposition = await locationTask;
Geocoordinate myGeocoordinate = myGeoposition.Coordinate;
GeoCoordinate myGeoCoordinate =
CoordinateConverter.ConvertGeocoordinate(myGeocoordinate);
回答1:
You can use the ReverseGeocodeQuery class to get information from a location:
MapAddress address;
ReverseGeocodeQuery query = new ReverseGeocodeQuery();
query.GeoCoordinate = myGeoCoordinate;
query.QueryCompleted += (s, e) =>
{
if (e.Error != null)
return;
address = e.Result[0].Information.Address;
};
query.QueryAsync();
来源:https://stackoverflow.com/questions/18979823/windows-phone-8-get-current-address-data-from-your-current-location