Skip to main content

Function: useGeoVisProximitySearch()

useGeoVisProximitySearch(): GeoVisProximitySearchValue | null

Defined in: react/proximityContext.ts:133

The proximity search of the nearest <GeoVisProvider> — see GeoVisProximitySearchValue. Readable anywhere under the provider, so the app can show the results in a panel of its own and drive the search from it.

Returns​

GeoVisProximitySearchValue | null

The search, or null when the spec declares no proximitySearch.

Example​

const search = useGeoVisProximitySearch();
if (search?.status === 'done') {
return search.results.map((place) => {
return <Row key={place.id} onClick={() => search.select(place.id)} />;
});
}