Windows Phone 8에서 응용 프로그램을 수행 중이며 GPS 좌표에서 지구, 타운 지구 또는 마을 이름을 반환하는 기능이 필요합니다. 그가 인터넷에 연결하지 않고 전화지도를보고 가면 가장 좋을 것입니다. 귀하의 답변과 시간에 감사드립니다.
/// <summary>
/// Returns the name of the village
/// </summary>
/// <param name="geoCoordinate">GPS coordinate</param>
/// <returns>returns the name of the village</returns>
string NameOfPlace(GeoCoordinate geoCoordinate)
{
}
ReverseGeocodingQuery 를 사용 하여 현재 위치에 대한 정보를 얻을 수 있지만 오프라인 에서는 작동 하지 않습니다 .
정보를 얻으려면 다음 코드 줄을 사용하십시오.
string NameOfPlace = "";
ReverseGeocodeQuery MyReverseGeocodeQuery = null;
void GetNameOfPlace(GeoCoordinate geoCoordinate)
{
MyReverseGeocodeQuery = new ReverseGeocodeQuery();
MyReverseGeocodeQuery.GeoCoordinate = new GeoCoordinate(geoCoordinate.Latitude, geoCoordinate.Longitude);
MyReverseGeocodeQuery.QueryCompleted += ReverseGeocodeQuery_QueryCompleted;
MyReverseGeocodeQuery.QueryAsync();
}
private void ReverseGeocodeQuery_QueryCompleted(object sender, QueryCompletedEventArgs<IList<MapLocation>> e)
{
var result = e.Result[0];
NameOfPlace = result.Information.Address.Street + " " + result.Information.Address.City + " " + result.Information.Address.Country;
}
GeoCoordinate 48.774010, 9.224396의 결과는 Zur Staibhöhe Stuttgart Germany가 됩니다.
Btw .: 전화의 현지화가 사용되고 있습니다 (언어가 독일어 인 경우 결과는 Zur Staibhöhe Stuttgart Deutschland ).
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다