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