2012-12-05 1 views
1

가능한 중복 :
How to get Address name of GPS coordinate with wp7위치 세부 8

나는 WP8 application.In 내 응용 프로그램을 developoing하고 난 특정 위치 등의 정보를 얻으려면 geocoordinates에서 위치 이름. 장치의 현재 GPS 위치를 얻을 수 있습니다. 그러나 그것은 단지 지구 좌표를 제공합니다. geocoordinates에서 위치 세부 정보를 제공하는 서비스가 있습니까? 도와주세요.

+1

[어떻게 얻을 wp7와 GPS 좌표의 주소 이름] (http://stackoverflow.com/questions/9294474/how-to-get-address-name-of-gps-coordinate-with-wp7) –

+0

이것은 중복되지 않습니다. 이전 질문은 WP7을 대상으로 한 것이므로 WP8은 역 지오 코드 조회를 수행하는 새롭고 향상된 방법을 제공합니다. @JustinAngels 아래 답변을 참조하십시오. –

답변

2

예, 특정 위치 세부 정보를 가져 오기 위해 bing API를 사용할 수 있습니다. http://msdn.microsoft.com/en-us/library/ff701722.aspx http://stackoverflow.com/questions/9109996/getting-location-name-from-longitude-and-latitude-in-bingmap

희망 thsi 도움이됩니다.

켈빈

+0

그것도 작동 .. 감사합니다 – Aneesh

6

찾고있는 것은 역 지오 코딩입니다. 지오 코디네이트를 주소로 변환.

이전에 언급했듯이 WP7에서 Google과 Bing을 사용하여이를 달성 할 수 있습니다. Windows phone 8에서 Geocoding 및 Reverse Geocoding은 프레임 워크의 일부로 지원됩니다. GeoCoding at this Nokia intro article ('지오 코딩'아래) 및 더 포괄적 인 개요 at this other Nokia article에 대한 개요를 읽을 수 있습니다. 여기

는 주소로 좌표로 변환 역 지오 코딩의 예 :

private void Maps_ReverseGeoCoding(object sender, RoutedEventArgs e) 
{ 
    ReverseGeocodeQuery query = new ReverseGeocodeQuery() 
    { 
     GeoCoordinate = new GeoCoordinate(37.7951799798757, -122.393819969147) 
    }; 
    query.QueryCompleted += query_QueryCompleted; 
    query.QueryAsync(); 
} 

void query_QueryCompleted(object sender, QueryCompletedEventArgs<IList<MapLocation>> e) 
{ 
    StringBuilder sb = new StringBuilder(); 
    sb.AppendLine("Ferry Building Geocoding results..."); 
    foreach (var item in e.Result) 
    { 
     sb.AppendLine(item.GeoCoordinate.ToString()); 
     sb.AppendLine(item.Information.Name); 
     sb.AppendLine(item.Information.Description); 
     sb.AppendLine(item.Information.Address.BuildingFloor); 
     sb.AppendLine(item.Information.Address.BuildingName); 
     sb.AppendLine(item.Information.Address.BuildingRoom); 
     sb.AppendLine(item.Information.Address.BuildingZone); 
     sb.AppendLine(item.Information.Address.City); 
     sb.AppendLine(item.Information.Address.Continent); 
     sb.AppendLine(item.Information.Address.Country); 
     sb.AppendLine(item.Information.Address.CountryCode); 
     sb.AppendLine(item.Information.Address.County); 
     sb.AppendLine(item.Information.Address.District); 
     sb.AppendLine(item.Information.Address.HouseNumber); 
     sb.AppendLine(item.Information.Address.Neighborhood); 
     sb.AppendLine(item.Information.Address.PostalCode); 
     sb.AppendLine(item.Information.Address.Province); 
     sb.AppendLine(item.Information.Address.State); 
     sb.AppendLine(item.Information.Address.StateCode); 
     sb.AppendLine(item.Information.Address.Street); 
     sb.AppendLine(item.Information.Address.Township); 
    } 
    MessageBox.Show(sb.ToString()); 
} 

나는 다음과 같은 메시지 박스를 얻을 내 WP8에이 코드를 실행하면 :

MEssageBox showing details for the ferry building

+0

''Query.QueryAsync(); '문에서'System.UnauthorizedAccessException' 및'System.Reflection.TargetInvocationException' 예외가 발생합니다. 이것의 가능한 원인은 무엇입니까? – Mayank

+0

@Mayank 앱이 여러 통화를하고 있는지 확인하고 한 번에 하나의 통화 만 할 수 있으며 도움이 되길 바랍니다. –

관련 문제