wpf-17981-controls-and-libraries-map-control-examples-gis-data-searching-how-to-create-a-custom-search-panel.md
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: DevExpress Map Control for WPF: Migrate from Bing Maps to Azure Maps.
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.
This example demonstrates how to create a custom search panel.
BingSearchDataProvider object to the InformationLayer.DataProvider property.<dxm:InformationLayer.DataProvider>
<dxm:BingSearchDataProvider x:Name="searchProvider"
ShowSearchPanel="False"
BingKey="{Binding Source={StaticResource bingKey}}"
SearchCompleted="searchProvider_SearchCompleted">
<dxm:BingSearchDataProvider.SearchOptions>
<dxm:BingSearchOptions x:Name="options"
AutocorrectQuery="{Binding ElementName=cbAutocorrect, Path=IsChecked}"
DistanceUnit="{Binding ElementName=lbDistanceUnits, Path=SelectedValue}"
ResultsCount="{Binding ElementName=tbCount, Path=Value}">
</dxm:BingSearchOptions>
</dxm:BingSearchDataProvider.SearchOptions>
</dxm:BingSearchDataProvider>
</dxm:InformationLayer.DataProvider>
<Button Grid.Row="2" Margin="4" Click="bSearch_Click">Search</Button>
Private Sub bSearch_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
tbSearchResult.Text = ""
searchProvider.Search(tbLocation.Text)
End Sub
private void bSearch_Click(object sender, RoutedEventArgs e) {
tbSearchResult.Text = "";
searchProvider.Search(tbLocation.Text);
}
See Also
How to: Connect a Map Control to the Bing Search Service
How to: Manually Process Location Information Receiving From Bing Search Service