TypeScript typings for `@google/maps` Node.JS API project.
npm install google-maps-api-typings@google/maps Node.JS API project.
npm i @google/maps
npm i google-maps-api-typings --save-dev
`
Usage
`
import 'google-maps-api-typings';
import { createClient } from "@google/maps";
const client = createClient({
key: 'my-google-maps-api-key',
language: 'jp',
Promise: Promise
});
client
.geocode({ address: 'Leaning Tower of Pisa' })
.asPromise()
.then(response => {
response.json.results.forEach(result => {
console.log(
result.geometry.location
);
})
});
`
This will output: { lat: 43.722952, lng: 10.396597 }`.