Skip to content

Commit

Permalink
docs: add geocode example #454 (#734)
Browse files Browse the repository at this point in the history
  • Loading branch information
BaljeetSinghaw authored Jul 13, 2024
1 parent 3588e2f commit 5d0328a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,25 @@ export class Client {
geolocate(request: GeolocateRequest): Promise<GeolocateResponse> {
return geolocate(request, this.axiosInstance);
}
/**
* An example use of this function.
*
* ```javascript
* import { Client } from '@googlemaps/google-maps-services-js';
*
* const args = {
* params: {
* key: '<your-api-key>',
* address: 'Perth 4WD & Commercial Centre',
* }
* };
* const client = new Client();
* client.geocode(args).then(gcResponse => {
* const str = JSON.stringify(gcResponse.data.results[0]);
* console.log(`First result is: ${str}`);)
* });
* ```
*/
geocode(request: GeocodeRequest): Promise<GeocodeResponse> {
return geocode(request, this.axiosInstance);
}
Expand Down

0 comments on commit 5d0328a

Please sign in to comment.