Unplanned
Last Updated: 12 May 2020 11:10 by ADMIN
Tim
Created on: 06 May 2020 11:54
Category: UI for WinForms
Type: Feature Request
0
RadMap: add auto suggest functionality in the search box for the Bing provider

When the RadMap.ShowSearchBar property is set to true and the BingRestMapProvider is used, it would be nice to have autocomplete suggestion while the user is typing:

https://docs.microsoft.com/en-us/bingmaps/rest-services/autosuggest

3 comments
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 12 May 2020 11:10

Hello, Tim, 

The MapSearchBarElement's SearchCriteriaChanged event is expected to be fired when the SearchTextBoxElement is filled with search criteria and the Enter key is pressed. In the event handler you will receive the search criteria and you are responsible for the rest of the search handling. That is RadMap will not perform any further actions related to the search.

If you have not subscribed to the SearchCriteriaChanged event you can set the SearchBarElement.SearchProvider property to an IMapSearchProvider instance. When you do this RadMap will initiate a new search through that provider. You should still handle the search result through the provider's SearchCompleted and SearchError events.

If you have not subscribed to the event and you have not set the SearchBarElement.SearchProvider property RadMap will go through its Providers collection and will initiate a search through the first provider that implements the IMapSearchProvider. Results will be displayed in a layer named Search. If the layer does not exist it will be added by RadMap. You should note that all overlays will be removed from the Search layer when a new search is initiated. Additional information about the search functionality that is available in RadMap is available here: https://docs.telerik.com/devtools/winforms/controls/map/providers/bingmaps/search

However, it seems that you want to use an external RadTextBox control. In order to benefit from the introduced events regarding the search functionality in RadMap, you can use the public SearchAsync method of the BingRestMapProvider. Call it whenever you need to look for a result passing the SearchRequest. Please refer to the last section in the previously referred help article demonstrating how to perform the search. Thus, you can call the method when the text in the external text box is changed.

You can also refer to our Demo application >> Map >> Bing Map services >> Search example. The Demo application is located in the installation folder of the suite. It is usually found at the following path: C:\Program Files (x86)\Progress\Telerik UI for WinForms R1 2020\Examples\QuickStart\Bin

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tim
Posted on: 06 May 2020 12:51
I also just read your email.  To clarify, no I do not want to use the searchbar.  I want to use a seperate textbox control that yes does attach to the bing maps autosuggest api.  In a previous post you mentioned something about subscribing to the searchbar event(s) in doing this.  So if I do use the searchbar event it will only be to attach to the radtextbox control that is a seperate textbox.
Tim
Posted on: 06 May 2020 12:47

I do not want to use the radmap searchbar.  I want to use a radtextbox and subscribe to the search bar event?  I am confused here as to what you are saying.  Can I subscribe to the searchbar event from a radtextbox to use the bing autosuggest api?  Again, help me understand if a) this can be done and b) if it can be done please provide me an example.

 

Thanks