google-place-provider
This package provides google place API (with very simplified options)
We provide
- autocomplete
- place details
- find place search
- nearby search
- place photo
- text search
see original documents of google place
- google place autocomplete
- google place place details
- google place find place search
- google place nearby search
- google place photo
- google place text search
how to use
$ yarn add google-place-provider
; { try // create googlePlace class object const googlePlace = 'YOUR_API_KEY'; // autocomplete const autocomplete = await googlePlace; console; // placeDetails const placeDetails = await googlePlace; console; // findPlaceSearch const findPlaceSearch = await googlePlace; console; // nearbySearch const nearbySearch = await googlePlace; console; // placePhoto const placePhoto = await googlePlace; console; // textSearch const textSearch = await googlePlace; console; catch e throw e; } ;
types
;
type list
you can check more of types in type.ts
; terms: OffsetValue; types: string;} ;} enum Status OK = 'OK' ZERO_RESULTS = 'ZERO_RESULTS' OVER_QUERY_LIMIT = 'OVER_QUERY_LIMIT' REQUEST_DENIED = 'REQUEST_DENIED' INVALID_REQUEST = 'INVALID_REQUEST' UNKNOWN_ERROR = 'UNKNOWN_ERROR'
how to test
- create
.env
file on same level of folder ofsrc/
- like
.env.copy
, addGOOGLE_API_KEY
value on.env
- follow bottoms
$ yarn test