windows-phone-8 – windows phone 8 Map API GeocodeQuery.SearchTerm不是英语什么都没有

前端之家收集整理的这篇文章主要介绍了windows-phone-8 – windows phone 8 Map API GeocodeQuery.SearchTerm不是英语什么都没有前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我使用 GeocodeQuery来查找搜索词的坐标.

// 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();

它运作良好!我成功地获得了一些关于“台北”的位置,

但是,当我在传统的中文“台北”搜索“台北”时,

我在回调函数geoQuery.QueryCompleted中没有得到任何东西,

e.Result.Count = 0

我该如何处理不同语言的GeocodeQuery搜索
谢谢你的帮助!

解决方法

geocodequery使用系统语言来执行搜索.如果您将手机语言更改为中文,则应获得结果.

猜你在找的Windows相关文章