SearchNearby
Source:
src/AWS/GeoPlaces/SearchNearby.ts
Runtime binding for geo-places:SearchNearby — find places around a
geographic position, optionally filtered by radius, bounding box,
categories, or food types.
geo-places is a standalone, pay-per-call Amazon Location API with no
resource to manage: the binding takes no arguments and grants the function
geo-places:SearchNearby. Requests and responses are raw distilled types
(no marshalling).
Searching Nearby Places
Section titled “Searching Nearby Places”Provide the SearchNearbyHttp implementation layer on the Function effect
(.pipe(Effect.provide(AWS.GeoPlaces.SearchNearbyHttp))), bind in the
init phase, then call the client at runtime.
// initconst searchNearby = yield* AWS.GeoPlaces.SearchNearby();
// runtimeconst result = yield* searchNearby({ QueryPosition: [-122.3493, 47.6205], // [lng, lat] QueryRadius: 1000, MaxResults: 5,});const titles = result.ResultItems?.map((item) => item.Title);