google-maps-api-typings
v1.0.5
Published
TypeScript typings for `@google/maps` Node.JS API project.
Downloads
2,286
Readme
Google Maps API Typings
This project contains the TypeScript interface declaration of the @google/maps
Node.JS API project.
It also provides inline documentation from the official Google Maps Documentation platform.
Installation
Just install both the official Google Maps API package and the Google Maps API Typings using npm:
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 }
.
Supported APIs
- directions
- distanceMatrix
- elevation
- elevationAlongPath
- findPlace
- geocode
- geolocate
- nearestRoads
- place
- places
- placesAutoComplete
- placesNearby
- placesPhoto
- placesQueryAutoComplete
- placesRadar
- reverseGeocode
- snappedSpeedLimits
- snapToRoads
- speedLimits
- timezone
Note
Do not confuse the Google Maps Node.JS API with the Google Maps Javascript API.