Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]Welcome to DevExpress .NET Documentation
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Collapse]Map Control
   [Expand]Getting Started
    Layers
   [Expand]Coordinate Systems
   [Expand]Map Image Data
   [Collapse]GIS Data
     Search
     Geocode
     Routing
     Elevation
   [Expand]Vector Data
   [Expand]Visual Elements
   [Expand]End-User Interaction
   [Expand]Examples
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Diagram Control
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Search

The Map control supports the Microsoft’s Bing Search and the OpenStreetMap Search services, allowing you to embed a search functionality in your application. When this feature is enabled, you can type search criterion in the Build-in Search Panel (or use a custom UI), implement a request, and view the results in both the map and the search panel.

The BingSearchDataProvider and OsmSearchDataProvider classes represent the Bing Search and OpenStreetMap Search data providers which provide the search functionality. The sections below explain how to use a Search Data Provider in the Map control.

Important

Due to Bing canceling the SOAP service on July 30, 2017, the Map Control's Bing Search provider does not work correctly in version 16.1 and earlier.

Expanded Enabling Search

Do the following to enable search in the Map control:

The code snippet below shows how to do this.

You can also specify the request result count obtained from the service using the BingSearchDataProvider.SearchOptions property.

When the Map Control contains an Information Layer that provides Search data, the Map control automatically invokes its built-in search panel (the MapControl.ShowSearchPanel is set to true by default). Refer to the Search Panel topic to learn more about the built-in Search panel.

Expanded Using a Custom UI

The Map control provides a search functionality with additional parameters like a country region or postal code. Using this approach, you can build a custom search panel to get additional search results from the Search services.

Note

Set the MapControl.ShowSearchPanel property to false to disable the default Search panel when using this approach.

To start searching for a location, call the BingSearchDataProvider.Search or OsmSearchDataProvider.Search method.

For example, an Application's UI contains a text edit named "teKeywords" and a button named "btnSearch". To start a search, click the Search button which calls the following Search method overload:

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E4238.

Expanded Search Results

To get the search results, handle the BingSearchDataProvider.SearchCompleted or OsmSearchDataProvider.SearchCompleted event.

The SearchCompleted event handler arguments’ SearchCompletedEventArgs.RequestResult provides the SearchRequestResult descendant class instance to store Search results.

The results contain a display name, address, and the geographic coordinates (latitude and longitude) associated with the search location.

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E4238.

The search results for the "New York" keywords are shown in the image below.

Expanded See Also

Is this topic helpful?​​​​​​​