Create a Search Experience
Now you have simple app showing a map. In this step, you'll create a simple search and display the search results in a list. You'll also learn how to filter the data displayed on the map based on the
Create a Simple Query Search
Show a List of Search Results
private fun search(searchQuery: String) {
//Query with a string to search on
val mpQuery = MPQuery.Builder().setQuery(searchQuery).build()
//Filter for the search query, only taking 30 locations
val mpFilter = MPFilter.Builder().setTake(30).build()
//Query for the locations
MapsIndoors.getLocationsAsync(mpQuery, mpFilter) { list: List<MPLocation?>?, miError: MIError? ->
//Implement UI handling of the search result here
}
}Filter Locations on Map Based on Search Results

Last updated
Was this helpful?