1
我目前有下列方法被选中时选择一个位置。搜索经纬度bing地图 - c#
而不是传递城市名称作为参数搜索,我想通过使用纬度和经度搜索位置。
我将检索所选城市的经度和纬度。
我需要如何修改此代码才能获得此代码?
谢谢
private void xgrdLocation_SelectedItemChanged(object sender, SelectedItemChangedEventArgs e)
{
this.Cursor = Cursors.AppStarting;
lblFooter.Content = "Searching ...";
pushpin = new MapPushpin();
if (xgrdLocation.SelectedItem != null)
{
City selectedCity = xgrdLocation.SelectedItem as City;
//GeocodeService.Location point = new GeocodeService.Location();
pushpin.Text = selectedCity.CityName;
searchDataProvider.Search(pushpin.Text);
//lblSelectedCity.Content = selectedCity.CityName;
}
}
[位置API](https://msdn.microsoft.com/en-gb/library/ff701715.aspx)和[可能相关的现有SO帖子](http://stackoverflow.com/questions/5698014/visual -studio-2010-bing-map-location-finder-by-longitude-latitude) – sab669
这是什么类型的项目? WPF? ASP.NET? – Greg
@greg wpf。谢谢 – Walking