private void SearchByArea(SearchArea area) { int getAllPollygons = area.GetAllPolygons ? 1 : 0; int getMetadata = area.GetEntityMetadata ? 1 : 0; string searchURL = string.Format(GeodataHelper.BaseURL, area.Location.ToString(), area.LevelOfDetail, area.EntityType, getAllPollygons, getMetadata, area.Culture, area.UserRegion, area.BingKey); WebClient client = new WebClient(); client.DownloadStringCompleted += Client_DownloadStringCompleted; client.DownloadStringAsync(new Uri(searchURL)); }
private void BingProvider_SearchLocationCompleted(object sender, BingRestSearchLocationCompletedEventArgs e) { if (e.Locations.Count() == 0) { return; } Telerik.Windows.Controls.DataVisualization.Map.BingRest.Location foundLocation = e.Locations[0]; Location mapLocation = new Location(foundLocation.Point.Coordinates[0], foundLocation.Point.Coordinates[1]); this.lastSearchLoaction = mapLocation; SearchArea area = new SearchArea(foundLocation.Name, mapLocation, this.bingProvider.ApplicationId, "'" + foundLocation.EntityType + "'"); this.SearchByArea(area); if (this.searchBarPanel.IsEnabled == false) { this.searchBarPanel.IsEnabled = true; } }