Road Fuzzy Search
Search for road name fuzzy matches based on keywords.
The sample code is as follows:
RoadNameSuggest.Query query=RoadNameSuggest.Query.newQuery("Beijing-Tibet Expressway"); // Set the query city query.setCity("BEIJING"); RoadNameSuggest.searchRoadName(query, new RoadNameSuggest.Listener() { @Override public void onSuccess(String[] result) { // Request success } @Override public void onFail(APIStatus status) { //Request failed } });
RoadNameSuggest.Query Description:
1. RoadNameSuggest.Query.newQuery(String roadName) constructor, the parameter is the road name keyword, such as "Jingzang Expressway" or "Jingzang Expressway".
2. setCity(String city) sets the city, city is the full name of the city / abbreviation / national code pinyin (beijing), such as "Beijing" or "Beijing" or "beijing".
Note: The result return interface is an asynchronous thread interface. If the Android project needs to operate the control in the return, it must switch to the Main main thread.