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
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
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