windows-phone-8 – windows phone 8 Map API GeocodeQuery.Sear
发布时间:2020-12-14 05:42:19 所属栏目:Windows 来源:网络整理
导读:我使用 GeocodeQuery来查找搜索词的坐标. // Get your current positionvar myPosition = await new Geolocator().GetGeopositionAsync(TimeSpan.FromMinutes(1),TimeSpan.FromSeconds(10));// Define searchvar geoQuery = new GeocodeQuery();geoQuery.Sea
我使用
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使用系统语言来执行搜索.如果您将手机语言更改为中文,则应获得结果.
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- npm和cnpm (windows)安装步骤
- 使用Windows Azure Service Bus进行邮件路由
- Windows – IIS 7.5 – 无法在一个IP地址下配置两个SSL证书
- windows – “编辑”不是cmd.exe中的有效命令?
- Windows是否有任何内置的实用程序来编码/解码URL?
- .net – 如何导出CIL DLL中的方法,以便本地程序可以调用它?
- windows-server-2003 – 对于Windows nslookup,“默认服务器
- windows-server-2003 – 如何在不提示管理员密码的情况下从
- Windows 2008 R2 开启磁盘清理的方法
- Wix升级进入维护模式,永远不会升级
推荐文章
站长推荐
热点阅读