Stadia Maps TypeScript APIs
This SDK helps you access the full range of geospatial APIs from Stadia Maps.
Getting started
First, add @stadiamaps/api
as a dependency of your project using your favorite package manager
like npm
or yarn
. Something like this:
npm install --save @stadiamaps/api
The library exposes 3 different API classes for grouping functionality: GeocodingApi
,
GeospatialApi
, and RoutingApi
. These correspond to the sections in our online
API Reference.
All clients have the same interface and only expose different methods. Here is an
example of getting started with the geocoding API:
import { GeocodingApi, Configuration } from '@stadiamaps/api';
const config = new Configuration({ apiKey: "YOUR-API-KEY" });
const api = new GeocodingApi(config);
api.reverse({ pointLat: 59.44436, pointLon: 24.75071 }).then(function (result) {
console.log(result);
}, function (err) {
console.log(err);
});
const res = await api.search({ text: "Põhja pst 27a" });
Documentation
TypeScript hints and autocomplete only go so far. Check out our official documentation at
docs.stadiamaps.com for both long-form prose explanation of the finer
details and a compact API reference.
Developing
Refer to DEVELOPING.md for details on local development.