我使用
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搜索?
谢谢你的帮助!