private void restProvider_SearchLocationCompleted(object sender, BingRestSearchLocationCompletedEventArgs e)
        {
            double[]     bbox = e.Locations[0].BoundingBox;
            LocationRect rect = new LocationRect(new Location(bbox[2], bbox[1]), new Location(bbox[0], bbox[3]));

            this.radMap.SetView(rect);

            foreach (Telerik.Windows.Controls.DataVisualization.Map.BingRest.Location location in e.Locations)
            {
                var    coordinates = location.GeocodePoints[0].Coordinates;
                double latitude    = coordinates[0];
                double longitude   = coordinates[1];
                MessageBox.Show(string.Format("Longitude: {0}, Latitude: {1}, Address: {2}", longitude, latitude, location.Address.FormattedAddress));
            }
        }
示例#2
0
        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;
            }
        }