문제

I use GeocodeQuery to look up the coordinates of a search term.

// Get your current position
var myPosition = await new Geolocator().GetGeopositionAsync(TimeSpan.FromMinutes(1), TimeSpan.FromSeconds(10));

// Define search
var geoQuery = new GeocodeQuery();
geoQuery.SearchTerm = "Taipei";
geoQuery.GeoCoordinate = new GeoCoordinate(myPosition.Coordinate.Latitude, myPosition.Coordinate.Longitude);
geoQuery.QueryCompleted += (s, e) => {
  if (e.Error == null && e.Result.Count > 0) {
    // e.Result will contain a list of coordinates of matched places.
    // You can show them on a map control , e.g.
    myMap.Center = e.Result[0].GeoCoordinate;
    myMap.ZoomLevel = 2;
  }
}
geoQuery.QueryAsync();

It works well! I got some location about "Taipei" successfully,

But, when I search "Taipei" in tranditional chinese "台北",

I got nothing in callback function geoQuery.QueryCompleted,

e.Result.Count = 0

How should I handle the GeocodeQuery search in different language?? Thanks for any help!

도움이 되었습니까?

해결책

The geocodequery use the system language to perform search. If you change your phone language to Chinese you should get results.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top