This example demonstrates how to provide the capability to search for a specific place on a map using the Search panel.
To enable search 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 via the BingMapDataProvider.BingKey property.
The Search panel appears automatically (since the BingSearchDataProvider.ShowSearchPanel property is set to true by default) after you connect to the Bing Search web service.
Note that if you run this sample as is, you will get a warning message informing that the specified Bing Maps key is invalid. To learn about how to register a Bing Maps account and create a key for it, refer to the How to: Get a Bing Maps Key tutorial.