Skip to main content

DevExpress v25.1 Update — Your Feedback Matters

Our What's New in v25.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

BingSearchDataProvider Class

OBSOLETE

This class is obsolete. Microsoft deprecated Bing Maps on June 30th, 2025. For alternative providers, see https://www.devexpress.com/bing-maps-winforms.

The class that is used to send requests to the Bing Maps Search service.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v25.1.dll

NuGet Package: DevExpress.Win.Map

#Declaration

[Obsolete("This class is obsolete. Microsoft deprecated Bing Maps on June 30th, 2025. For alternative providers, see https://www.devexpress.com/bing-maps-winforms.")]
[PreferableMember("BingSearchDataProvider", "", "")]
public class BingSearchDataProvider :
    BingMapDataProviderBase,
    ISearchPanelRequestSender

#Remarks

The Bing Search Data provider is represented by the BingSearchDataProvider object that can be accessed via the InformationLayer.DataProvider property.

Important

On May 21, 2024, Microsoft announced that Bing Maps for Enterprise and its API will be discontinued. Azure Maps will be a single unified enterprise mapping platform available from Microsoft.

To obtain and display map data from Azure Maps, we implemented the following providers:

For information on how to migrate your app from Bing Maps to Azure Maps, see the following help topic: Migrate from Bing Maps to Azure Maps Providers.

If you already have a Bing Maps for Enterprise license, you can keep using the current API. You must transition to the new API by June 30, 2025 (for free/basic licenses) or June 30, 2028 (for enterprise licenses). New licenses will no longer be available after June 30, 2025. Bing Maps will not work with our map controls without a license after that date.

To get access to the search options of the Bing Search Data provider, use the BingSearchDataProvider.SearchOptions property.

If you wish to see the search results in a search panel, use the MapSearchPanelOptions.Visible property.

The Search(string keyword) method is used to find a particular location by its name.

The Search(BingAddress address) method is used to find places by their addresses.

The results will be returned using the SearchRequestResult.SearchResults property of the BingSearchDataProvider.SearchCompleted event arguments’ SearchCompletedEventArgs.RequestResult property.

#Example

This example demonstrates how to allow users to search for a specific place on a map using the Search panel.

To enable searching in the map control, do the following.

  • Create an InformationLayer and add it to the map.
  • Create an instance of the BingSearchDataProvider and assign it to the InformationLayer.DataProvider property.
  • Specify the Bing Maps key using the BingMapDataProvider.BingKey property.

The Search panel appears automatically (since the MapSearchPanelOptions.Visible property value is true by default).

using DevExpress.XtraMap;
using System.Windows.Forms;

namespace ConnectBingSearchProvider {
    public partial class Form1 : Form {
        const string bingKey = "YOUR BING KEY HERE";

        InformationLayer SearchLayer { 
            get {
                return (InformationLayer)mapControl1.Layers["SearchLayer"];
            }
        }

        public Form1() {
            InitializeComponent();

            BingSearchDataProvider searchProvider = new BingSearchDataProvider() { 
                BingKey = bingKey 
            };

            searchProvider.SearchOptions.ResultsCount = 5;

            SearchLayer.DataProvider = searchProvider;
        }      
    }
}
See Also