Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// <summary>
- /// Get Location name by lat and long
- /// </summary>
- private async void getLocationName()
- {
- Geoposition geoposition = await getLocation(1);
- List<MapLocation> locations;
- ReverseGeocodeQuery query = new ReverseGeocodeQuery();
- query.GeoCoordinate = new GeoCoordinate(geoposition.Coordinate.Latitude, geoposition.Coordinate.Longitude);
- query.QueryCompleted += (s, e) =>
- {
- if (e.Error == null && e.Result.Count > 0)
- {
- locations = e.Result as List<MapLocation>;
- Model.LocationName = locations[0].Information.Address.Street;
- // Do whatever you want with returned locations.
- // e.g. MapAddress address = locations[0].Information.Address;
- }
- };
- query.QueryAsync();
- }
Advertisement
Add Comment
Please, Sign In to add comment