Creating a Search Experience
const [searchResults, setSearchResults] = useState<MPLocation[]|undefined>(undefined); const search = async (text: string | undefined) => {
if (text === undefined) {
console.debug('Clearing search');
setSearchResults(undefined);
return;
}
// Do search
console.debug(`Searching for "${text}"`);
const query = MPQuery.create({query: text});
const filter = MPFilter.create();
const locations = await MapsIndoors.getLocationsAsync(query, filter)
setSearchResults(locations);
(bottomSheet.current as BottomSheet).expand();
};Last updated
Was this helpful?