如何在WindowsPhone8.1通用应用程序中获取街道地址地理定位?我的WindowsPhone用户将在文本字段中输入街道地址。我需要获取该地址字符串的地理位置,以便稍后我可以计算该地理位置的距离和手机的当前地址。所以,我的问题是:如何在WindowsPhone8.1通用应用程序中获取街道地址的地理位置?我在这个stackoverflow答案中找到了一个解决方案,但是,它适用于旧的Silverlight应用程序,而不是我当前使用的新的UniversalStore应用程序API。下面是获取地理位置并启动默认地图路线的代码这里是MSDN链接上面是C#学习教程:如何在WindowsPhone8.1UniversalApp中获取街道地址的地理位置?如果分享的内容对你有用,需要进一步了解C#学习教程,希望你多多关注——//附近位置作为查询提示。BasicGeopositionqueryHint=newBasicGeoposition();//达拉斯查询提示。纬度=32.7758;queryHint.Longitude=-96.7967;GeopointhintPoint=newGeopoint(queryHint);MapLocationFinderResultresult=awaitMapLocationFinder.FindLocationsAsync("street,city,statezip",hintPoint,3);if(result.Status==MapLocation.Success){if(result.Locations!=null&&result.Locations.Count>0){Uriuri=newUri("ms-drive-to:?destination.latitude="+结果.Locations[0].Point.Position.Latitude.ToString()+"&destination.longitude="+result.Locations[0].Point.Position.Longitude.ToString()+"&destination.name="+"我的家");varsuccess=awaitWindows.System.Launcher.LaunchUriAsync(uri);}}本文收集自网络,不代表立场。如涉及侵权,请点击右侧联系管理员删除。如有转载请注明出处:
